layerscape: add SD card boot support
[openwrt/openwrt.git] / target / linux / layerscape / image / armv8_64b.mk
1 #
2 # Copyright 2018 NXP
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 define Device/Default
9 PROFILES := Default
10 IMAGES := firmware.bin
11 FILESYSTEMS := ubifs
12 KERNEL := kernel-bin | gzip | uImage gzip
13 KERNEL_LOADADDR := 0x80080000
14 KERNEL_ENTRY_POINT := 0x80080000
15 endef
16
17 define Device/ls1012ardb
18 DEVICE_TITLE := LS1012ARDB
19 DEVICE_PACKAGES += \
20 layerscape-rcw-ls1012ardb \
21 layerscape-ppfe \
22 layerscape-ppa-ls1012ardb \
23 kmod-ppfe
24 DEVICE_DTS := freescale/fsl-ls1012a-rdb
25 UBIFS_OPTS := -m 1 -e 262016 -c 128
26 UBINIZE_OPTS := -E 5
27 BLOCKSIZE := 256KiB
28 PAGESIZE := 1
29 IMAGE/firmware.bin := \
30 ls-clean | \
31 ls-append $(1)-rcw.bin | pad-to 1M | \
32 ls-append $(1)-uboot.bin | pad-to 3M | \
33 ls-append $(1)-uboot-env.bin | pad-to 4M | \
34 ls-append $(1)-ppa.itb | pad-to 10M | \
35 ls-append pfe.itb | pad-to 15M | \
36 ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
37 append-kernel | pad-to 32M | \
38 append-ubi | check-size 67108865
39 endef
40 TARGET_DEVICES += ls1012ardb
41
42 define Device/ls1012afrdm
43 DEVICE_TITLE := LS1012AFRDM
44 DEVICE_PACKAGES += \
45 layerscape-rcw-ls1012afrdm \
46 layerscape-ppfe \
47 layerscape-ppa-ls1012afrdm \
48 kmod-ppfe
49 DEVICE_DTS := freescale/fsl-ls1012a-frdm
50 UBIFS_OPTS := -m 1 -e 262016 -c 128
51 UBINIZE_OPTS := -E 5
52 BLOCKSIZE := 256KiB
53 PAGESIZE := 1
54 IMAGE/firmware.bin := \
55 ls-clean | \
56 ls-append $(1)-rcw.bin | pad-to 1M | \
57 ls-append $(1)-uboot.bin | pad-to 3M | \
58 ls-append $(1)-uboot-env.bin | pad-to 4M | \
59 ls-append $(1)-ppa.itb | pad-to 10M | \
60 ls-append pfe.itb | pad-to 15M | \
61 ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
62 append-kernel | pad-to 32M | \
63 append-ubi | check-size 67108865
64 endef
65 TARGET_DEVICES += ls1012afrdm
66
67 define Device/ls1043ardb
68 DEVICE_TITLE := LS1043ARDB
69 DEVICE_PACKAGES += \
70 layerscape-rcw-ls1043ardb \
71 layerscape-fman-ls1043ardb \
72 layerscape-ppa-ls1043ardb
73 DEVICE_DTS := freescale/fsl-ls1043a-rdb-sdk
74 FILESYSTEMS := squashfs
75 IMAGE/firmware.bin := \
76 ls-clean | \
77 ls-append $(1)-rcw.bin | pad-to 1M | \
78 ls-append $(1)-uboot.bin | pad-to 3M | \
79 ls-append $(1)-uboot-env.bin | pad-to 4M | \
80 ls-append $(1)-ppa.itb | pad-to 9M | \
81 ls-append $(1)-fman.bin | pad-to 15M | \
82 ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
83 append-kernel | pad-to 32M | \
84 append-rootfs | pad-rootfs | check-size 67108865
85 endef
86 TARGET_DEVICES += ls1043ardb
87
88 define Device/ls1043ardb-sdboot
89 DEVICE_TITLE := LS1043ARDB (SD Card Boot)
90 DEVICE_PACKAGES += \
91 layerscape-fman-ls1043ardb \
92 layerscape-ppa-ls1043ardb
93 DEVICE_DTS := freescale/fsl-ls1043a-rdb-sdk
94 FILESYSTEMS := ext4
95 IMAGES := sdcard.img
96 IMAGE/sdcard.img := \
97 ls-clean | \
98 ls-append-sdhead $(1) | pad-to 4K | \
99 ls-append $(1)-uboot.bin | pad-to 3M | \
100 ls-append $(1)-uboot-env.bin | pad-to 4M | \
101 ls-append ls1043ardb-ppa.itb | pad-to 9M | \
102 ls-append ls1043ardb-fman.bin | pad-to 15M | \
103 ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
104 append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
105 append-rootfs | check-size $(LS_SD_IMAGE_SIZE)
106 endef
107 TARGET_DEVICES += ls1043ardb-sdboot
108
109 define Device/ls1046ardb
110 DEVICE_TITLE := LS1046ARDB
111 DEVICE_PACKAGES += \
112 layerscape-rcw-ls1046ardb \
113 layerscape-fman-ls1046ardb \
114 layerscape-ppa-ls1046ardb
115 DEVICE_DTS := freescale/fsl-ls1046a-rdb-sdk
116 UBIFS_OPTS := -m 1 -e 262016 -c 128
117 UBINIZE_OPTS := -E 5
118 BLOCKSIZE := 256KiB
119 PAGESIZE := 1
120 IMAGE/firmware.bin := \
121 ls-clean | \
122 ls-append $(1)-rcw.bin | pad-to 1M | \
123 ls-append $(1)-uboot.bin | pad-to 3M | \
124 ls-append $(1)-uboot-env.bin | pad-to 4M | \
125 ls-append $(1)-ppa.itb | pad-to 9M | \
126 ls-append $(1)-fman.bin | pad-to 15M | \
127 ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
128 append-kernel | pad-to 32M | \
129 append-ubi | check-size 67108865
130 endef
131 TARGET_DEVICES += ls1046ardb
132
133 define Device/ls1046ardb-sdboot
134 DEVICE_TITLE := LS1046ARDB (SD Card Boot)
135 DEVICE_PACKAGES += \
136 layerscape-fman-ls1046ardb \
137 layerscape-ppa-ls1046ardb
138 DEVICE_DTS := freescale/fsl-ls1046a-rdb-sdk
139 FILESYSTEMS := ext4
140 IMAGES := sdcard.img
141 IMAGE/sdcard.img := \
142 ls-clean | \
143 ls-append-sdhead $(1) | pad-to 4K | \
144 ls-append $(1)-uboot.bin | pad-to 3M | \
145 ls-append $(1)-uboot-env.bin | pad-to 4M | \
146 ls-append ls1046ardb-ppa.itb | pad-to 9M | \
147 ls-append ls1046ardb-fman.bin | pad-to 15M | \
148 ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
149 append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
150 append-rootfs | check-size $(LS_SD_IMAGE_SIZE)
151 endef
152 TARGET_DEVICES += ls1046ardb-sdboot
153
154 define Device/ls1088ardb
155 DEVICE_TITLE := LS1088ARDB
156 DEVICE_PACKAGES += \
157 layerscape-rcw-ls1088ardb \
158 layerscape-mc-ls1088ardb \
159 layerscape-dpl-ls1088ardb \
160 layerscape-ppa-ls1088ardb \
161 restool
162 DEVICE_DTS := freescale/fsl-ls1088a-rdb
163 UBIFS_OPTS := -m 1 -e 262016 -c 128
164 UBINIZE_OPTS := -E 5
165 BLOCKSIZE := 256KiB
166 PAGESIZE := 1
167 IMAGE/firmware.bin := \
168 ls-clean | \
169 ls-append $(1)-rcw.bin | pad-to 1M | \
170 ls-append $(1)-uboot.bin | pad-to 3M | \
171 ls-append $(1)-uboot-env.bin | pad-to 4M | \
172 ls-append $(1)-ppa.itb | pad-to 10M | \
173 ls-append $(1)-mc.itb | pad-to 13M | \
174 ls-append $(1)-dpl.dtb | pad-to 14M | \
175 ls-append $(1)-dpc.dtb | pad-to 15M | \
176 ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
177 append-kernel | pad-to 32M | \
178 append-ubi | check-size 67108865
179 endef
180 TARGET_DEVICES += ls1088ardb
181
182 define Device/ls1088ardb-sdboot
183 DEVICE_TITLE := LS1088ARDB (SD Card Boot)
184 DEVICE_PACKAGES += \
185 layerscape-rcw-ls1088ardb-sdboot \
186 layerscape-mc-ls1088ardb \
187 layerscape-dpl-ls1088ardb \
188 layerscape-ppa-ls1088ardb \
189 restool
190 DEVICE_DTS := freescale/fsl-ls1088a-rdb
191 FILESYSTEMS := ext4
192 IMAGES := sdcard.img
193 IMAGE/sdcard.img := \
194 ls-clean | \
195 ls-append-sdhead $(1) | pad-to 4K | \
196 ls-append $(1)-rcw.bin | pad-to 1M | \
197 ls-append $(1)-uboot.bin | pad-to 3M | \
198 ls-append $(1)-uboot-env.bin | pad-to 4M | \
199 ls-append ls1088ardb-ppa.itb | pad-to 10M | \
200 ls-append ls1088ardb-mc.itb | pad-to 13M | \
201 ls-append ls1088ardb-dpl.dtb | pad-to 14M | \
202 ls-append ls1088ardb-dpc.dtb | pad-to 15M | \
203 ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
204 append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
205 append-rootfs | check-size $(LS_SD_IMAGE_SIZE)
206 endef
207 TARGET_DEVICES += ls1088ardb-sdboot
208
209 define Device/ls2088ardb
210 DEVICE_TITLE := LS2088ARDB
211 DEVICE_PACKAGES += \
212 layerscape-rcw-ls2088ardb \
213 layerscape-mc-ls2088ardb \
214 layerscape-dpl-ls2088ardb \
215 layerscape-ppa-ls2088ardb \
216 restool
217 DEVICE_DTS := freescale/fsl-ls2088a-rdb
218 FILESYSTEMS := squashfs
219 IMAGE/firmware.bin := \
220 ls-clean | \
221 ls-append $(1)-rcw.bin | pad-to 1M | \
222 ls-append $(1)-uboot.bin | pad-to 3M | \
223 ls-append $(1)-uboot-env.bin | pad-to 4M | \
224 ls-append $(1)-ppa.itb | pad-to 10M | \
225 ls-append $(1)-mc.itb | pad-to 13M | \
226 ls-append $(1)-dpl.dtb | pad-to 14M | \
227 ls-append $(1)-dpc.dtb | pad-to 15M | \
228 ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
229 append-kernel | pad-to 32M | \
230 append-rootfs | pad-rootfs | check-size 67108865
231 endef
232 TARGET_DEVICES += ls2088ardb
233
234 define Device/traverse-five64
235 KERNEL_NAME := Image
236 KERNEL_SUFFIX := -kernel.itb
237 KERNEL_INSTALL := 1
238 FDT_LOADADDR = 0x90000000
239 FILESYSTEMS := ubifs
240 DEVICE_TITLE := Traverse LS1043 Boards (Five64, LS1043S)
241 DEVICE_PACKAGES += \
242 layerscape-fman-ls1043ardb \
243 uboot-envtools uboot-traverse-ls1043v uboot-traverse-ls1043v-sdcard \
244 kmod-i2c-core kmod-i2c-mux-pca954x \
245 kmod-hwmon-core kmod-hwmon-ltc2990 kmod-hwmon-pac1934 kmod-hwmon-emc17xx\
246 kmod-gpio-pca953x kmod-input-gpio-keys-polled \
247 kmod-rtc-isl1208
248 DEVICE_DESCRIPTION = \
249 Build images for Traverse LS1043 boards. This generates a single image \
250 capable of booting on any of the boards in this family.
251 DEVICE_DTS = freescale/traverse-ls1043s
252 DEVICE_DTS_DIR = $(LINUX_DIR)/arch/arm64/boot/dts
253 DEVICE_DTS_CONFIG = ls1043s
254 KERNEL := kernel-bin | gzip | traverse-fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb $$(FDT_LOADADDR)
255 KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb $$(FDT_LOADADDR)
256 IMAGES = root sysupgrade.tar
257 IMAGE/root = append-rootfs
258 IMAGE/sysupgrade.tar = sysupgrade-tar
259 UBIFS_OPTS := -m 2048 -e 124KiB -c 4096
260 endef
261 TARGET_DEVICES += traverse-five64