ath79: update WA/XC devices UBNT_VERSION to 8.7.4
[openwrt/staging/wigyori.git] / target / linux / layerscape / README
1
2 Layerscape Quick Start
3
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.
7
8
9 1. Target support
10 ----------------------------
11 * ARMv8 64-bit
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)
20 LS2088ARDB (NOR boot)
21 LX2160ARDB Rev2.0 (FlexSPI NOR boot | SD card boot)
22
23 * ARMv7
24 LS1021ATWR (NOR boot | SD card boot)
25 LS1021AIOT (SD card boot)
26
27
28 2. Build
29 --------
30 Before configuration and build, update and install package feeds.
31
32 $ ./scripts/feeds update -a
33 $ ./scripts/feeds install -a
34
35 * make menuconfig
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.)
41
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.
47
48 * make download (or make download -j<n>)
49
50 * make (or make -j<n>)
51
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
57
58
59 3. Deploy
60 ---------
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.
65
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.)
71
72 * u-boot environment
73
74 => tftp a0000000 <image_name>-sdcard.img
75 => mmc write a0000000 0 a0000
76
77 Note: The default sdcard.img size is 320MB. a0000 is the block number for 320MB.
78 blk_num = filesize / 512.
79
80 * linux environment
81
82 $ dd if=./<image_name>-sdcard.img of=/dev/mmcblkx
83
84 Note: Need to check the SD card device name to replace "mmcblkx".
85
86 3.2 Program firmware.bin to flash
87 ---------------------------------
88 * LS1012ARDB
89 Start up from bank1, and program firmware to bank2 with below commands.
90 Switch to bank2 to start up OpenWrt.
91
92 => tftp a0000000 <firmware_name>-firmware.bin
93 => i2c mw 0x24 0x7 0xfc;i2c mw 0x24 0x3 0xf5
94 => sf probe 0:0
95 => sf erase 0 +$filesize
96 => sf write a0000000 0 $filesize
97 => reset
98
99 * LS1028ARDB
100 Board has only one bank. Those commands will replace stock bootloader
101 and firmware.
102 => tftp a0000000 <firmware_name>-firmware.bin
103 => sf probe 0:0
104 => sf erase 0 +$filesize
105 => sf write a0000000 0 $filesize
106 => reset
107
108 * LS1043ARDB
109 Start up from bank0, and program firmware to bank4 with below commands.
110 Switch to bank4 to start up OpenWrt.
111
112 => tftp a0000000 <firmware_name>-firmware.bin
113 => protect off all
114 => erase 64000000 +$filesize
115 => cp.b a0000000 64000000 $filesize
116 => cpld reset altbank
117
118 * LS1046ARDB
119 Start up from bank1, and program firmware to bank2 with below commands.
120 Switch to bank2 to start up OpenWrt.
121
122 => tftp a0000000 <firmware_name>-firmware.bin
123 => sf probe 0:1
124 => sf erase 0 +$filesize
125 => sf write a0000000 0 $filesize
126 => cpld reset altbank
127
128 * LS2088ARDB
129 Start up from bank0, and program firmware to bank4 with below commands.
130 Switch to bank4 to start up OpenWrt.
131
132 => tftp a0000000 <firmware_name>-firmware.bin
133 => protect off all
134 => erase 584000000 +$filesize
135 => cp.b a0000000 584000000 $filesize
136 => qix altbank
137
138 * LS1012FRDM/LS1046AFRWY
139 Board has only one bank. Those commands will replace stock bootloader
140 and firmware.
141
142 => tftp a0000000 <firmware_name>-firmware.bin
143 => sf probe 0:0
144 => sf erase 0 +$filesize
145 => sf write a0000000 0 $filesize
146 => reset
147
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.
151
152 => tftp a0000000 <firmware_name>-firmware.bin
153 => sf probe 0:1
154 => sf erase 0 +$filesize
155 => sf write a0000000 0 $filesize
156 => qix altbank
157
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
161
162 * LS1021ATWR
163 Start up from bank0, and program firmware to bank4 with below commands.
164 Switch to bank4 to start up OpenWrt.
165
166 => tftp a0000000 <firmware_name>-firmware.bin
167 => protect off all
168 => erase 64000000 +$filesize
169 => cp.b a0000000 64000000 $filesize
170 => boot_bank 1
171
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.
178
179 To program sdcard.img, please use linux command described in 3.1 on a
180 linux machine.
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.)
184
185 => tftp 96000000 <firmware_name>-firmware.bin
186 => sf probe 0:0
187 => sf erase 0 +$filesize
188 => sf write 96000000 0 $filesize
189 => reset
190
191
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,
198
199 => setenv ethaddr 00:04:9F:04:65:4b
200 => setenv eth1addr 00:04:9F:04:65:4c
201 => saveenv
202
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.
206
207 # ubus call network.interface.lan remove
208 # ubus call network.interface.wan remove
209 # ubus call network.interface.wan6 remove
210
211 And firewall may be needed to stop.
212
213 # /etc/init.d/firewall stop
214
215
216 5. Other references
217 -------------------
218 - NXP LSDK source: https://lsdk.github.io/
219
220 - NXP LSDK site: https://www.nxp.com/design/software/embedded-software/linux-software-and-development-tools/layerscape-software-development-kit:LAYERSCAPE-SDK
221
222 - OpenWrt documentation: https://openwrt.org/docs/start