c7f96eb6d49e9af8cc87b8bf0489f8b3a32599a8
[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 define Device/glinet_gl-e750
141 SOC := qca9531
142 DEVICE_VENDOR := GL.iNet
143 DEVICE_MODEL := GL-E750
144 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct kmod-usb2
145 SUPPORTED_DEVICES += gl-e750
146 KERNEL_SIZE := 4096k
147 IMAGE_SIZE := 131072k
148 PAGESIZE := 2048
149 VID_HDR_OFFSET := 2048
150 BLOCKSIZE := 128k
151 IMAGES += factory.img
152 IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
153 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
154 endef
155 TARGET_DEVICES += glinet_gl-e750
156
157 # fake rootfs is mandatory, pad-offset 129 equals (2 * uimage_header + 0xff)
158 define Device/netgear_ath79_nand
159 DEVICE_VENDOR := NETGEAR
160 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
161 KERNEL_SIZE := 4096k
162 BLOCKSIZE := 128k
163 PAGESIZE := 2048
164 IMAGE_SIZE := 25600k
165 KERNEL := kernel-bin | append-dtb | lzma -d20 | \
166 pad-offset $$(KERNEL_SIZE) 129 | netgear-uImage lzma | \
167 append-string -e '\xff' | \
168 append-uImage-fakehdr filesystem $$(NETGEAR_KERNEL_MAGIC)
169 KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma -d20 | netgear-uImage lzma
170 IMAGES := sysupgrade.bin factory.img
171 IMAGE/factory.img := append-kernel | append-ubi | netgear-dni | \
172 check-size
173 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata | \
174 check-size
175 UBINIZE_OPTS := -E 5
176 endef
177
178 define Device/netgear_wndr3700-v4
179 SOC := ar9344
180 DEVICE_MODEL := WNDR3700
181 DEVICE_VARIANT := v4
182 NETGEAR_KERNEL_MAGIC := 0x33373033
183 NETGEAR_BOARD_ID := WNDR3700v4
184 NETGEAR_HW_ID := 29763948+128+128
185 $(Device/netgear_ath79_nand)
186 endef
187 TARGET_DEVICES += netgear_wndr3700-v4
188
189 define Device/netgear_wndr4300
190 SOC := ar9344
191 DEVICE_MODEL := WNDR4300
192 NETGEAR_KERNEL_MAGIC := 0x33373033
193 NETGEAR_BOARD_ID := WNDR4300
194 NETGEAR_HW_ID := 29763948+0+128+128+2x2+3x3
195 $(Device/netgear_ath79_nand)
196 endef
197 TARGET_DEVICES += netgear_wndr4300
198
199 define Device/netgear_wndr4300sw
200 SOC := ar9344
201 DEVICE_MODEL := WNDR4300SW
202 NETGEAR_KERNEL_MAGIC := 0x33373033
203 NETGEAR_BOARD_ID := WNDR4300SW
204 NETGEAR_HW_ID := 29763948+0+128+128+2x2+3x3
205 $(Device/netgear_ath79_nand)
206 endef
207 TARGET_DEVICES += netgear_wndr4300sw
208
209 define Device/netgear_wndr4300tn
210 SOC := ar9344
211 DEVICE_MODEL := WNDR4300TN
212 NETGEAR_KERNEL_MAGIC := 0x33373033
213 NETGEAR_BOARD_ID := WNDR4300TN
214 NETGEAR_HW_ID := 29763948+0+128+128+2x2+3x3
215 $(Device/netgear_ath79_nand)
216 endef
217 TARGET_DEVICES += netgear_wndr4300tn
218
219 define Device/netgear_wndr4300-v2
220 SOC := qca9563
221 DEVICE_MODEL := WNDR4300
222 DEVICE_VARIANT := v2
223 NETGEAR_KERNEL_MAGIC := 0x27051956
224 NETGEAR_BOARD_ID := WNDR4500series
225 NETGEAR_HW_ID := 29764821+2+128+128+3x3+3x3+5508012175
226 $(Device/netgear_ath79_nand)
227 endef
228 TARGET_DEVICES += netgear_wndr4300-v2
229
230 define Device/netgear_wndr4500-v3
231 SOC := qca9563
232 DEVICE_MODEL := WNDR4500
233 DEVICE_VARIANT := v3
234 NETGEAR_KERNEL_MAGIC := 0x27051956
235 NETGEAR_BOARD_ID := WNDR4500series
236 NETGEAR_HW_ID := 29764821+2+128+128+3x3+3x3+5508012173
237 $(Device/netgear_ath79_nand)
238 endef
239 TARGET_DEVICES += netgear_wndr4500-v3
240
241 define Device/zyxel_nbg6716
242 SOC := qca9558
243 DEVICE_VENDOR := ZyXEL
244 DEVICE_MODEL := NBG6716
245 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct \
246 ath10k-firmware-qca988x-ct
247 RAS_BOARD := NBG6716
248 RAS_ROOTFS_SIZE := 29696k
249 RAS_VERSION := "OpenWrt Linux-$(LINUX_VERSION)"
250 KERNEL_SIZE := 4096k
251 BLOCKSIZE := 128k
252 PAGESIZE := 2048
253 KERNEL := kernel-bin | append-dtb | uImage none | zyxel-buildkerneljffs | \
254 check-size 4096k
255 IMAGES := sysupgrade.tar sysupgrade-4M-Kernel.bin factory.bin
256 IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-to $$$$(BLOCKSIZE) | \
257 sysupgrade-tar rootfs=$$$$@ | append-metadata
258 IMAGE/sysupgrade-4M-Kernel.bin/squashfs := append-kernel | \
259 pad-to $$$$(KERNEL_SIZE) | append-ubi | pad-to 263192576 | gzip
260 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \
261 zyxel-factory
262 UBINIZE_OPTS := -E 5
263 endef
264 TARGET_DEVICES += zyxel_nbg6716