ramips: add support for TP-Link RE350
[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/hc5962
79 DTS := HC5962
80 BLOCKSIZE := 128k
81 PAGESIZE := 2048
82 KERNEL_SIZE := 2097152
83 UBINIZE_OPTS := -E 5
84 IMAGE_SIZE := $(ralink_default_fw_size_32M)
85 IMAGES += factory.bin
86 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
87 IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE)
88 DEVICE_TITLE := HiWiFi HC5962
89 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 wpad-mini
90 endef
91 TARGET_DEVICES += hc5962
92
93 define Device/k2p
94 DTS := K2P
95 IMAGE_SIZE := $(ralink_default_fw_size_16M)
96 DEVICE_TITLE := Phicomm K2P
97 endef
98 TARGET_DEVICES += k2p
99
100 define Device/mt7621
101 DTS := MT7621
102 BLOCKSIZE := 64k
103 IMAGE_SIZE := $(ralink_default_fw_size_4M)
104 DEVICE_TITLE := MediaTek MT7621 EVB
105 endef
106 TARGET_DEVICES += mt7621
107
108 define Device/newifi-d1
109 DTS := Newifi-D1
110 IMAGE_SIZE := $(ralink_default_fw_size_32M)
111 DEVICE_TITLE := Newifi D1
112 DEVICE_PACKAGES := \
113 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
114 endef
115 TARGET_DEVICES += newifi-d1
116
117 define Device/pbr-m1
118 DTS := PBR-M1
119 IMAGE_SIZE := $(ralink_default_fw_size_16M)
120 DEVICE_TITLE := PBR-M1
121 DEVICE_PACKAGES := \
122 kmod-ata-core kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \
123 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
124 endef
125 TARGET_DEVICES += pbr-m1
126
127 define Device/r6220
128 DTS := R6220
129 BLOCKSIZE := 128k
130 PAGESIZE := 2048
131 KERNEL_SIZE := 4096k
132 KERNEL := $(KERNEL_DTB) | uImage lzma
133 IMAGE_SIZE := 28672k
134 UBINIZE_OPTS := -E 5
135 IMAGES := sysupgrade.tar kernel.bin rootfs.bin
136 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
137 IMAGE/kernel.bin := append-kernel
138 IMAGE/rootfs.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
139 DEVICE_TITLE := Netgear R6220
140 DEVICE_PACKAGES := \
141 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
142 endef
143 TARGET_DEVICES += r6220
144
145 define Device/rb750gr3
146 DTS := RB750Gr3
147 IMAGE_SIZE := $(ralink_default_fw_size_16M)
148 DEVICE_TITLE := MikroTik RB750Gr3
149 DEVICE_PACKAGES := kmod-usb3 uboot-envtools
150 endef
151 TARGET_DEVICES += rb750gr3
152
153 define Device/re350-v1
154 DTS := RE350
155 DEVICE_TITLE := TP-LINK RE350 v1
156 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-mini
157 TPLINK_BOARD_ID := RE350-V1
158 TPLINK_HWID := 0x0
159 TPLINK_HWREV := 0
160 TPLINK_HEADER_VERSION := 1
161 IMAGE_SIZE := 6016k
162 KERNEL := $(KERNEL_DTB) | tplink-v1-header -e
163 IMAGES := sysupgrade.bin factory.bin
164 IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | append-metadata | check-size $$$$(IMAGE_SIZE)
165 IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
166 endef
167 TARGET_DEVICES += re350-v1
168
169 define Device/re6500
170 DTS := RE6500
171 DEVICE_TITLE := Linksys RE6500
172 DEVICE_PACKAGES := kmod-mt76x2 wpad-mini
173 endef
174 TARGET_DEVICES += re6500
175
176 define Device/sap-g3200u3
177 DTS := SAP-G3200U3
178 DEVICE_TITLE := STORYLiNK SAP-G3200U3
179 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
180 endef
181 TARGET_DEVICES += sap-g3200u3
182
183 define Device/sk-wb8
184 DTS := SK-WB8
185 IMAGE_SIZE := $(ralink_default_fw_size_16M)
186 DEVICE_TITLE := SamKnows Whitebox 8
187 DEVICE_PACKAGES := \
188 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport \
189 uboot-envtools wpad-mini
190 endef
191 TARGET_DEVICES += sk-wb8
192
193 define Device/timecloud
194 DTS := Timecloud
195 DEVICE_TITLE := Thunder Timecloud
196 DEVICE_PACKAGES := kmod-usb3
197 endef
198 TARGET_DEVICES += timecloud
199
200 define Device/ubnt-erx
201 DTS := UBNT-ERX
202 FILESYSTEMS := squashfs
203 KERNEL_SIZE := 3145728
204 KERNEL := $(KERNEL_DTB) | uImage lzma
205 IMAGES := sysupgrade.tar
206 KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
207 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
208 DEVICE_TITLE := Ubiquiti EdgeRouter X
209 endef
210 TARGET_DEVICES += ubnt-erx
211
212 define Device/ubnt-erx-sfp
213 $(Device/ubnt-erx)
214 DTS := UBNT-ERX-SFP
215 DEVICE_TITLE := Ubiquiti EdgeRouter X-SFP
216 DEVICE_PACKAGES += kmod-i2c-algo-pca kmod-gpio-pca953x kmod-i2c-gpio-custom
217 endef
218 TARGET_DEVICES += ubnt-erx-sfp
219
220 define Device/vr500
221 DTS := VR500
222 IMAGE_SIZE := 66453504
223 DEVICE_TITLE := Planex VR500
224 DEVICE_PACKAGES := kmod-usb3
225 endef
226 TARGET_DEVICES += vr500
227
228 define Device/w2914nsv2
229 DTS := W2914NSV2
230 IMAGE_SIZE := $(ralink_default_fw_size_16M)
231 DEVICE_TITLE := WeVO W2914NS v2
232 DEVICE_PACKAGES := \
233 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport kmod-mt76 \
234 wpad-mini
235 endef
236 TARGET_DEVICES += w2914nsv2
237
238 define Device/wf-2881
239 DTS := WF-2881
240 BLOCKSIZE := 128k
241 PAGESIZE := 2048
242 FILESYSTEMS := squashfs
243 IMAGE_SIZE := 129280k
244 KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
245 UBINIZE_OPTS := -E 5
246 IMAGE/sysupgrade.bin := append-kernel | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE)
247 DEVICE_TITLE := NETIS WF-2881
248 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport
249 endef
250 TARGET_DEVICES += wf-2881
251
252 define Device/witi
253 DTS := WITI
254 IMAGE_SIZE := $(ralink_default_fw_size_16M)
255 DEVICE_TITLE := MQmaker WiTi
256 DEVICE_PACKAGES := \
257 kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-sdhci-mt7620 kmod-usb3 \
258 kmod-usb-ledtrig-usbport wpad-mini
259 endef
260 TARGET_DEVICES += witi
261
262 define Device/wndr3700v5
263 DTS := WNDR3700V5
264 IMAGE_SIZE := $(ralink_default_fw_size_16M)
265 DEVICE_TITLE := Netgear WNDR3700v5
266 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 wpad-mini
267 endef
268 TARGET_DEVICES += wndr3700v5
269
270 define Device/wsr-1166
271 DTS := WSR-1166
272 IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
273 IMAGE_SIZE := $(ralink_default_fw_size_16M)
274 DEVICE_TITLE := Buffalo WSR-1166
275 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-mini
276 endef
277 TARGET_DEVICES += wsr-1166
278
279 define Device/wsr-600
280 DTS := WSR-600
281 IMAGE_SIZE := $(ralink_default_fw_size_16M)
282 DEVICE_TITLE := Buffalo WSR-600
283 DEVICE_PACKAGES := kmod-mt7603 kmod-rt2800-pci wpad-mini
284 endef
285 TARGET_DEVICES += wsr-600
286
287 define Device/zbt-we1326
288 DTS := ZBT-WE1326
289 IMAGE_SIZE := $(ralink_default_fw_size_16M)
290 DEVICE_TITLE := ZBT WE1326
291 DEVICE_PACKAGES := \
292 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-sdhci-mt7620 wpad-mini
293 endef
294 TARGET_DEVICES += zbt-we1326
295
296 define Device/zbt-wg2626
297 DTS := ZBT-WG2626
298 IMAGE_SIZE := $(ralink_default_fw_size_16M)
299 DEVICE_TITLE := ZBT WG2626
300 DEVICE_PACKAGES := \
301 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 \
302 kmod-usb-ledtrig-usbport wpad-mini
303 endef
304 TARGET_DEVICES += zbt-wg2626
305
306 define Device/zbt-wg3526-16M
307 DTS := ZBT-WG3526-16M
308 IMAGE_SIZE := $(ralink_default_fw_size_16M)
309 SUPPORTED_DEVICES += zbt-wg3526
310 DEVICE_TITLE := ZBT WG3526 (16MB flash)
311 DEVICE_PACKAGES := \
312 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
313 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
314 endef
315 TARGET_DEVICES += zbt-wg3526-16M
316
317 define Device/zbt-wg3526-32M
318 DTS := ZBT-WG3526-32M
319 IMAGE_SIZE := $(ralink_default_fw_size_32M)
320 SUPPORTED_DEVICES += ac1200pro
321 DEVICE_TITLE := ZBT WG3526 (32MB flash)
322 DEVICE_PACKAGES := \
323 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
324 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
325 endef
326 TARGET_DEVICES += zbt-wg3526-32M
327
328 # FIXME: is this still needed?
329 define Image/Prepare
330 #define Build/Compile
331 rm -rf $(KDIR)/relocate
332 $(CP) ../../generic/image/relocate $(KDIR)
333 $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
334 $(CP) $(KDIR)/relocate/loader.bin $(KDIR)/loader.bin
335 endef