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