generic-ubnt.mk 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. DEVICE_VARS += UBNT_BOARD UBNT_CHIP UBNT_TYPE UBNT_VERSION UBNT_REVISION
  2. # On M (XW) devices the U-Boot as of version 1.1.4-s1039 doesn't like
  3. # VERSION_DIST being on the place of major(?) version number, so we need to
  4. # use some number.
  5. UBNT_REVISION := $(VERSION_DIST)-$(REVISION)
  6. # mkubntimage is using the kernel image direct
  7. # routerboard creates partitions out of the ubnt header
  8. define Build/mkubntimage
  9. -$(STAGING_DIR_HOST)/bin/mkfwimage -B $(UBNT_BOARD) \
  10. -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
  11. -k $(IMAGE_KERNEL) -r $@ -o $@
  12. endef
  13. define Build/mkubntimage2
  14. -$(STAGING_DIR_HOST)/bin/mkfwimage2 -f 0x9f000000 \
  15. -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
  16. -p jffs2:0x50000:0xf60000:0:0:$@ \
  17. -o [email protected]
  18. @mv [email protected] $@
  19. endef
  20. # all UBNT XM/WA devices expect the kernel image to have 1024k while flash, when
  21. # booting the image, the size doesn't matter.
  22. define Build/mkubntimage-split
  23. -[ -f $@ ] && ( \
  24. dd if=$@ [email protected] bs=1024k count=1; \
  25. dd if=$@ [email protected] bs=1024k skip=1; \
  26. $(STAGING_DIR_HOST)/bin/mkfwimage -B $(UBNT_BOARD) \
  27. -v $(UBNT_TYPE).$(UBNT_CHIP).v$(UBNT_VERSION)-$(UBNT_REVISION) \
  28. -k [email protected] -r [email protected] -o $@; \
  29. rm [email protected] [email protected] )
  30. endef
  31. # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
  32. # UBNT_TYPE e.g. one of (BZ, XM, XW)
  33. # UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
  34. # UBNT_VERSION e.g. one of (6.0.0, 8.5.3)
  35. define Device/ubnt
  36. DEVICE_VENDOR := Ubiquiti
  37. DEVICE_PACKAGES := kmod-usb2
  38. IMAGES += factory.bin
  39. IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
  40. append-rootfs | pad-rootfs | check-size | mkubntimage-split
  41. endef
  42. define Device/ubnt-bz
  43. $(Device/ubnt)
  44. SOC := ar7241
  45. IMAGE_SIZE := 7448k
  46. UBNT_BOARD := XM
  47. UBNT_CHIP := ar7240
  48. UBNT_TYPE := BZ
  49. UBNT_VERSION := 6.0.0
  50. endef
  51. define Device/ubnt-sw
  52. $(Device/ubnt)
  53. SOC := ar7242
  54. DEVICE_PACKAGES += kmod-usb-ohci
  55. IMAGE_SIZE := 7552k
  56. UBNT_BOARD := SW
  57. UBNT_CHIP := ar7240
  58. UBNT_TYPE := SW
  59. UBNT_VERSION := 1.4.1
  60. KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
  61. endef
  62. define Device/ubnt-2wa
  63. $(Device/ubnt)
  64. SOC := ar9342
  65. IMAGE_SIZE := 15744k
  66. UBNT_BOARD := WA
  67. UBNT_CHIP := ar934x
  68. UBNT_TYPE := 2WA
  69. UBNT_VERSION := 8.5.3
  70. endef
  71. define Device/ubnt-wa
  72. $(Device/ubnt)
  73. SOC := ar9342
  74. IMAGE_SIZE := 15744k
  75. UBNT_BOARD := WA
  76. UBNT_CHIP := ar934x
  77. UBNT_TYPE := WA
  78. UBNT_VERSION := 8.5.3
  79. endef
  80. define Device/ubnt-xc
  81. $(Device/ubnt)
  82. IMAGE_SIZE := 15744k
  83. UBNT_BOARD := XC
  84. UBNT_CHIP := qca955x
  85. UBNT_TYPE := XC
  86. UBNT_VERSION := 8.5.3
  87. endef
  88. define Device/ubnt-xm
  89. $(Device/ubnt)
  90. DEVICE_VARIANT := XM
  91. DEVICE_PACKAGES += kmod-usb-ohci
  92. IMAGE_SIZE := 7448k
  93. UBNT_BOARD := XM
  94. UBNT_CHIP := ar7240
  95. UBNT_TYPE := XM
  96. UBNT_VERSION := 6.0.0
  97. KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
  98. endef
  99. define Device/ubnt-xw
  100. $(Device/ubnt)
  101. SOC := ar9342
  102. DEVICE_VARIANT := XW
  103. IMAGE_SIZE := 7552k
  104. UBNT_BOARD := XM
  105. UBNT_CHIP := ar934x
  106. UBNT_REVISION := 42.$(UBNT_REVISION)
  107. UBNT_TYPE := XW
  108. UBNT_VERSION := 6.0.4
  109. endef
  110. define Device/ubnt-unifi-jffs2
  111. $(Device/ubnt)
  112. KERNEL_SIZE := 3072k
  113. IMAGE_SIZE := 15744k
  114. UBNT_TYPE := BZ
  115. KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | jffs2 kernel0
  116. IMAGES := sysupgrade.bin factory.bin
  117. IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs |\
  118. pad-rootfs | append-metadata | check-size
  119. IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage2
  120. endef
  121. define Device/ubnt-acb
  122. $(Device/ubnt)
  123. IMAGE_SIZE := 15744k
  124. UBNT_BOARD := ACB
  125. UBNT_TYPE := ACB
  126. UBNT_VERSION := 2.5.0
  127. endef
  128. define Device/ubnt_aircube-ac
  129. $(Device/ubnt-acb)
  130. SOC := ar9342
  131. DEVICE_MODEL := airCube AC
  132. UBNT_CHIP := ar9342
  133. DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
  134. endef
  135. TARGET_DEVICES += ubnt_aircube-ac
  136. define Device/ubnt_aircube-isp
  137. $(Device/ubnt-acb)
  138. SOC := qca9533
  139. DEVICE_MODEL := airCube ISP
  140. UBNT_CHIP := qca9533
  141. SUPPORTED_DEVICES += ubnt,acb-isp
  142. endef
  143. TARGET_DEVICES += ubnt_aircube-isp
  144. define Device/ubnt_airrouter
  145. $(Device/ubnt-xm)
  146. SOC := ar7241
  147. DEVICE_MODEL := AirRouter
  148. SUPPORTED_DEVICES += airrouter
  149. endef
  150. TARGET_DEVICES += ubnt_airrouter
  151. define Device/ubnt_bullet-ac
  152. $(Device/ubnt-2wa)
  153. DEVICE_MODEL := Bullet AC
  154. DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
  155. endef
  156. TARGET_DEVICES += ubnt_bullet-ac
  157. define Device/ubnt_bullet-m-ar7240
  158. $(Device/ubnt-xm)
  159. SOC := ar7240
  160. DEVICE_MODEL := Bullet M
  161. DEVICE_VARIANT := XM (AR7240)
  162. DEVICE_PACKAGES += rssileds
  163. SUPPORTED_DEVICES += bullet-m
  164. endef
  165. TARGET_DEVICES += ubnt_bullet-m-ar7240
  166. define Device/ubnt_bullet-m-ar7241
  167. $(Device/ubnt-xm)
  168. SOC := ar7241
  169. DEVICE_MODEL := Bullet M
  170. DEVICE_VARIANT := XM (AR7241)
  171. DEVICE_PACKAGES += rssileds
  172. SUPPORTED_DEVICES += bullet-m ubnt,bullet-m
  173. endef
  174. TARGET_DEVICES += ubnt_bullet-m-ar7241
  175. define Device/ubnt_bullet-m-xw
  176. $(Device/ubnt-xw)
  177. DEVICE_MODEL := Bullet M
  178. DEVICE_PACKAGES += rssileds
  179. SUPPORTED_DEVICES += bullet-m-xw
  180. endef
  181. TARGET_DEVICES += ubnt_bullet-m-xw
  182. define Device/ubnt_edgeswitch-5xp
  183. $(Device/ubnt-sw)
  184. DEVICE_MODEL := EdgeSwitch 5XP
  185. endef
  186. TARGET_DEVICES += ubnt_edgeswitch-5xp
  187. define Device/ubnt_edgeswitch-8xp
  188. $(Device/ubnt-sw)
  189. DEVICE_MODEL := EdgeSwitch 8XP
  190. DEVICE_PACKAGES += kmod-switch-bcm53xx-mdio
  191. endef
  192. TARGET_DEVICES += ubnt_edgeswitch-8xp
  193. define Device/ubnt_lap-120
  194. $(Device/ubnt-wa)
  195. DEVICE_MODEL := LiteAP ac (LAP-120)
  196. DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
  197. endef
  198. TARGET_DEVICES += ubnt_lap-120
  199. define Device/ubnt_litebeam-ac-gen2
  200. $(Device/ubnt-wa)
  201. DEVICE_MODEL := LiteBeam AC
  202. DEVICE_VARIANT := Gen2
  203. DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
  204. endef
  205. TARGET_DEVICES += ubnt_litebeam-ac-gen2
  206. define Device/ubnt_nanobeam-ac
  207. $(Device/ubnt-wa)
  208. DEVICE_MODEL := NanoBeam AC
  209. DEVICE_VARIANT := Gen1
  210. DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
  211. endef
  212. TARGET_DEVICES += ubnt_nanobeam-ac
  213. define Device/ubnt_nanobeam-ac-gen2
  214. $(Device/ubnt-wa)
  215. DEVICE_MODEL := NanoBeam AC
  216. DEVICE_VARIANT := Gen2
  217. DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
  218. endef
  219. TARGET_DEVICES += ubnt_nanobeam-ac-gen2
  220. define Device/ubnt_nanobridge-m
  221. $(Device/ubnt-xm)
  222. SOC := ar7241
  223. DEVICE_MODEL := NanoBridge M
  224. DEVICE_PACKAGES += rssileds
  225. SUPPORTED_DEVICES += bullet-m
  226. endef
  227. TARGET_DEVICES += ubnt_nanobridge-m
  228. define Device/ubnt_nanostation-ac
  229. $(Device/ubnt-wa)
  230. DEVICE_MODEL := Nanostation AC
  231. DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
  232. endef
  233. TARGET_DEVICES += ubnt_nanostation-ac
  234. define Device/ubnt_nanostation-ac-loco
  235. $(Device/ubnt-wa)
  236. DEVICE_MODEL := Nanostation AC loco
  237. DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
  238. endef
  239. TARGET_DEVICES += ubnt_nanostation-ac-loco
  240. define Device/ubnt_nanostation-loco-m
  241. $(Device/ubnt-xm)
  242. SOC := ar7241
  243. DEVICE_MODEL := Nanostation Loco M
  244. DEVICE_PACKAGES += rssileds
  245. SUPPORTED_DEVICES += bullet-m
  246. endef
  247. TARGET_DEVICES += ubnt_nanostation-loco-m
  248. define Device/ubnt_nanostation-loco-m-xw
  249. $(Device/ubnt-xw)
  250. DEVICE_MODEL := Nanostation Loco M
  251. DEVICE_PACKAGES += rssileds
  252. SUPPORTED_DEVICES += loco-m-xw
  253. endef
  254. TARGET_DEVICES += ubnt_nanostation-loco-m-xw
  255. define Device/ubnt_nanostation-m
  256. $(Device/ubnt-xm)
  257. SOC := ar7241
  258. DEVICE_MODEL := Nanostation M
  259. DEVICE_PACKAGES += rssileds
  260. SUPPORTED_DEVICES += nanostation-m
  261. endef
  262. TARGET_DEVICES += ubnt_nanostation-m
  263. define Device/ubnt_nanostation-m-xw
  264. $(Device/ubnt-xw)
  265. DEVICE_MODEL := Nanostation M
  266. DEVICE_PACKAGES += rssileds
  267. SUPPORTED_DEVICES += nanostation-m-xw
  268. endef
  269. TARGET_DEVICES += ubnt_nanostation-m-xw
  270. define Device/ubnt_picostation-m
  271. $(Device/ubnt-xm)
  272. SOC := ar7241
  273. DEVICE_MODEL := Picostation M
  274. DEVICE_PACKAGES += rssileds
  275. SUPPORTED_DEVICES += bullet-m
  276. endef
  277. TARGET_DEVICES += ubnt_picostation-m
  278. define Device/ubnt_powerbeam-5ac-500
  279. $(Device/ubnt-xc)
  280. SOC := qca9558
  281. DEVICE_MODEL := PowerBeam 5AC
  282. DEVICE_VARIANT := 500
  283. DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
  284. endef
  285. TARGET_DEVICES += ubnt_powerbeam-5ac-500
  286. define Device/ubnt_powerbeam-5ac-gen2
  287. $(Device/ubnt-wa)
  288. DEVICE_MODEL := PowerBeam 5AC
  289. DEVICE_VARIANT := Gen2
  290. DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
  291. endef
  292. TARGET_DEVICES += ubnt_powerbeam-5ac-gen2
  293. define Device/ubnt_powerbridge-m
  294. $(Device/ubnt-xm)
  295. SOC := ar7241
  296. DEVICE_MODEL := PowerBridge M
  297. DEVICE_PACKAGES += rssileds
  298. SUPPORTED_DEVICES += bullet-m
  299. endef
  300. TARGET_DEVICES += ubnt_powerbridge-m
  301. define Device/ubnt_rocket-5ac-lite
  302. $(Device/ubnt-xc)
  303. SOC := qca9558
  304. DEVICE_MODEL := Rocket 5AC
  305. DEVICE_VARIANT := Lite
  306. DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
  307. endef
  308. TARGET_DEVICES += ubnt_rocket-5ac-lite
  309. define Device/ubnt_rocket-m
  310. $(Device/ubnt-xm)
  311. SOC := ar7241
  312. DEVICE_MODEL := Rocket M
  313. DEVICE_PACKAGES += rssileds
  314. SUPPORTED_DEVICES += rocket-m
  315. endef
  316. TARGET_DEVICES += ubnt_rocket-m
  317. define Device/ubnt_routerstation_common
  318. DEVICE_PACKAGES := -kmod-ath9k -wpad-basic-wolfssl -uboot-envtools kmod-usb-ohci \
  319. kmod-usb2 fconfig
  320. DEVICE_VENDOR := Ubiquiti
  321. SOC := ar7161
  322. IMAGE_SIZE := 16128k
  323. IMAGES += factory.bin
  324. IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | \
  325. check-size
  326. IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | combined-image | \
  327. append-metadata | check-size
  328. KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
  329. KERNEL_INITRAMFS := kernel-bin | append-dtb
  330. endef
  331. define Device/ubnt_routerstation
  332. $(Device/ubnt_routerstation_common)
  333. DEVICE_MODEL := RouterStation
  334. UBNT_BOARD := RS
  335. UBNT_TYPE := RSx
  336. UBNT_CHIP := ar7100
  337. DEVICE_PACKAGES += -swconfig
  338. SUPPORTED_DEVICES += routerstation
  339. endef
  340. TARGET_DEVICES += ubnt_routerstation
  341. define Device/ubnt_routerstation-pro
  342. $(Device/ubnt_routerstation_common)
  343. DEVICE_MODEL := RouterStation Pro
  344. UBNT_BOARD := RSPRO
  345. UBNT_TYPE := RSPRO
  346. UBNT_CHIP := ar7100pro
  347. SUPPORTED_DEVICES += routerstation-pro
  348. endef
  349. TARGET_DEVICES += ubnt_routerstation-pro
  350. define Device/ubnt_unifi
  351. $(Device/ubnt-bz)
  352. DEVICE_MODEL := UniFi
  353. SUPPORTED_DEVICES += unifi
  354. endef
  355. TARGET_DEVICES += ubnt_unifi
  356. define Device/ubnt_unifiac
  357. DEVICE_VENDOR := Ubiquiti
  358. SOC := qca9563
  359. IMAGE_SIZE := 7744k
  360. DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
  361. endef
  362. define Device/ubnt_unifiac-lite
  363. $(Device/ubnt_unifiac)
  364. DEVICE_MODEL := UniFi AC Lite
  365. SUPPORTED_DEVICES += unifiac-lite
  366. endef
  367. TARGET_DEVICES += ubnt_unifiac-lite
  368. define Device/ubnt_unifiac-lr
  369. $(Device/ubnt_unifiac)
  370. DEVICE_MODEL := UniFi AC LR
  371. SUPPORTED_DEVICES += unifiac-lite ubnt,unifiac-lite
  372. endef
  373. TARGET_DEVICES += ubnt_unifiac-lr
  374. define Device/ubnt_unifiac-mesh
  375. $(Device/ubnt_unifiac)
  376. DEVICE_MODEL := UniFi AC Mesh
  377. SUPPORTED_DEVICES += unifiac-lite
  378. endef
  379. TARGET_DEVICES += ubnt_unifiac-mesh
  380. define Device/ubnt_unifiac-mesh-pro
  381. $(Device/ubnt_unifiac)
  382. DEVICE_MODEL := UniFi AC Mesh Pro
  383. SUPPORTED_DEVICES += unifiac-pro
  384. endef
  385. TARGET_DEVICES += ubnt_unifiac-mesh-pro
  386. define Device/ubnt_unifiac-pro
  387. $(Device/ubnt_unifiac)
  388. DEVICE_MODEL := UniFi AC Pro
  389. DEVICE_PACKAGES += kmod-usb2
  390. SUPPORTED_DEVICES += unifiac-pro
  391. endef
  392. TARGET_DEVICES += ubnt_unifiac-pro
  393. define Device/ubnt_unifi-ap-outdoor-plus
  394. $(Device/ubnt-bz)
  395. $(Device/ubnt-unifi-jffs2)
  396. DEVICE_MODEL := UniFi AP Outdoor+
  397. SUPPORTED_DEVICES += unifi-outdoor-plus
  398. endef
  399. TARGET_DEVICES += ubnt_unifi-ap-outdoor-plus
  400. define Device/ubnt_unifi-ap-pro
  401. $(Device/ubnt-unifi-jffs2)
  402. SOC := ar9344
  403. DEVICE_MODEL := UniFi AP Pro
  404. UBNT_CHIP := ar934x
  405. SUPPORTED_DEVICES += uap-pro
  406. endef
  407. TARGET_DEVICES += ubnt_unifi-ap-pro