README 6.8 KB

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