README 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. Layerscape Quick Start
  2. This is a quick start guide for Layerscape specific usage, like introducing
  3. how to configure, build, and deploy OpenWrt to Layerscape boards, so that
  4. users can bring up the board without difficulty.
  5. 1. Target support
  6. ----------------------------
  7. * ARMv8 64-bit
  8. LS1012ARDB (QSPI NOR boot)
  9. LS1012AFRDM (QSPI NOR boot)
  10. LS1012AFRWY (QSPI NOR boot)
  11. LS1028ARDB (QSPI NOR boot | SD card boot)
  12. LS1043ARDB (NOR boot | SD card boot)
  13. LS1046ARDB (QSPI NOR boot | SD card boot)
  14. LS1046AFRWY (QSPI NOR boot | SD card boot)
  15. LS1088ARDB (QSPI NOR boot | SD card boot)
  16. LS2088ARDB (NOR boot)
  17. LX2160ARDB Rev2.0 (FlexSPI NOR boot | SD card boot)
  18. * ARMv7
  19. LS1021ATWR (NOR boot | SD card boot)
  20. LS1021AIOT (SD card boot)
  21. 2. Build
  22. --------
  23. Before configuration and build, update and install package feeds.
  24. $ ./scripts/feeds update -a
  25. $ ./scripts/feeds install -a
  26. * make menuconfig
  27. Target System: "NXP Layerscape"
  28. Subtarget: (Select subtarget)
  29. Target Profile: (Select device, or "Multiple devices")
  30. Target Devices: (Select devices. Available when Target Profile is "Multiple devices")
  31. Target Images: (Disable "GZip images" if you don't want to unzip manually to use the images.)
  32. Note: The first time make menuconfig would create a .config file which
  33. would include all dependencies for selected target. After that, make
  34. menuconfig still could be used to modify packages. If want to change
  35. other target, please remove .config and make menuconfig to select again.
  36. Otherwise the packages selected in .config would be a mess.
  37. * make download (or make download -j<n>)
  38. * make (or make -j<n>)
  39. * Final firmware/image
  40. Path: bin/targets/layerscape/<subtarget>/
  41. Firmware for flash: openwrt-layerscape-<subtarget>-<device>-<rootfs>-firmware.bin
  42. Image for SD card: openwrt-layerscape-<subtarget>-<device>-<rootfs>-sdcard.img.gz
  43. Sysupgrade images: openwrt-layerscape-<subtarget>-<device>-<rootfs>-sysupgrade.bin
  44. 3. Deploy
  45. ---------
  46. The firmware.bin or sdcard.img is an all-in-one image including all things
  47. for OpenWrt staring up except LS1012AFRWY (Refer to 3.3).
  48. If you want to install all things into flash, please use firmware.bin.
  49. If you want to install all things into SD card, please use sdcard.img.
  50. 3.1 Program sdcard.img to SD card
  51. ---------------------------------
  52. sdcard.img could be programmed to SD card in either u-boot environment
  53. or linux environment. After programming, configure the board to boot
  54. from SD card. (sdcard.img images are gz-iped to save space. Please extract them first.)
  55. * u-boot environment
  56. => tftp a0000000 <image_name>-sdcard.img
  57. => mmc write a0000000 0 a0000
  58. Note: The default sdcard.img size is 320MB. a0000 is the block number for 320MB.
  59. blk_num = filesize / 512.
  60. * linux environment
  61. $ dd if=./<image_name>-sdcard.img of=/dev/mmcblkx
  62. Note: Need to check the SD card device name to replace "mmcblkx".
  63. 3.2 Program firmware.bin to flash
  64. ---------------------------------
  65. * LS1012ARDB
  66. Start up from bank1, and program firmware to bank2 with below commands.
  67. Switch to bank2 to start up OpenWrt.
  68. => tftp a0000000 <firmware_name>-firmware.bin
  69. => i2c mw 0x24 0x7 0xfc;i2c mw 0x24 0x3 0xf5
  70. => sf probe 0:0
  71. => sf erase 0 +$filesize
  72. => sf write a0000000 0 $filesize
  73. => reset
  74. * LS1028ARDB
  75. Board has only one bank. Those commands will replace stock bootloader
  76. and firmware.
  77. => tftp a0000000 <firmware_name>-firmware.bin
  78. => sf probe 0:0
  79. => sf erase 0 +$filesize
  80. => sf write a0000000 0 $filesize
  81. => reset
  82. * LS1043ARDB
  83. Start up from bank0, and program firmware to bank4 with below commands.
  84. Switch to bank4 to start up OpenWrt.
  85. => tftp a0000000 <firmware_name>-firmware.bin
  86. => protect off all
  87. => erase 64000000 +$filesize
  88. => cp.b a0000000 64000000 $filesize
  89. => cpld reset altbank
  90. * LS1046ARDB
  91. Start up from bank1, and program firmware to bank2 with below commands.
  92. Switch to bank2 to start up OpenWrt.
  93. => tftp a0000000 <firmware_name>-firmware.bin
  94. => sf probe 0:1
  95. => sf erase 0 +$filesize
  96. => sf write a0000000 0 $filesize
  97. => cpld reset altbank
  98. * LS2088ARDB
  99. Start up from bank0, and program firmware to bank4 with below commands.
  100. Switch to bank4 to start up OpenWrt.
  101. => tftp a0000000 <firmware_name>-firmware.bin
  102. => protect off all
  103. => erase 584000000 +$filesize
  104. => cp.b a0000000 584000000 $filesize
  105. => qix altbank
  106. * LS1012FRDM/LS1046AFRWY
  107. Board has only one bank. Those commands will replace stock bootloader
  108. and firmware.
  109. => tftp a0000000 <firmware_name>-firmware.bin
  110. => sf probe 0:0
  111. => sf erase 0 +$filesize
  112. => sf write a0000000 0 $filesize
  113. => reset
  114. * LS1088ARDB/LX2160ARDB Rev2.0
  115. Start up from bank0, and program firmware to bank1 with below commands.
  116. Switch to bank1 to start up OpenWrt.
  117. => tftp a0000000 <firmware_name>-firmware.bin
  118. => sf probe 0:1
  119. => sf erase 0 +$filesize
  120. => sf write a0000000 0 $filesize
  121. => qix altbank
  122. Note: old version u-boot of ls1088ardb may use below commands to switch to
  123. bank1 instead of 'qix altbank'.
  124. => i2c mw 66 50 20;i2c mw 66 10 20;i2c mw 66 10 21
  125. * LS1021ATWR
  126. Start up from bank0, and program firmware to bank4 with below commands.
  127. Switch to bank4 to start up OpenWrt.
  128. => tftp a0000000 <firmware_name>-firmware.bin
  129. => protect off all
  130. => erase 64000000 +$filesize
  131. => cp.b a0000000 64000000 $filesize
  132. => boot_bank 1
  133. 3.3 Program LS1012AFRWY
  134. -----------------------
  135. * LS1012AFRWY (QSPI flash + SD card)
  136. LS1012AFRWY only supports 2MB QSPI flash. We have to put u-boot, and
  137. some firmwares on QSPI flash, and kernel/dtb/rootfs on SD card.
  138. So both firmware.bin and sdcard.img are needed for OpenWrt starting up.
  139. To program sdcard.img, please use linux command described in 3.1 on a
  140. linux machine.
  141. To program firmware.bin, start up board from QSPI flash, and program
  142. firmware with below commands. Reset to start up OpenWrt. (LS1012AFRWY
  143. supports only one bank.)
  144. => tftp 96000000 <firmware_name>-firmware.bin
  145. => sf probe 0:0
  146. => sf erase 0 +$filesize
  147. => sf write 96000000 0 $filesize
  148. => reset
  149. 4. Known issues and limitation
  150. ------------------------------
  151. * U-boot may fail to read MAC addresses from EEPROM on some boards and there
  152. won't be MAC addresses set in environment. This may cause kernel fails to
  153. probe these network interfaces. The workaround is to set MAC addresses
  154. manually, for example,
  155. => setenv ethaddr 00:04:9F:04:65:4b
  156. => setenv eth1addr 00:04:9F:04:65:4c
  157. => saveenv
  158. * In case users want to refer Layerscape SDK doc for network configuration,
  159. like TSN (Time-Sensitive Networking) on LS1028A, the OpenWrt LAN/WAN router
  160. setting should be removed before that.
  161. # ubus call network.interface.lan remove
  162. # ubus call network.interface.wan remove
  163. # ubus call network.interface.wan6 remove
  164. And firewall may be needed to stop.
  165. # /etc/init.d/firewall stop
  166. 5. Other references
  167. -------------------
  168. - NXP LSDK source: https://lsdk.github.io/
  169. - NXP LSDK site: https://www.nxp.com/design/software/embedded-software/linux-software-and-development-tools/layerscape-software-development-kit:LAYERSCAPE-SDK
  170. - OpenWrt documentation: https://openwrt.org/docs/start