ath79: add support for Buffalo BHR-4GRV
[openwrt/openwrt.git] / target / linux / ath79 / image / generic.mk
1 include ./common-buffalo.mk
2 include ./common-netgear.mk
3
4 DEVICE_VARS += ADDPATTERN_ID ADDPATTERN_VERSION
5
6 define Build/cybertan-trx
7 @echo -n '' > $@-empty.bin
8 -$(STAGING_DIR_HOST)/bin/trx -o $@.new \
9 -f $(IMAGE_KERNEL) -F $@-empty.bin \
10 -x 32 -a 0x10000 -x -32 -f $@
11 -mv "$@.new" "$@"
12 -rm $@-empty.bin
13 endef
14
15 define Build/addpattern
16 -$(STAGING_DIR_HOST)/bin/addpattern -B $(ADDPATTERN_ID) \
17 -v v$(ADDPATTERN_VERSION) -i $@ -o $@.new
18 -mv "$@.new" "$@"
19 endef
20
21 define Build/elecom-header
22 $(eval fw_size=$(word 1,$(1)))
23 $(eval edimax_model=$(word 2,$(1)))
24 $(eval product=$(word 3,$(1)))
25 $(eval factory_bin=$(word 4,$(1)))
26 if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(fw_size)" ]; then \
27 $(CP) $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) $(factory_bin); \
28 $(STAGING_DIR_HOST)/bin/mkedimaximg \
29 -b -s CSYS -m $(edimax_model) \
30 -f 0x70000 -S 0x01100000 \
31 -i $(factory_bin) -o $(factory_bin).new; \
32 mv $(factory_bin).new $(factory_bin); \
33 ( \
34 echo -n -e "ELECOM\x00\x00$(product)" | dd bs=40 count=1 conv=sync; \
35 echo -n "0.00" | dd bs=16 count=1 conv=sync; \
36 dd if=$(factory_bin); \
37 ) > $(factory_bin).new; \
38 mv $(factory_bin).new $(factory_bin); \
39 $(CP) $(factory_bin) $(BIN_DIR)/; \
40 else \
41 echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \
42 fi
43
44 endef
45
46 define Device/avm_fritz300e
47 ATH_SOC := ar7242
48 DEVICE_TITLE := AVM FRITZ!WLAN Repeater 300E
49 KERNEL := kernel-bin | append-dtb | lzma | eva-image
50 KERNEL_INITRAMFS := $$(KERNEL)
51 IMAGE_SIZE := 15232k
52 IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | \
53 append-squashfs-fakeroot-be | pad-to 256 | \
54 append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
55 DEVICE_PACKAGES := fritz-tffs rssileds -swconfig
56 endef
57 TARGET_DEVICES += avm_fritz300e
58
59 define Device/avm_fritz4020
60 ATH_SOC := qca9561
61 DEVICE_TITLE := AVM FRITZ!Box 4020
62 IMAGE_SIZE := 15232k
63 KERNEL := kernel-bin | append-dtb | lzma | eva-image
64 KERNEL_INITRAMFS := $$(KERNEL)
65 IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | \
66 append-squashfs-fakeroot-be | pad-to 256 | \
67 append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
68 DEVICE_PACKAGES := fritz-tffs
69 endef
70 TARGET_DEVICES += avm_fritz4020
71
72 define Device/buffalo_bhr-4grv
73 ATH_SOC := ar7242
74 DEVICE_TITLE := Buffalo BHR-4GRV
75 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
76 IMAGE_SIZE := 32256k
77 IMAGES += factory.bin tftp.bin
78 IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
79 IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc BHR-4GRV 1.99 | buffalo-tag BHR-4GRV
80 IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header
81 SUPPORTED_DEVICES += wzr-hp-g450h
82 endef
83 TARGET_DEVICES += buffalo_bhr-4grv
84
85 define Device/buffalo_wzr-hp-ag300h
86 ATH_SOC := ar7161
87 DEVICE_TITLE := Buffalo WZR-HP-AG300H
88 IMAGE_SIZE := 32256k
89 IMAGES += factory.bin tftp.bin
90 IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
91 IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WZR-HP-AG300H 1.99 | buffalo-tag WZR-HP-AG300H
92 IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header
93 DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset kmod-owl-loader
94 SUPPORTED_DEVICES += wzr-hp-ag300h
95 endef
96 TARGET_DEVICES += buffalo_wzr-hp-ag300h
97
98 define Device/buffalo_wzr-hp-g450h
99 ATH_SOC := ar7242
100 DEVICE_TITLE := Buffalo WZR-HP-G450H/WZR-450HP
101 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
102 IMAGE_SIZE := 32256k
103 IMAGES += factory.bin tftp.bin
104 IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
105 IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WZR-HP-G450H 1.99 | buffalo-tag WZR-HP-G450H
106 IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header
107 SUPPORTED_DEVICES += wzr-hp-g450h
108 endef
109 TARGET_DEVICES += buffalo_wzr-hp-g450h
110
111 define Device/dlink_dir-825-b1
112 ATH_SOC := ar7161
113 DEVICE_TITLE := D-LINK DIR-825 B1
114 IMAGE_SIZE := 6208k
115 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
116 DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset kmod-owl-loader
117 SUPPORTED_DEVICES += dir-825-b1
118 endef
119 TARGET_DEVICES += dlink_dir-825-b1
120
121 define Device/elecom_wrc-300ghbk2-i
122 ATH_SOC := qca9563
123 DEVICE_TITLE := ELECOM WRC-300GHBK2-I
124 IMAGE_SIZE := 7616k
125 KERNEL_INITRAMFS := $$(KERNEL) | pad-to 2 | \
126 elecom-header 7798706 RN51 WRC-300GHBK2-I \
127 $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.bin
128 endef
129 TARGET_DEVICES += elecom_wrc-300ghbk2-i
130
131 define Device/embeddedwireless_dorin
132 ATH_SOC := ar9331
133 DEVICE_TITLE := Embedded Wireless Dorin
134 DEVICE_PACKAGES := kmod-usb-chipidea2
135 IMAGE_SIZE := 16000k
136 endef
137 TARGET_DEVICES += embeddedwireless_dorin
138
139 define Device/etactica_eg200
140 ATH_SOC := ar9331
141 DEVICE_TITLE := eTactica EG200
142 DEVICE_PACKAGES := kmod-usb-chipidea2 kmod-ledtrig-oneshot \
143 kmod-usb-serial kmod-usb-serial-ftdi kmod-usb-storage kmod-fs-ext4
144 SUPPORTED_DEVICES += rme-eg200
145 endef
146 TARGET_DEVICES += etactica_eg200
147
148 define Device/glinet_ar150
149 ATH_SOC := ar9330
150 DEVICE_TITLE := GL.iNet GL-AR150
151 DEVICE_PACKAGES := kmod-usb-chipidea2
152 IMAGE_SIZE := 16000k
153 SUPPORTED_DEVICES += gl-ar150
154 endef
155 TARGET_DEVICES += glinet_ar150
156
157 define Device/glinet_ar300m_nor
158 ATH_SOC := qca9533
159 DEVICE_TITLE := GL.iNet GL-AR300M
160 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
161 IMAGE_SIZE := 16000k
162 SUPPORTED_DEVICES += gl-ar300m
163 endef
164 TARGET_DEVICES += glinet_ar300m_nor
165
166 define Device/iodata_etg3-r
167 ATH_SOC := ar9342
168 DEVICE_TITLE := I-O DATA ETG3-R
169 IMAGE_SIZE := 7680k
170 endef
171 TARGET_DEVICES += iodata_etg3-r
172
173 define Device/iodata_wn-ac1167dgr
174 ATH_SOC := qca9557
175 DEVICE_TITLE := I-O DATA WN-AC1167DGR
176 IMAGE_SIZE := 14656k
177 IMAGES += factory.bin
178 IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
179 append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | \
180 senao-header -r 0x30a -p 0x61 -t 2
181 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct
182 endef
183 TARGET_DEVICES += iodata_wn-ac1167dgr
184
185 define Device/iodata_wn-ac1600dgr2
186 ATH_SOC := qca9557
187 DEVICE_TITLE := I-O DATA WN-AC1600DGR2
188 IMAGE_SIZE := 14656k
189 IMAGES += factory.bin
190 IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
191 append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | \
192 senao-header -r 0x30a -p 0x60 -t 2 -v 200
193 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct
194 endef
195 TARGET_DEVICES += iodata_wn-ac1600dgr2
196
197 define Device/ocedo_koala
198 ATH_SOC := qca9558
199 DEVICE_TITLE := OCEDO Koala
200 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
201 SUPPORTED_DEVICES += koala
202 IMAGE_SIZE := 7424k
203 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
204 endef
205 TARGET_DEVICES += ocedo_koala
206
207 define Device/ocedo_raccoon
208 ATH_SOC := ar9344
209 DEVICE_TITLE := OCEDO Raccoon
210 IMAGE_SIZE := 7424k
211 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
212 endef
213 TARGET_DEVICES += ocedo_raccoon
214
215 define Device/openmesh_om5p-ac-v2
216 ATH_SOC := qca9558
217 DEVICE_TITLE := OpenMesh OM5P-AC v2
218 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct om-watchdog
219 IMAGE_SIZE := 7808k
220 SUPPORTED_DEVICES += om5p-acv2
221 endef
222 TARGET_DEVICES += openmesh_om5p-ac-v2
223
224 define Device/pcs_cap324
225 ATH_SOC := ar9344
226 DEVICE_TITLE := PowerCloud Systems CAP324
227 IMAGE_SIZE := 16000k
228 IMAGES := sysupgrade.bin
229 SUPPORTED_DEVICES += cap324
230 endef
231 TARGET_DEVICES += pcs_cap324
232
233 define Device/pcs_cr3000
234 ATH_SOC := ar9341
235 DEVICE_TITLE := PowerCloud Systems CR3000
236 IMAGE_SIZE := 7808k
237 IMAGES := sysupgrade.bin
238 SUPPORTED_DEVICES += cr3000
239 endef
240 TARGET_DEVICES += pcs_cr3000
241
242 define Device/pcs_cr5000
243 ATH_SOC := ar9344
244 DEVICE_TITLE := PowerCloud Systems CR5000
245 DEVICE_PACKAGES := kmod-usb2 kmod-usb-core
246 IMAGE_SIZE := 7808k
247 IMAGES := sysupgrade.bin
248 SUPPORTED_DEVICES += cr5000
249 endef
250 TARGET_DEVICES += pcs_cr5000
251
252 define Device/netgear_wndr3x00
253 ATH_SOC := ar7161
254 KERNEL := kernel-bin | append-dtb | lzma -d20 | netgear-uImage lzma
255 IMAGES := sysupgrade.bin factory.img
256 IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs
257 IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE)
258 IMAGE/factory.img := $$(IMAGE/default) | netgear-dni | check-size $$$$(IMAGE_SIZE)
259 DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset kmod-owl-loader
260 endef
261
262 define Device/netgear_wndr3700
263 $(Device/netgear_wndr3x00)
264 DEVICE_TITLE := NETGEAR WNDR3700
265 NETGEAR_KERNEL_MAGIC := 0x33373030
266 NETGEAR_BOARD_ID := WNDR3700
267 IMAGE_SIZE := 7680k
268 IMAGES += factory-NA.img
269 IMAGE/factory-NA.img := $$(IMAGE/default) | netgear-dni NA | check-size $$$$(IMAGE_SIZE)
270 SUPPORTED_DEVICES += wndr3700
271 endef
272 TARGET_DEVICES += netgear_wndr3700
273
274 define Device/netgear_wndr3700v2
275 $(Device/netgear_wndr3x00)
276 DEVICE_TITLE := NETGEAR WNDR3700v2
277 NETGEAR_KERNEL_MAGIC := 0x33373031
278 NETGEAR_BOARD_ID := WNDR3700v2
279 NETGEAR_HW_ID := 29763654+16+64
280 IMAGE_SIZE := 15872k
281 SUPPORTED_DEVICES += wndr3700v2
282 endef
283 TARGET_DEVICES += netgear_wndr3700v2
284
285 define Device/pisen_wmm003n
286 $(Device/tplink-8mlzma)
287 ATH_SOC := ar9331
288 DEVICE_TITLE := Pisen WMM003N (Cloud Easy Power)
289 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-chipidea2
290 TPLINK_HWID := 0x07030101
291 IMAGES := sysupgrade.bin
292 endef
293 TARGET_DEVICES += pisen_wmm003n
294
295 define Device/netgear_wndr3800
296 $(Device/netgear_wndr3x00)
297 DEVICE_TITLE := NETGEAR WNDR3800
298 NETGEAR_KERNEL_MAGIC := 0x33373031
299 NETGEAR_BOARD_ID := WNDR3800
300 NETGEAR_HW_ID := 29763654+16+128
301 IMAGE_SIZE := 15872k
302 SUPPORTED_DEVICES += wndr3800
303 endef
304 TARGET_DEVICES += netgear_wndr3800
305
306 define Device/phicomm_k2t
307 ATH_SOC := qca9563
308 DEVICE_TITLE := Phicomm K2T
309 KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
310 KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
311 IMAGE_SIZE := 15744k
312 IMAGES := sysupgrade.bin
313 IMAGE/default := append-kernel | append-rootfs | pad-rootfs
314 IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE)
315 DEVICE_PACKAGES := kmod-leds-reset kmod-ath10k-ct ath10k-firmware-qca9888-ct
316 endef
317 TARGET_DEVICES += phicomm_k2t
318
319 define Device/wd_mynet-wifi-rangeextender
320 ATH_SOC := ar9344
321 DEVICE_TITLE := Western Digital My Net Wi-Fi Range Extender
322 DEVICE_PACKAGES := rssileds nvram -swconfig
323 IMAGE_SIZE := 7808k
324 ADDPATTERN_ID := mynet-rext
325 ADDPATTERN_VERSION := 1.00.01
326 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | cybertan-trx | \
327 addpattern | append-metadata
328 SUPPORTED_DEVICES += mynet-rext
329 endef
330 TARGET_DEVICES += wd_mynet-wifi-rangeextender