generic-ubnt.mk 6.1 KB

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