ramips: extract board name from device tree as a fallback
[openwrt/openwrt.git] / target / linux / ramips / image / mt7621.mk
1 #
2 # MT7621 Profiles
3 #
4
5 DEVICE_VARS += TPLINK_BOARD_ID TPLINK_HEADER_VERSION TPLINK_HWID TPLINK_HWREV
6
7 define Build/ubnt-erx-factory-image
8 if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(KERNEL_SIZE)" ]; then \
9 echo '21001:6' > $(1).compat; \
10 $(TAR) -cf $(1) --transform='s/^.*/compat/' $(1).compat; \
11 \
12 $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp/' $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE); \
13 mkhash md5 $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) > $(1).md5; \
14 $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp.md5/' $(1).md5; \
15 \
16 echo "dummy" > $(1).rootfs; \
17 $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp/' $(1).rootfs; \
18 \
19 mkhash md5 $(1).rootfs > $(1).md5; \
20 $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp.md5/' $(1).md5; \
21 \
22 echo '$(BOARD) $(VERSION_CODE) $(VERSION_NUMBER)' > $(1).version; \
23 $(TAR) -rf $(1) --transform='s/^.*/version.tmp/' $(1).version; \
24 \
25 $(CP) $(1) $(BIN_DIR)/; \
26 else \
27 echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \
28 fi
29 endef
30
31 define Device/11acnas
32 DTS := 11ACNAS
33 IMAGE_SIZE := $(ralink_default_fw_size_16M)
34 DEVICE_TITLE := WeVO 11AC NAS Router
35 DEVICE_PACKAGES := kmod-mt7603 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
36 endef
37 TARGET_DEVICES += 11acnas
38
39 define Device/dir-860l-b1
40 DTS := DIR-860L-B1
41 BLOCKSIZE := 64k
42 IMAGES += factory.bin
43 KERNEL := kernel-bin | patch-dtb | relocate-kernel | lzma | uImage lzma
44 IMAGE_SIZE := $(ralink_default_fw_size_16M)
45 IMAGE/sysupgrade.bin := \
46 append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
47 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
48 pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
49 IMAGE/factory.bin := \
50 append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
51 append-rootfs | pad-rootfs -x 64 | \
52 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
53 seama-seal -m "signature=wrgac13_dlink.2013gui_dir860lb" | \
54 check-size $$$$(IMAGE_SIZE)
55 DEVICE_TITLE := D-Link DIR-860L B1
56 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
57 endef
58 TARGET_DEVICES += dir-860l-b1
59
60 define Device/ew1200
61 DTS := EW1200
62 IMAGE_SIZE := $(ralink_default_fw_size_16M)
63 DEVICE_TITLE := AFOUNDRY EW1200
64 DEVICE_PACKAGES := \
65 kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-mt7603 kmod-usb3 \
66 kmod-usb-ledtrig-usbport wpad-mini
67 endef
68 TARGET_DEVICES += ew1200
69
70 define Device/firewrt
71 DTS := FIREWRT
72 IMAGE_SIZE := $(ralink_default_fw_size_16M)
73 DEVICE_TITLE := Firefly FireWRT
74 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
75 endef
76 TARGET_DEVICES += firewrt
77
78 define Device/gb-pc1
79 DTS := GB-PC1
80 DEVICE_TITLE := GnuBee Personal Cloud One
81 DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620
82 IMAGE_SIZE := $(ralink_default_fw_size_32M)
83 endef
84 TARGET_DEVICES += gb-pc1
85
86 define Device/hc5962
87 DTS := HC5962
88 BLOCKSIZE := 128k
89 PAGESIZE := 2048
90 KERNEL_SIZE := 2097152
91 UBINIZE_OPTS := -E 5
92 IMAGE_SIZE := $(ralink_default_fw_size_32M)
93 IMAGES += factory.bin
94 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
95 IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE)
96 DEVICE_TITLE := HiWiFi HC5962
97 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 wpad-mini
98 endef
99 TARGET_DEVICES += hc5962
100
101 define Device/k2p
102 DTS := K2P
103 IMAGE_SIZE := $(ralink_default_fw_size_16M)
104 DEVICE_TITLE := Phicomm K2P
105 endef
106 TARGET_DEVICES += k2p
107
108 define Device/mir3g
109 DTS := MIR3G
110 BLOCKSIZE := 128k
111 PAGESIZE := 2048
112 KERNEL_SIZE := 4096k
113 KERNEL := $(KERNEL_DTB) | uImage lzma
114 IMAGE_SIZE := 32768k
115 UBINIZE_OPTS := -E 5
116 IMAGES := sysupgrade.tar kernel1.bin rootfs0.bin
117 IMAGE/kernel1.bin := append-kernel
118 IMAGE/rootfs0.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
119 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
120 DEVICE_TITLE := Xiaomi Mi Router 3G
121 SUPPORTED_DEVICES += R3G
122 DEVICE_PACKAGES := \
123 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini \
124 uboot-envtools
125 endef
126 TARGET_DEVICES += mir3g
127
128 define Device/mt7621
129 DTS := MT7621
130 BLOCKSIZE := 64k
131 IMAGE_SIZE := $(ralink_default_fw_size_4M)
132 DEVICE_TITLE := MediaTek MT7621 EVB
133 endef
134 TARGET_DEVICES += mt7621
135
136 define Device/newifi-d1
137 DTS := Newifi-D1
138 IMAGE_SIZE := $(ralink_default_fw_size_32M)
139 DEVICE_TITLE := Newifi D1
140 DEVICE_PACKAGES := \
141 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
142 endef
143 TARGET_DEVICES += newifi-d1
144
145 define Device/pbr-m1
146 DTS := PBR-M1
147 IMAGE_SIZE := $(ralink_default_fw_size_16M)
148 DEVICE_TITLE := PBR-M1
149 DEVICE_PACKAGES := \
150 kmod-ata-core kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \
151 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
152 endef
153 TARGET_DEVICES += pbr-m1
154
155 define Device/r6220
156 DTS := R6220
157 BLOCKSIZE := 128k
158 PAGESIZE := 2048
159 KERNEL_SIZE := 4096k
160 KERNEL := $(KERNEL_DTB) | uImage lzma
161 IMAGE_SIZE := 28672k
162 UBINIZE_OPTS := -E 5
163 IMAGES := sysupgrade.tar kernel.bin rootfs.bin
164 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
165 IMAGE/kernel.bin := append-kernel
166 IMAGE/rootfs.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
167 DEVICE_TITLE := Netgear R6220
168 DEVICE_PACKAGES := \
169 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
170 endef
171 TARGET_DEVICES += r6220
172
173 define Device/rb750gr3
174 DTS := RB750Gr3
175 IMAGE_SIZE := $(ralink_default_fw_size_16M)
176 DEVICE_TITLE := MikroTik RB750Gr3
177 DEVICE_PACKAGES := kmod-usb3 uboot-envtools
178 endef
179 TARGET_DEVICES += rb750gr3
180
181 define Device/re350-v1
182 DTS := RE350
183 DEVICE_TITLE := TP-LINK RE350 v1
184 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-mini
185 TPLINK_BOARD_ID := RE350-V1
186 TPLINK_HWID := 0x0
187 TPLINK_HWREV := 0
188 TPLINK_HEADER_VERSION := 1
189 IMAGE_SIZE := 6016k
190 KERNEL := $(KERNEL_DTB) | tplink-v1-header -e
191 IMAGES := sysupgrade.bin factory.bin
192 IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | append-metadata | check-size $$$$(IMAGE_SIZE)
193 IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
194 endef
195 TARGET_DEVICES += re350-v1
196
197 define Device/re6500
198 DTS := RE6500
199 DEVICE_TITLE := Linksys RE6500
200 DEVICE_PACKAGES := kmod-mt76x2 wpad-mini
201 endef
202 TARGET_DEVICES += re6500
203
204 define Device/sap-g3200u3
205 DTS := SAP-G3200U3
206 DEVICE_TITLE := STORYLiNK SAP-G3200U3
207 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
208 endef
209 TARGET_DEVICES += sap-g3200u3
210
211 define Device/sk-wb8
212 DTS := SK-WB8
213 IMAGE_SIZE := $(ralink_default_fw_size_16M)
214 DEVICE_TITLE := SamKnows Whitebox 8
215 DEVICE_PACKAGES := \
216 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport \
217 uboot-envtools wpad-mini
218 endef
219 TARGET_DEVICES += sk-wb8
220
221 define Device/timecloud
222 DTS := Timecloud
223 DEVICE_TITLE := Thunder Timecloud
224 DEVICE_PACKAGES := kmod-usb3
225 endef
226 TARGET_DEVICES += timecloud
227
228 define Device/u7621-06-256M-16M
229 DTS := U7621-06-256M-16M
230 IMAGE_SIZE := 16064k
231 DEVICE_TITLE := UniElec U7621-06 (256M RAM/16M flash)
232 DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3
233 endef
234 TARGET_DEVICES += u7621-06-256M-16M
235
236 define Device/ubnt-erx
237 DTS := UBNT-ERX
238 FILESYSTEMS := squashfs
239 KERNEL_SIZE := 3145728
240 KERNEL := $(KERNEL_DTB) | uImage lzma
241 IMAGES := sysupgrade.tar
242 KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
243 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
244 DEVICE_TITLE := Ubiquiti EdgeRouter X
245 endef
246 TARGET_DEVICES += ubnt-erx
247
248 define Device/ubnt-erx-sfp
249 $(Device/ubnt-erx)
250 DTS := UBNT-ERX-SFP
251 DEVICE_TITLE := Ubiquiti EdgeRouter X-SFP
252 DEVICE_PACKAGES += kmod-i2c-algo-pca kmod-gpio-pca953x kmod-i2c-gpio-custom
253 endef
254 TARGET_DEVICES += ubnt-erx-sfp
255
256 define Device/vr500
257 DTS := VR500
258 IMAGE_SIZE := 66453504
259 DEVICE_TITLE := Planex VR500
260 DEVICE_PACKAGES := kmod-usb3
261 endef
262 TARGET_DEVICES += vr500
263
264 define Device/w2914nsv2
265 DTS := W2914NSV2
266 IMAGE_SIZE := $(ralink_default_fw_size_16M)
267 DEVICE_TITLE := WeVO W2914NS v2
268 DEVICE_PACKAGES := \
269 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport kmod-mt76 \
270 wpad-mini
271 endef
272 TARGET_DEVICES += w2914nsv2
273
274 define Device/wf-2881
275 DTS := WF-2881
276 BLOCKSIZE := 128k
277 PAGESIZE := 2048
278 FILESYSTEMS := squashfs
279 IMAGE_SIZE := 129280k
280 KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
281 UBINIZE_OPTS := -E 5
282 IMAGE/sysupgrade.bin := append-kernel | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE)
283 DEVICE_TITLE := NETIS WF-2881
284 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport
285 endef
286 TARGET_DEVICES += wf-2881
287
288 define Device/witi
289 DTS := WITI
290 IMAGE_SIZE := $(ralink_default_fw_size_16M)
291 DEVICE_TITLE := MQmaker WiTi
292 DEVICE_PACKAGES := \
293 kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-sdhci-mt7620 kmod-usb3 \
294 kmod-usb-ledtrig-usbport wpad-mini
295 endef
296 TARGET_DEVICES += witi
297
298 define Device/wndr3700v5
299 DTS := WNDR3700V5
300 IMAGE_SIZE := $(ralink_default_fw_size_16M)
301 DEVICE_TITLE := Netgear WNDR3700v5
302 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 wpad-mini
303 endef
304 TARGET_DEVICES += wndr3700v5
305
306 define Device/wsr-1166
307 DTS := WSR-1166
308 IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
309 IMAGE_SIZE := $(ralink_default_fw_size_16M)
310 DEVICE_TITLE := Buffalo WSR-1166
311 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-mini
312 endef
313 TARGET_DEVICES += wsr-1166
314
315 define Device/wsr-600
316 DTS := WSR-600
317 IMAGE_SIZE := $(ralink_default_fw_size_16M)
318 DEVICE_TITLE := Buffalo WSR-600
319 DEVICE_PACKAGES := kmod-mt7603 kmod-rt2800-pci wpad-mini
320 endef
321 TARGET_DEVICES += wsr-600
322
323 define Device/zbt-we1326
324 DTS := ZBT-WE1326
325 IMAGE_SIZE := $(ralink_default_fw_size_16M)
326 DEVICE_TITLE := ZBT WE1326
327 DEVICE_PACKAGES := \
328 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-sdhci-mt7620 wpad-mini
329 endef
330 TARGET_DEVICES += zbt-we1326
331
332 define Device/zbt-wg2626
333 DTS := ZBT-WG2626
334 IMAGE_SIZE := $(ralink_default_fw_size_16M)
335 DEVICE_TITLE := ZBT WG2626
336 DEVICE_PACKAGES := \
337 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 \
338 kmod-usb-ledtrig-usbport wpad-mini
339 endef
340 TARGET_DEVICES += zbt-wg2626
341
342 define Device/zbt-wg3526-16M
343 DTS := ZBT-WG3526-16M
344 IMAGE_SIZE := $(ralink_default_fw_size_16M)
345 SUPPORTED_DEVICES += zbt-wg3526
346 DEVICE_TITLE := ZBT WG3526 (16MB flash)
347 DEVICE_PACKAGES := \
348 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
349 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
350 endef
351 TARGET_DEVICES += zbt-wg3526-16M
352
353 define Device/zbt-wg3526-32M
354 DTS := ZBT-WG3526-32M
355 IMAGE_SIZE := $(ralink_default_fw_size_32M)
356 SUPPORTED_DEVICES += ac1200pro
357 DEVICE_TITLE := ZBT WG3526 (32MB flash)
358 DEVICE_PACKAGES := \
359 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
360 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
361 endef
362 TARGET_DEVICES += zbt-wg3526-32M
363
364 # FIXME: is this still needed?
365 define Image/Prepare
366 #define Build/Compile
367 rm -rf $(KDIR)/relocate
368 $(CP) ../../generic/image/relocate $(KDIR)
369 $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
370 $(CP) $(KDIR)/relocate/loader.bin $(KDIR)/loader.bin
371 endef