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