generic-ubnt.mk 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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. # all UBNT XM/WA devices 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=$@ [email protected] bs=1024k count=1; \
  18. dd if=$@ [email protected] bs=1024k skip=1; \
  19. $(STAGING_DIR_HOST)/bin/mkfwimage -B $(UBNT_BOARD) \
  20. -v $(UBNT_TYPE).$(UBNT_CHIP).v$(UBNT_VERSION)-$(UBNT_REVISION) \
  21. -k [email protected] -r [email protected] -o $@; \
  22. rm [email protected] [email protected] )
  23. endef
  24. # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
  25. # UBNT_TYPE e.g. one of (BZ, XM, XW)
  26. # UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
  27. # UBNT_VERSION e.g. one of (6.0.0, 8.5.0)
  28. define Device/ubnt
  29. DEVICE_VENDOR := Ubiquiti
  30. DEVICE_PACKAGES := kmod-usb2
  31. IMAGES += factory.bin
  32. IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
  33. append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | mkubntimage-split
  34. endef
  35. define Device/ubnt-bz
  36. $(Device/ubnt)
  37. SOC := ar7241
  38. IMAGE_SIZE := 7448k
  39. UBNT_BOARD := XM
  40. UBNT_CHIP := ar7240
  41. UBNT_TYPE := BZ
  42. UBNT_VERSION := 6.0.0
  43. endef
  44. define Device/ubnt-wa
  45. $(Device/ubnt)
  46. SOC := ar9342
  47. IMAGE_SIZE := 15744k
  48. UBNT_BOARD := WA
  49. UBNT_CHIP := ar934x
  50. UBNT_TYPE := WA
  51. UBNT_VERSION := 8.5.0
  52. endef
  53. define Device/ubnt-xm
  54. $(Device/ubnt)
  55. SOC := ar7241
  56. DEVICE_VARIANT := XM
  57. DEVICE_PACKAGES += kmod-usb-ohci
  58. IMAGE_SIZE := 7448k
  59. UBNT_BOARD := XM
  60. UBNT_CHIP := ar7240
  61. UBNT_TYPE := XM
  62. UBNT_VERSION := 6.0.0
  63. KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
  64. endef
  65. define Device/ubnt-xw
  66. $(Device/ubnt)
  67. SOC := ar9342
  68. DEVICE_VARIANT := XW
  69. IMAGE_SIZE := 7552k
  70. UBNT_BOARD := XM
  71. UBNT_CHIP := ar934x
  72. UBNT_REVISION := 42.$(UBNT_REVISION)
  73. UBNT_TYPE := XW
  74. UBNT_VERSION := 6.0.4
  75. endef
  76. define Device/ubnt_acb-isp
  77. $(Device/ubnt)
  78. SOC := qca9533
  79. DEVICE_MODEL := airCube ISP
  80. IMAGE_SIZE := 15744k
  81. UBNT_BOARD := ACB-ISP
  82. UBNT_CHIP := qca9533
  83. UBNT_TYPE := ACB
  84. UBNT_VERSION := 2.5.0
  85. endef
  86. TARGET_DEVICES += ubnt_acb-isp
  87. define Device/ubnt_airrouter
  88. $(Device/ubnt-xm)
  89. DEVICE_MODEL := AirRouter
  90. SUPPORTED_DEVICES += airrouter
  91. endef
  92. TARGET_DEVICES += ubnt_airrouter
  93. define Device/ubnt_bullet-m
  94. $(Device/ubnt-xm)
  95. DEVICE_MODEL := Bullet-M
  96. DEVICE_PACKAGES += rssileds
  97. SUPPORTED_DEVICES += bullet-m
  98. endef
  99. TARGET_DEVICES += ubnt_bullet-m
  100. define Device/ubnt_bullet-m-xw
  101. $(Device/ubnt-xw)
  102. DEVICE_MODEL := Bullet-M
  103. DEVICE_PACKAGES += rssileds
  104. SUPPORTED_DEVICES += bullet-m-xw
  105. endef
  106. TARGET_DEVICES += ubnt_bullet-m-xw
  107. define Device/ubnt_lap-120
  108. $(Device/ubnt-wa)
  109. DEVICE_MODEL := LiteAP ac
  110. DEVICE_VARIANT := LAP-120
  111. DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
  112. endef
  113. TARGET_DEVICES += ubnt_lap-120
  114. define Device/ubnt_litebeam-ac-gen2
  115. $(Device/ubnt-wa)
  116. DEVICE_MODEL := LiteBeam AC
  117. DEVICE_VARIANT := Gen2
  118. DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
  119. endef
  120. TARGET_DEVICES += ubnt_litebeam-ac-gen2
  121. define Device/ubnt_nanobeam-ac
  122. $(Device/ubnt-wa)
  123. DEVICE_MODEL := NanoBeam AC
  124. DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
  125. endef
  126. TARGET_DEVICES += ubnt_nanobeam-ac
  127. define Device/ubnt_nanostation-ac
  128. $(Device/ubnt-wa)
  129. DEVICE_MODEL := Nanostation AC
  130. DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
  131. endef
  132. TARGET_DEVICES += ubnt_nanostation-ac
  133. define Device/ubnt_nanostation-ac-loco
  134. $(Device/ubnt-wa)
  135. DEVICE_MODEL := Nanostation AC loco
  136. DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
  137. endef
  138. TARGET_DEVICES += ubnt_nanostation-ac-loco
  139. define Device/ubnt_nanostation-m
  140. $(Device/ubnt-xm)
  141. DEVICE_MODEL := Nanostation M
  142. DEVICE_PACKAGES += rssileds
  143. SUPPORTED_DEVICES += nanostation-m
  144. endef
  145. TARGET_DEVICES += ubnt_nanostation-m
  146. define Device/ubnt_nanostation-m-xw
  147. $(Device/ubnt-xw)
  148. DEVICE_MODEL := Nanostation M
  149. DEVICE_PACKAGES += rssileds
  150. SUPPORTED_DEVICES += nanostation-m-xw
  151. endef
  152. TARGET_DEVICES += ubnt_nanostation-m-xw
  153. define Device/ubnt_rocket-m
  154. $(Device/ubnt-xm)
  155. DEVICE_MODEL := Rocket-M
  156. DEVICE_PACKAGES += rssileds
  157. SUPPORTED_DEVICES += rocket-m
  158. endef
  159. TARGET_DEVICES += ubnt_rocket-m
  160. define Device/ubnt_routerstation_common
  161. DEVICE_PACKAGES := -kmod-ath9k -wpad-mini -uboot-envtools kmod-usb-ohci \
  162. kmod-usb2 fconfig
  163. DEVICE_VENDOR := Ubiquiti
  164. SOC := ar7161
  165. IMAGE_SIZE := 16128k
  166. IMAGES := factory.bin
  167. IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | \
  168. check-size $$$$(IMAGE_SIZE)
  169. KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
  170. KERNEL_INITRAMFS := kernel-bin | append-dtb
  171. endef
  172. define Device/ubnt_routerstation
  173. $(Device/ubnt_routerstation_common)
  174. DEVICE_MODEL := RouterStation
  175. UBNT_BOARD := RS
  176. UBNT_TYPE := RSx
  177. UBNT_CHIP := ar7100
  178. DEVICE_PACKAGES += -swconfig
  179. SUPPORTED_DEVICES += routerstation
  180. endef
  181. TARGET_DEVICES += ubnt_routerstation
  182. define Device/ubnt_routerstation-pro
  183. $(Device/ubnt_routerstation_common)
  184. DEVICE_MODEL := RouterStation Pro
  185. UBNT_BOARD := RSPRO
  186. UBNT_TYPE := RSPRO
  187. UBNT_CHIP := ar7100pro
  188. SUPPORTED_DEVICES += routerstation-pro
  189. endef
  190. TARGET_DEVICES += ubnt_routerstation-pro
  191. define Device/ubnt_unifi
  192. $(Device/ubnt-bz)
  193. DEVICE_MODEL := UniFi
  194. SUPPORTED_DEVICES += unifi
  195. endef
  196. TARGET_DEVICES += ubnt_unifi
  197. define Device/ubnt_unifiac
  198. DEVICE_VENDOR := Ubiquiti
  199. SOC := qca9563
  200. IMAGE_SIZE := 7744k
  201. DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
  202. endef
  203. define Device/ubnt_unifiac-lite
  204. $(Device/ubnt_unifiac)
  205. DEVICE_MODEL := UniFi AC-Lite
  206. SUPPORTED_DEVICES += unifiac-lite
  207. endef
  208. TARGET_DEVICES += ubnt_unifiac-lite
  209. define Device/ubnt_unifiac-lr
  210. $(Device/ubnt_unifiac)
  211. DEVICE_MODEL := UniFi AC-LR
  212. SUPPORTED_DEVICES += unifiac-lite ubnt,unifiac-lite
  213. endef
  214. TARGET_DEVICES += ubnt_unifiac-lr
  215. define Device/ubnt_unifiac-mesh
  216. $(Device/ubnt_unifiac)
  217. DEVICE_MODEL := UniFi AC-Mesh
  218. SUPPORTED_DEVICES += ubnt-unifiac-mesh
  219. endef
  220. TARGET_DEVICES += ubnt_unifiac-mesh
  221. define Device/ubnt_unifiac-mesh-pro
  222. $(Device/ubnt_unifiac)
  223. DEVICE_MODEL := UniFi AC-Mesh Pro
  224. SUPPORTED_DEVICES += ubnt-unifiac-mesh-pro
  225. endef
  226. TARGET_DEVICES += ubnt_unifiac-mesh-pro
  227. define Device/ubnt_unifiac-pro
  228. $(Device/ubnt_unifiac)
  229. DEVICE_MODEL := UniFi AC-Pro
  230. DEVICE_PACKAGES += kmod-usb2
  231. SUPPORTED_DEVICES += ubnt-unifiac-pro
  232. endef
  233. TARGET_DEVICES += ubnt_unifiac-pro