ubnt.mk 8.1 KB

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