generic-ubnt.mk 6.5 KB

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