generic-ubnt.mk 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. DEVICE_VARS += UBNT_BOARD UBNT_CHIP UBNT_TYPE
  2. # mkubntimage is using the kernel image direct
  3. # routerboard creates partitions out of the ubnt header
  4. define Build/mkubntimage
  5. -$(STAGING_DIR_HOST)/bin/mkfwimage \
  6. -B $(UBNT_BOARD) -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
  7. -k $(IMAGE_KERNEL) \
  8. -r $@ \
  9. -o $@
  10. endef
  11. # all UBNT XM device expect the kernel image to have 1024k while flash, when
  12. # booting the image, the size doesn't matter.
  13. define Build/mkubntimage-split
  14. -[ -f $@ ] && ( \
  15. dd if=$@ [email protected] bs=1024k count=1; \
  16. dd if=$@ [email protected] bs=1024k skip=1; \
  17. $(STAGING_DIR_HOST)/bin/mkfwimage \
  18. -B $(UBNT_BOARD) -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
  19. -k [email protected] \
  20. -r [email protected] \
  21. -o $@; \
  22. rm [email protected] [email protected] )
  23. endef
  24. define Build/mkubntimage2
  25. -$(STAGING_DIR_HOST)/bin/mkfwimage2 -f 0x9f000000 \
  26. -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
  27. -p jffs2:0x50000:0xf60000:0:0:$@ \
  28. -o [email protected]
  29. @mv [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. define Device/ubnt
  35. DEVICE_PACKAGES := kmod-usb-core kmod-usb2
  36. DEVICE_PROFILE := UBNT
  37. IMAGE_SIZE := 7552k
  38. MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
  39. UBNT_BOARD := XM
  40. IMAGES := sysupgrade.bin factory.bin
  41. IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
  42. IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split
  43. endef
  44. define Device/ubnt-xm
  45. $(Device/ubnt)
  46. DEVICE_PACKAGES += kmod-usb-ohci
  47. UBNT_TYPE := XM
  48. UBNT_CHIP := ar7240
  49. KERNEL := kernel-bin | patch-cmdline | relocate-kernel | lzma | uImage lzma
  50. endef
  51. define Device/ubnt-xw
  52. $(Device/ubnt)
  53. UBNT_TYPE := XW
  54. UBNT_CHIP := ar934x
  55. endef
  56. define Device/ubnt-bz
  57. $(Device/ubnt)
  58. UBNT_TYPE := BZ
  59. UBNT_CHIP := ar7240
  60. endef
  61. define Device/rw2458n
  62. $(Device/ubnt-xm)
  63. DEVICE_TITLE := Ubiquiti RW2458N
  64. BOARDNAME := RW2458N
  65. endef
  66. TARGET_DEVICES += rw2458n
  67. define Device/ubnt-airrouter
  68. $(Device/ubnt-xm)
  69. DEVICE_TITLE := Ubiquiti AirRouter
  70. BOARDNAME := UBNT-AR
  71. endef
  72. TARGET_DEVICES += ubnt-airrouter
  73. define Device/ubnt-bullet-m
  74. $(Device/ubnt-xm)
  75. DEVICE_TITLE := Ubiquiti Bullet-M
  76. BOARDNAME := UBNT-BM
  77. endef
  78. TARGET_DEVICES += ubnt-bullet-m
  79. define Device/ubnt-rocket-m
  80. $(Device/ubnt-xm)
  81. DEVICE_TITLE := Ubiquiti Rocket-M
  82. BOARDNAME := UBNT-RM
  83. endef
  84. TARGET_DEVICES += ubnt-rocket-m
  85. define Device/ubnt-nano-m
  86. $(Device/ubnt-xm)
  87. DEVICE_TITLE := Ubiquiti Nano-M
  88. BOARDNAME := UBNT-NM
  89. endef
  90. TARGET_DEVICES += ubnt-nano-m
  91. define Device/ubnt-unifi
  92. $(Device/ubnt-bz)
  93. DEVICE_TITLE := Ubiquiti UniFi
  94. BOARDNAME := UBNT-UF
  95. DEVICE_PROFILE += UBNTUNIFI
  96. endef
  97. TARGET_DEVICES += ubnt-unifi
  98. define Device/ubnt-unifiac
  99. DEVICE_PACKAGES := kmod-usb-core kmod-usb2
  100. DEVICE_PROFILE := UBNT
  101. IMAGE_SIZE := 7744k
  102. MTDPARTS := spi0.0:384k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),7744k(ubnt-airos)ro,128k(bs),256k(cfg)ro,64k(EEPROM)ro
  103. IMAGES := sysupgrade.bin
  104. IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
  105. endef
  106. define Device/ubnt-unifiac-lite
  107. $(Device/ubnt-unifiac)
  108. DEVICE_TITLE := Ubiquiti UniFi AC-Lite
  109. DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
  110. DEVICE_PROFILE += UBNTUNIFIACLITE
  111. BOARDNAME := UBNT-UF-AC-LITE
  112. endef
  113. TARGET_DEVICES += ubnt-unifiac-lite
  114. define Device/ubnt-unifiac-mesh
  115. $(Device/ubnt-unifiac-lite)
  116. DEVICE_TITLE := Ubiquiti UniFi AC-Mesh
  117. endef
  118. TARGET_DEVICES += ubnt-unifiac-mesh
  119. define Device/ubnt-unifiac-pro
  120. $(Device/ubnt-unifiac)
  121. DEVICE_TITLE := Ubiquiti UniFi AC-Pro
  122. DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct
  123. DEVICE_PROFILE += UBNTUNIFIACPRO
  124. BOARDNAME := UBNT-UF-AC-PRO
  125. endef
  126. TARGET_DEVICES += ubnt-unifiac-pro
  127. define Device/ubnt-unifi-outdoor
  128. $(Device/ubnt-bz)
  129. DEVICE_TITLE := Ubiquiti UniFi Outdoor
  130. BOARDNAME := UBNT-U20
  131. DEVICE_PROFILE += UBNTUNIFIOUTDOOR
  132. endef
  133. TARGET_DEVICES += ubnt-unifi-outdoor
  134. define Device/ubnt-nano-m-xw
  135. $(Device/ubnt-xw)
  136. DEVICE_TITLE := Ubiquiti Nano M XW
  137. BOARDNAME := UBNT-NM-XW
  138. endef
  139. TARGET_DEVICES += ubnt-nano-m-xw
  140. define Device/ubnt-lbe-m5
  141. $(Device/ubnt-xw)
  142. DEVICE_TITLE := Ubiquiti Litebeam M5
  143. BOARDNAME := UBNT-LBE-M5
  144. endef
  145. TARGET_DEVICES += ubnt-lbe-m5
  146. define Device/ubnt-loco-m-xw
  147. $(Device/ubnt-xw)
  148. DEVICE_TITLE := Ubiquiti Loco XW
  149. BOARDNAME := UBNT-LOCO-XW
  150. endef
  151. TARGET_DEVICES += ubnt-loco-m-xw
  152. define Device/ubnt-rocket-m-xw
  153. $(Device/ubnt-xw)
  154. DEVICE_TITLE := Ubiquiti Rocket M XW
  155. BOARDNAME := UBNT-RM-XW
  156. endef
  157. TARGET_DEVICES += ubnt-rocket-m-xw
  158. define Device/ubnt-rocket-m-ti
  159. $(Device/ubnt-xw)
  160. DEVICE_TITLE := Ubiquiti Rocket M TI
  161. BOARDNAME := UBNT-RM-TI
  162. UBNT_TYPE := TI
  163. endef
  164. TARGET_DEVICES += ubnt-rocket-m-ti
  165. define Device/ubnt-air-gateway
  166. $(Device/ubnt-xm)
  167. DEVICE_TITLE := Ubiquiti Air Gateway
  168. BOARDNAME := UBNT-AGW
  169. UBNT_TYPE := AirGW
  170. UBNT_CHIP := ar933x
  171. CONSOLE := ttyATH0,115200
  172. endef
  173. TARGET_DEVICES += ubnt-air-gateway
  174. define Device/ubnt-air-gateway-pro
  175. $(Device/ubnt-xm)
  176. DEVICE_TITLE := Ubiquiti Air Gateway Pro
  177. BOARDNAME := UBNT-AGWP
  178. UBNT_TYPE := AirGWP
  179. UBNT_CHIP := ar934x
  180. endef
  181. TARGET_DEVICES += ubnt-air-gateway-pro
  182. define Device/ubdev01
  183. $(Device/ubnt-xm)
  184. DEVICE_TITLE := Ubiquiti ubDEV01
  185. MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7488k(firmware),64k(certs),256k(cfg)ro,64k(EEPROM)ro
  186. BOARDNAME := UBNT-UF
  187. UBNT_BOARD := UBDEV01
  188. endef
  189. TARGET_DEVICES += ubdev01
  190. define Device/ubnt-routerstation
  191. DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2
  192. DEVICE_PROFILE := UBNT
  193. IMAGE_SIZE := 16128k
  194. IMAGES := sysupgrade.bin factory.bin
  195. IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage
  196. IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | combined-image | check-size $$$$(IMAGE_SIZE)
  197. KERNEL := kernel-bin | patch-cmdline | lzma | pad-to $$(BLOCKSIZE)
  198. endef
  199. define Device/ubnt-rs
  200. $(Device/ubnt-routerstation)
  201. DEVICE_TITLE := Ubiquiti RouterStation
  202. BOARDNAME := UBNT-RS
  203. DEVICE_PROFILE += UBNTRS
  204. UBNT_BOARD := RS
  205. UBNT_TYPE := RSx
  206. UBNT_CHIP := ar7100
  207. endef
  208. TARGET_DEVICES += ubnt-rs
  209. define Device/ubnt-rspro
  210. $(Device/ubnt-routerstation)
  211. DEVICE_TITLE := Ubiquiti RouterStation Pro
  212. BOARDNAME := UBNT-RSPRO
  213. DEVICE_PROFILE += UBNTRSPRO
  214. UBNT_BOARD := RSPRO
  215. UBNT_TYPE := RSPRO
  216. UBNT_CHIP := ar7100pro
  217. endef
  218. TARGET_DEVICES += ubnt-rspro
  219. define Device/ubnt-ls-sr71
  220. $(Device/ubnt-routerstation)
  221. DEVICE_TITLE := Ubiquiti LS-SR71
  222. BOARDNAME := UBNT-LS-SR71
  223. UBNT_BOARD := LS-SR71
  224. UBNT_TYPE := LS-SR71
  225. UBNT_CHIP := ar7100
  226. endef
  227. TARGET_DEVICES += ubnt-ls-sr71
  228. define Device/ubnt-uap-pro
  229. DEVICE_TITLE := Ubiquiti UAP Pro
  230. KERNEL_SIZE := 1792k
  231. IMAGE_SIZE := 15744k
  232. MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1792k(kernel),13952k(rootfs),256k(cfg)ro,64k(EEPROM)ro,15744k@0x50000(firmware)
  233. UBNT_TYPE := BZ
  234. UBNT_CHIP := ar934x
  235. BOARDNAME := UAP-PRO
  236. DEVICE_PROFILE := UBNT UAPPRO
  237. KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | jffs2 kernel0
  238. IMAGES := sysupgrade.bin factory.bin
  239. IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
  240. IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage2
  241. endef
  242. TARGET_DEVICES += ubnt-uap-pro
  243. define Device/ubnt-unifi-outdoor-plus
  244. $(Device/ubnt-uap-pro)
  245. DEVICE_TITLE := Ubiquiti UniFi Outdoor Plus
  246. UBNT_CHIP := ar7240
  247. BOARDNAME := UBNT-UOP
  248. DEVICE_PROFILE := UBNT
  249. endef
  250. TARGET_DEVICES += ubnt-unifi-outdoor-plus