17b673968521d38f9c4fd6a8b893cb5b24ce2da0
[openwrt/openwrt.git] / target / linux / ar71xx / image / ubnt.mk
1 DEVICE_VARS += UBNT_BOARD UBNT_CHIP UBNT_TYPE
2
3 # mkubntimage is using the kernel image direct
4 # routerboard creates partitions out of the ubnt header
5 define Build/mkubntimage
6 -$(STAGING_DIR_HOST)/bin/mkfwimage \
7 -B $(UBNT_BOARD) -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
8 -k $(IMAGE_KERNEL) \
9 -r $@ \
10 -o $@
11 endef
12
13 # all UBNT XM device expect the kernel image to have 1024k while flash, when
14 # booting the image, the size doesn't matter.
15 define Build/mkubntimage-split
16 -[ -f $@ ] && ( \
17 dd if=$@ of=$@.old1 bs=1024k count=1; \
18 dd if=$@ of=$@.old2 bs=1024k skip=1; \
19 $(STAGING_DIR_HOST)/bin/mkfwimage \
20 -B $(UBNT_BOARD) -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
21 -k $@.old1 \
22 -r $@.old2 \
23 -o $@; \
24 rm $@.old1 $@.old2 )
25 endef
26
27 define Build/mkubntimage2
28 -$(STAGING_DIR_HOST)/bin/mkfwimage2 -f 0x9f000000 \
29 -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
30 -p jffs2:0x50000:0xf60000:0:0:$@ \
31 -o $@.new
32 @mv $@.new $@
33 endef
34
35
36 # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
37 # UBNT_TYPE e.g. one of (BZ, XM, XW)
38 # UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
39 define Device/ubnt-xm
40 DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2
41 DEVICE_PROFILE := UBNT
42 IMAGE_SIZE := 7552k
43 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
44 UBNT_TYPE := XM
45 UBNT_BOARD := XM
46 UBNT_CHIP := ar7240
47 IMAGES := sysupgrade.bin factory.bin
48 IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage-split
49 IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
50 endef
51
52 define Device/ubnt-xw
53 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
54 DEVICE_PROFILE := UBNT
55 IMAGE_SIZE := 7552k
56 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
57 UBNT_TYPE := XW
58 UBNT_BOARD := XM
59 UBNT_CHIP := ar934x
60 IMAGES := sysupgrade.bin factory.bin
61 IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage-split
62 IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
63 endef
64
65 define Device/ubnt-bz
66 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
67 DEVICE_PROFILE := UBNT
68 IMAGE_SIZE := 7552k
69 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
70 UBNT_TYPE := BZ
71 UBNT_BOARD := XM
72 UBNT_CHIP := ar934x
73 IMAGES := sysupgrade.bin factory.bin
74 IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage-split
75 IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
76 endef
77
78 define Device/ubnt-unifiac
79 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
80 DEVICE_PROFILE := UBNT
81 IMAGE_SIZE := 7744k
82 MTDPARTS = spi0.0:384k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),7744k(ubnt-airos)ro,128k(bs)ro,256k(cfg)ro,64k(EEPROM)ro
83 IMAGES := sysupgrade.bin
84 IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
85 endef
86
87 define Device/rw2458n
88 $(Device/ubnt-xm)
89 DEVICE_TITLE := Ubiquiti RW2458N
90 BOARDNAME := RW2458N
91 endef
92
93 define Device/ubnt-airrouter
94 $(Device/ubnt-xm)
95 DEVICE_TITLE := Ubiquiti AirRouter
96 BOARDNAME := UBNT-AR
97 endef
98
99 define Device/ubnt-bullet-m
100 $(Device/ubnt-xm)
101 DEVICE_TITLE := Ubiquiti Bullet-M
102 BOARDNAME := UBNT-BM
103 endef
104
105 define Device/ubnt-rocket-m
106 $(Device/ubnt-xm)
107 DEVICE_TITLE := Ubiquiti Rocket-M
108 BOARDNAME := UBNT-RM
109 endef
110
111 define Device/ubnt-nano-m
112 $(Device/ubnt-xm)
113 DEVICE_TITLE := Ubiquiti Nano-M
114 BOARDNAME := UBNT-NM
115 endef
116 TARGET_DEVICES += rw2458n ubnt-airrouter ubnt-bullet-m ubnt-rocket-m ubnt-nano-m
117
118 define Device/ubnt-unifi
119 $(Device/ubnt-bz)
120 DEVICE_TITLE := Ubiquiti UniFi
121 BOARDNAME := UBNT-UF
122 DEVICE_PROFILE := UBNT UBNTUNIFI
123 endef
124
125 define Device/ubnt-unifiac-lite
126 $(Device/ubnt-unifiac)
127 DEVICE_TITLE := Ubiquiti UniFi AC-Lite
128 DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x
129 DEVICE_PROFILE := UBNT UBNTUNIFIACLITE
130 BOARDNAME := UBNT-UF-AC-LITE
131 endef
132
133 define Device/ubnt-unifiac-mesh
134 $(Device/ubnt-unifiac-lite)
135 DEVICE_TITLE := Ubiquiti UniFi AC-Mesh
136 endef
137
138 define Device/ubnt-unifiac-pro
139 $(Device/ubnt-unifiac)
140 DEVICE_TITLE := Ubiquiti UniFi AC-Pro
141 DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x kmod-usb-core kmod-usb2
142 DEVICE_PROFILE := UBNT UBNTUNIFIACPRO
143 BOARDNAME := UBNT-UF-AC-PRO
144 endef
145
146 define Device/ubnt-unifi-outdoor
147 $(Device/ubnt-bz)
148 DEVICE_TITLE := Ubiquiti UniFi Outdoor
149 BOARDNAME := UBNT-U20
150 DEVICE_PROFILE := UBNT UBNTUNIFIOUTDOOR
151 endef
152 TARGET_DEVICES += ubnt-unifi ubnt-unifiac-lite ubnt-unifiac-mesh ubnt-unifiac-pro ubnt-unifi-outdoor
153
154 define Device/ubnt-nano-m-xw
155 $(Device/ubnt-xw)
156 DEVICE_TITLE := Ubiquiti Nano M XW
157 BOARDNAME := UBNT-NM-XW
158 endef
159
160 define Device/ubnt-loco-m-xw
161 $(Device/ubnt-xw)
162 DEVICE_TITLE := Ubiquiti Loco XW
163 BOARDNAME := UBNT-LOCO-XW
164 endef
165
166 define Device/ubnt-rocket-m-xw
167 $(Device/ubnt-xw)
168 DEVICE_TITLE := Ubiquiti Rocket M XW
169 BOARDNAME := UBNT-RM-XW
170 endef
171
172 define Device/ubnt-rocket-m-ti
173 $(Device/ubnt-xw)
174 DEVICE_TITLE := Ubiquiti Rocket M TI
175 BOARDNAME := UBNT-RM-TI
176 UBNT_TYPE := TI
177 UBNT_BOARD := XM
178 endef
179 TARGET_DEVICES += ubnt-nano-m-xw ubnt-loco-m-xw ubnt-rocket-m-xw ubnt-rocket-m-ti
180
181 define Device/ubnt-air-gateway
182 $(Device/ubnt-xm)
183 DEVICE_TITLE := Ubiquiti Air Gateway
184 BOARDNAME := UBNT-AGW
185 UBNT_BOARD := XM
186 UBNT_TYPE := AirGW
187 UBNT_CHIP := ar933x
188 CONSOLE = ttyATH0,115200
189 endef
190 TARGET_DEVICES += ubnt-air-gateway
191
192 define Device/ubnt-air-gateway-pro
193 $(Device/ubnt-xm)
194 DEVICE_TITLE := Ubiquiti Air Gateway Pro
195 BOARDNAME := UBNT-AGWP
196 UBNT_TYPE := AirGWP
197 UBNT_CHIP := ar934x
198 endef
199 TARGET_DEVICES += ubnt-air-gateway-pro
200
201 define Device/ubdev01
202 $(Device/ubnt-xm)
203 DEVICE_TITLE := Ubiquiti ubDEV01
204 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7488k(firmware),64k(certs),256k(cfg)ro,64k(EEPROM)ro
205 BOARDNAME := UBNT-UF
206 UBNT_BOARD := UBDEV01
207 UBNT_TYPE := XM
208 UBNT_CHIP := ar7240
209 endef
210 TARGET_DEVICES += ubdev01
211
212 define Device/ubnt-routerstation
213 DEVICE_TITLE := Ubiquiti RouterStation
214 DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2
215 IMAGE_SIZE := 16128k
216 IMAGES := sysupgrade.bin factory.bin
217 IMAGE/factory.bin = append-rootfs | pad-rootfs | mkubntimage
218 IMAGE/sysupgrade.bin = append-rootfs | pad-rootfs | combined-image | check-size $$$$(IMAGE_SIZE)
219 KERNEL := kernel-bin | patch-cmdline | lzma | pad-to $$(BLOCKSIZE)
220 endef
221
222 define Device/ubnt-rs
223 $(Device/ubnt-routerstation)
224 DEVICE_TITLE := Ubiquiti RouterStation
225 BOARDNAME := UBNT-RS
226 DEVICE_PROFILE := UBNT UBNTRS
227 UBNT_BOARD := RS
228 UBNT_TYPE := RSx
229 UBNT_CHIP := ar7100
230 endef
231
232 define Device/ubnt-rspro
233 $(Device/ubnt-routerstation)
234 DEVICE_TITLE := Ubiquiti RouterStation Pro
235 BOARDNAME := UBNT-RSPRO
236 DEVICE_PROFILE := UBNT UBNTRSPRO
237 UBNT_BOARD := RSPRO
238 UBNT_TYPE := RSPRO
239 UBNT_CHIP := ar7100pro
240 endef
241
242 define Device/ubnt-ls-sr71
243 $(Device/ubnt-routerstation)
244 DEVICE_TITLE := Ubiquiti LS-SR71
245 BOARDNAME := UBNT-LS-SR71
246 DEVICE_PROFILE := UBNT
247 UBNT_BOARD := LS-SR71
248 UBNT_TYPE := LS-SR71
249 UBNT_CHIP := ar7100
250 endef
251 TARGET_DEVICES += ubnt-rs ubnt-rspro ubnt-ls-sr71
252
253 define Device/ubnt-uap-pro
254 DEVICE_TITLE := Ubiquiti UAP Pro
255 KERNEL_SIZE := 1536k
256 IMAGE_SIZE := 15744k
257 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1536k(kernel),14208k(rootfs),256k(cfg)ro,64k(EEPROM)ro,15744k@0x50000(firmware)
258 UBNT_TYPE := BZ
259 UBNT_CHIP := ar934x
260 BOARDNAME := UAP-PRO
261 DEVICE_PROFILE := UBNT UAPPRO
262 KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | jffs2 kernel0
263 IMAGES := sysupgrade.bin factory.bin
264 IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
265 IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage2
266 endef
267
268 define Device/ubnt-unifi-outdoor-plus
269 $(Device/ubnt-uap-pro)
270 DEVICE_TITLE := Ubiquiti UniFi Outdoor Plus
271 UBNT_CHIP := ar7240
272 BOARDNAME := UBNT-UOP
273 DEVICE_PROFILE := UBNT
274 endef
275 TARGET_DEVICES += ubnt-uap-pro ubnt-unifi-outdoor-plus