generic-ubnt.mk 6.7 KB

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