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