ath79: re-enable image generation for GL-AR750S
[openwrt/openwrt.git] / target / linux / ath79 / image / nand.mk
1 include ./common-netgear.mk # for netgear-uImage
2
3 DEVICE_VARS += RAS_ROOTFS_SIZE RAS_BOARD RAS_VERSION
4
5 # attention: only zlib compression is allowed for the boot fs
6 define Build/zyxel-buildkerneljffs
7 rm -rf $(KDIR_TMP)/zyxelnbg6716
8 mkdir -p $(KDIR_TMP)/zyxelnbg6716/image/boot
9 cp $@ $(KDIR_TMP)/zyxelnbg6716/image/boot/vmlinux.lzma.uImage
10 $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
11 --big-endian --squash-uids -v -e 128KiB -q -f -n -x lzma -x rtime \
12 -o $@ \
13 -d $(KDIR_TMP)/zyxelnbg6716/image
14 rm -rf $(KDIR_TMP)/zyxelnbg6716
15 endef
16
17 define Build/zyxel-factory
18 let \
19 maxsize="$(subst k,* 1024,$(RAS_ROOTFS_SIZE))"; \
20 let size="$$(stat -c%s $@)"; \
21 if [ $$size -lt $$maxsize ]; then \
22 $(STAGING_DIR_HOST)/bin/mkrasimage \
23 -b $(RAS_BOARD) \
24 -v $(RAS_VERSION) \
25 -r $@ \
26 -s $$maxsize \
27 -o $@.new \
28 -l 131072 \
29 && mv $@.new $@ ; \
30 fi
31 endef
32
33 define Device/8dev_rambutan
34 SOC := qca9557
35 DEVICE_VENDOR := 8devices
36 DEVICE_MODEL := Rambutan
37 DEVICE_PACKAGES := kmod-usb2
38 BLOCKSIZE := 128k
39 PAGESIZE := 2048
40 KERNEL_SIZE := 4096k
41 KERNEL_IN_UBI := 1
42 IMAGES := factory.bin sysupgrade.tar
43 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
44 IMAGE/factory.bin := append-ubi
45 endef
46 TARGET_DEVICES += 8dev_rambutan
47
48 define Device/aerohive_hiveap-121
49 SOC := ar9344
50 DEVICE_VENDOR := Aerohive
51 DEVICE_MODEL := HiveAP 121
52 DEVICE_PACKAGES := kmod-usb2
53 BLOCKSIZE := 128k
54 PAGESIZE := 2048
55 IMAGE_SIZE := 116m
56 KERNEL_SIZE := 5120k
57 UBINIZE_OPTS := -E 5
58 SUPPORTED_DEVICES += hiveap-121
59 IMAGES += factory.bin
60 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \
61 check-size
62 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
63 endef
64 TARGET_DEVICES += aerohive_hiveap-121
65
66 define Device/domywifi_dw33d
67 SOC := qca9558
68 DEVICE_VENDOR := DomyWifi
69 DEVICE_MODEL := DW33D
70 DEVICE_PACKAGES := kmod-usb2 kmod-usb-storage kmod-usb-ledtrig-usbport \
71 kmod-ath10k-ct ath10k-firmware-qca988x-ct
72 KERNEL_SIZE := 5120k
73 IMAGE_SIZE := 98304k
74 BLOCKSIZE := 128k
75 PAGESIZE := 2048
76 UBINIZE_OPTS := -E 5
77 IMAGES += factory.bin
78 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
79 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \
80 check-size
81 endef
82 TARGET_DEVICES += domywifi_dw33d
83
84 define Device/glinet_gl-ar300m-common-nand
85 SOC := qca9531
86 DEVICE_VENDOR := GL.iNet
87 DEVICE_MODEL := GL-AR300M
88 DEVICE_PACKAGES := kmod-usb2
89 KERNEL_SIZE := 4096k
90 IMAGE_SIZE := 16000k
91 PAGESIZE := 2048
92 VID_HDR_OFFSET := 2048
93 endef
94
95 define Device/glinet_gl-ar300m-nand
96 $(Device/glinet_gl-ar300m-common-nand)
97 DEVICE_VARIANT := NAND
98 BLOCKSIZE := 128k
99 IMAGES += factory.img
100 IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
101 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
102 SUPPORTED_DEVICES += glinet,gl-ar300m-nor
103 endef
104 TARGET_DEVICES += glinet_gl-ar300m-nand
105
106 define Device/glinet_gl-ar300m-nor
107 $(Device/glinet_gl-ar300m-common-nand)
108 DEVICE_VARIANT := NOR
109 BLOCKSIZE := 64k
110 SUPPORTED_DEVICES += glinet,gl-ar300m-nand gl-ar300m
111 endef
112 TARGET_DEVICES += glinet_gl-ar300m-nor
113
114 define Device/glinet_gl-ar750s-common
115 SOC := qca9563
116 DEVICE_VENDOR := GL.iNet
117 DEVICE_MODEL := GL-AR750S
118 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct kmod-usb2 \
119 kmod-usb-storage block-mount
120 IMAGE_SIZE := 16000k
121 endef
122
123 define Device/glinet_gl-ar750s-nor-nand
124 $(Device/glinet_gl-ar750s-common)
125 DEVICE_VARIANT := NOR/NAND
126 KERNEL_SIZE := 4096k
127 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
128 SUPPORTED_DEVICES += glinet,gl-ar750s-nor
129 endef
130 TARGET_DEVICES += glinet_gl-ar750s-nor-nand
131
132 define Device/glinet_gl-ar750s-nor
133 $(Device/glinet_gl-ar750s-common)
134 DEVICE_VARIANT := NOR
135 BLOCKSIZE := 64k
136 SUPPORTED_DEVICES += gl-ar750s glinet,gl-ar750s glinet,gl-ar750s-nor-nand
137 endef
138 TARGET_DEVICES += glinet_gl-ar750s-nor
139
140 # fake rootfs is mandatory, pad-offset 129 equals (2 * uimage_header + 0xff)
141 define Device/netgear_ath79_nand
142 DEVICE_VENDOR := NETGEAR
143 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
144 KERNEL_SIZE := 4096k
145 BLOCKSIZE := 128k
146 PAGESIZE := 2048
147 IMAGE_SIZE := 25600k
148 KERNEL := kernel-bin | append-dtb | lzma -d20 | \
149 pad-offset $$(KERNEL_SIZE) 129 | netgear-uImage lzma | \
150 append-string -e '\xff' | \
151 append-uImage-fakehdr filesystem $$(NETGEAR_KERNEL_MAGIC)
152 KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma -d20 | netgear-uImage lzma
153 IMAGES := sysupgrade.bin factory.img
154 IMAGE/factory.img := append-kernel | append-ubi | netgear-dni | \
155 check-size
156 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata | \
157 check-size
158 UBINIZE_OPTS := -E 5
159 endef
160
161 define Device/netgear_wndr3700-v4
162 SOC := ar9344
163 DEVICE_MODEL := WNDR3700
164 DEVICE_VARIANT := v4
165 NETGEAR_KERNEL_MAGIC := 0x33373033
166 NETGEAR_BOARD_ID := WNDR3700v4
167 NETGEAR_HW_ID := 29763948+128+128
168 $(Device/netgear_ath79_nand)
169 endef
170 TARGET_DEVICES += netgear_wndr3700-v4
171
172 define Device/netgear_wndr4300
173 SOC := ar9344
174 DEVICE_MODEL := WNDR4300
175 NETGEAR_KERNEL_MAGIC := 0x33373033
176 NETGEAR_BOARD_ID := WNDR4300
177 NETGEAR_HW_ID := 29763948+0+128+128+2x2+3x3
178 $(Device/netgear_ath79_nand)
179 endef
180 TARGET_DEVICES += netgear_wndr4300
181
182 define Device/netgear_wndr4300sw
183 SOC := ar9344
184 DEVICE_MODEL := WNDR4300SW
185 NETGEAR_KERNEL_MAGIC := 0x33373033
186 NETGEAR_BOARD_ID := WNDR4300SW
187 NETGEAR_HW_ID := 29763948+0+128+128+2x2+3x3
188 $(Device/netgear_ath79_nand)
189 endef
190 TARGET_DEVICES += netgear_wndr4300sw
191
192 define Device/netgear_wndr4300-v2
193 SOC := qca9563
194 DEVICE_MODEL := WNDR4300
195 DEVICE_VARIANT := v2
196 NETGEAR_KERNEL_MAGIC := 0x27051956
197 NETGEAR_BOARD_ID := WNDR4500series
198 NETGEAR_HW_ID := 29764821+2+128+128+3x3+3x3+5508012175
199 $(Device/netgear_ath79_nand)
200 endef
201 TARGET_DEVICES += netgear_wndr4300-v2
202
203 define Device/netgear_wndr4500-v3
204 SOC := qca9563
205 DEVICE_MODEL := WNDR4500
206 DEVICE_VARIANT := v3
207 NETGEAR_KERNEL_MAGIC := 0x27051956
208 NETGEAR_BOARD_ID := WNDR4500series
209 NETGEAR_HW_ID := 29764821+2+128+128+3x3+3x3+5508012173
210 $(Device/netgear_ath79_nand)
211 endef
212 TARGET_DEVICES += netgear_wndr4500-v3
213
214 define Device/zyxel_nbg6716
215 SOC := qca9558
216 DEVICE_VENDOR := ZyXEL
217 DEVICE_MODEL := NBG6716
218 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct \
219 ath10k-firmware-qca988x-ct
220 RAS_BOARD := NBG6716
221 RAS_ROOTFS_SIZE := 29696k
222 RAS_VERSION := "OpenWrt Linux-$(LINUX_VERSION)"
223 KERNEL_SIZE := 4096k
224 BLOCKSIZE := 128k
225 PAGESIZE := 2048
226 KERNEL := kernel-bin | append-dtb | uImage none | zyxel-buildkerneljffs | \
227 check-size 4096k
228 IMAGES := sysupgrade.tar sysupgrade-4M-Kernel.bin factory.bin
229 IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-to $$$$(BLOCKSIZE) | \
230 sysupgrade-tar rootfs=$$$$@ | append-metadata
231 IMAGE/sysupgrade-4M-Kernel.bin/squashfs := append-kernel | \
232 pad-to $$$$(KERNEL_SIZE) | append-ubi | pad-to 263192576 | gzip
233 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \
234 zyxel-factory
235 UBINIZE_OPTS := -E 5
236 endef
237 TARGET_DEVICES += zyxel_nbg6716