generic.mk 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
  2. DEVICE_VARS += TPLINK_BOARD_ID
  3. define Device/kernel-size-migration
  4. DEVICE_COMPAT_VERSION := 2.0
  5. DEVICE_COMPAT_MESSAGE := *** Kernel partition size has changed from earlier \
  6. versions. You need to sysupgrade with the OpenWrt factory image and \
  7. use the force flag when image check fails. Settings will be lost. ***
  8. endef
  9. define Build/buffalo-rootfs-cksum
  10. ( \
  11. echo -ne "\x$$(od -A n -t u1 $@ | tr -s ' ' '\n' | \
  12. $(STAGING_DIR_HOST)/bin/awk '{s+=$$0}END{printf "%x", 255-s%256}')"; \
  13. ) >> $@
  14. endef
  15. define Build/edimax-header
  16. $(eval edimax_model=$(word 1,$(1)))
  17. $(STAGING_DIR_HOST)/bin/mkedimaximg \
  18. -b -s CSYS -m $(edimax_model) \
  19. -f 0x70000 -S 0x1200000 \
  20. -i $@ -o [email protected]
  21. @mv [email protected] $@
  22. endef
  23. define Device/DniImage
  24. KERNEL_SUFFIX := -uImage
  25. KERNEL = kernel-bin | append-dtb | uImage none
  26. KERNEL_NAME := zImage
  27. NETGEAR_BOARD_ID :=
  28. NETGEAR_HW_ID :=
  29. UBINIZE_OPTS := -E 5
  30. IMAGES += factory.img
  31. IMAGE/factory.img := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
  32. append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | \
  33. append-ubi | netgear-dni
  34. IMAGE/sysupgrade.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
  35. append-uImage-fakehdr filesystem | sysupgrade-tar kernel=$$$$@ | \
  36. append-metadata
  37. endef
  38. define Device/TpSafeImage
  39. KERNEL_SUFFIX := -uImage
  40. KERNEL = kernel-bin | append-dtb | uImage none
  41. KERNEL_NAME := zImage
  42. TPLINK_BOARD_ID :=
  43. IMAGES += factory.bin
  44. IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
  45. IMAGE/sysupgrade.bin := append-rootfs | \
  46. tplink-safeloader sysupgrade | append-metadata
  47. endef
  48. define Device/ZyXELImage
  49. KERNEL_SUFFIX := -uImage
  50. KERNEL = kernel-bin | append-dtb | uImage none | \
  51. pad-to $$(KERNEL_SIZE)
  52. KERNEL_NAME := zImage
  53. IMAGES += factory.bin
  54. IMAGE/factory.bin := append-rootfs | pad-rootfs | \
  55. pad-to $$$$(BLOCKSIZE) | zyxel-ras-image separate-kernel
  56. IMAGE/sysupgrade.bin/squashfs := append-rootfs | \
  57. pad-to $$$$(BLOCKSIZE) | sysupgrade-tar rootfs=$$$$@ | \
  58. append-metadata
  59. endef
  60. define Device/askey_rt4230w-rev6
  61. $(call Device/LegacyImage)
  62. DEVICE_VENDOR := Askey
  63. DEVICE_MODEL := RT4230W
  64. DEVICE_VARIANT := REV6
  65. SOC := qcom-ipq8065
  66. BLOCKSIZE := 128k
  67. PAGESIZE := 2048
  68. DEVICE_PACKAGES := ath10k-firmware-qca9984-ct
  69. KERNEL_IN_UBI := 1
  70. endef
  71. TARGET_DEVICES += askey_rt4230w-rev6
  72. define Device/asrock_g10
  73. $(call Device/FitImage)
  74. $(call Device/UbiFit)
  75. SOC := qcom-ipq8064
  76. DEVICE_VENDOR := ASRock
  77. DEVICE_MODEL := G10
  78. BLOCKSIZE := 128k
  79. PAGESIZE := 2048
  80. KERNEL_SIZE := 5332k
  81. DEVICE_PACKAGES := kmod-i2c-gpio ath10k-firmware-qca99x0-ct
  82. IMAGE/nand-factory.bin := append-ubi | edimax-header RN67
  83. endef
  84. TARGET_DEVICES += asrock_g10
  85. define Device/buffalo_wxr-2533dhp
  86. $(call Device/LegacyImage)
  87. SOC := qcom-ipq8064
  88. DEVICE_VENDOR := Buffalo
  89. DEVICE_MODEL := WXR-2533DHP
  90. BLOCKSIZE := 128k
  91. PAGESIZE := 2048
  92. IMAGE_SIZE := 65536k
  93. KERNEL_IN_UBI := 1
  94. IMAGE/sysupgrade.bin := append-rootfs | buffalo-rootfs-cksum | \
  95. sysupgrade-tar rootfs=$$$$@ | append-metadata
  96. DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
  97. endef
  98. TARGET_DEVICES += buffalo_wxr-2533dhp
  99. define Device/compex_wpq864
  100. $(call Device/FitImage)
  101. $(call Device/UbiFit)
  102. DEVICE_VENDOR := Compex
  103. DEVICE_MODEL := WPQ864
  104. BLOCKSIZE := 128k
  105. PAGESIZE := 2048
  106. SOC := qcom-ipq8064
  107. DEVICE_PACKAGES := kmod-gpio-beeper
  108. endef
  109. TARGET_DEVICES += compex_wpq864
  110. define Device/edgecore_ecw5410
  111. $(call Device/FitImage)
  112. $(call Device/UbiFit)
  113. DEVICE_VENDOR := Edgecore
  114. DEVICE_MODEL := ECW5410
  115. SOC := qcom-ipq8068
  116. BLOCKSIZE := 128k
  117. PAGESIZE := 2048
  118. DEVICE_DTS_CONFIG := [email protected]
  119. DEVICE_PACKAGES := ath10k-firmware-qca9984-ct \
  120. ipq-wifi-edgecore_ecw5410
  121. endef
  122. TARGET_DEVICES += edgecore_ecw5410
  123. define Device/linksys_ea7500-v1
  124. $(call Device/LegacyImage)
  125. $(Device/kernel-size-migration)
  126. DEVICE_VENDOR := Linksys
  127. DEVICE_MODEL := EA7500
  128. DEVICE_VARIANT := v1
  129. SOC := qcom-ipq8064
  130. PAGESIZE := 2048
  131. BLOCKSIZE := 128k
  132. KERNEL_SIZE := 4096k
  133. KERNEL = kernel-bin | append-dtb | uImage none | \
  134. append-uImage-fakehdr filesystem
  135. UBINIZE_OPTS := -E 5
  136. IMAGES := factory.bin sysupgrade.bin
  137. IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
  138. append-ubi | pad-to $$$$(PAGESIZE)
  139. DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
  140. endef
  141. TARGET_DEVICES += linksys_ea7500-v1
  142. define Device/linksys_ea8500
  143. $(call Device/LegacyImage)
  144. $(Device/kernel-size-migration)
  145. DEVICE_VENDOR := Linksys
  146. DEVICE_MODEL := EA8500
  147. SOC := qcom-ipq8064
  148. PAGESIZE := 2048
  149. BLOCKSIZE := 128k
  150. KERNEL_SIZE := 4096k
  151. KERNEL = kernel-bin | append-dtb | uImage none | \
  152. append-uImage-fakehdr filesystem
  153. BOARD_NAME := ea8500
  154. SUPPORTED_DEVICES += ea8500
  155. UBINIZE_OPTS := -E 5
  156. IMAGES += factory.bin
  157. IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
  158. append-ubi
  159. DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
  160. endef
  161. TARGET_DEVICES += linksys_ea8500
  162. define Device/meraki_mr42
  163. $(call Device/FitImage)
  164. DEVICE_VENDOR := Cisco Meraki
  165. DEVICE_MODEL := MR42
  166. SOC := qcom-ipq8068
  167. BLOCKSIZE := 128k
  168. PAGESIZE := 2048
  169. KERNEL_LOADADDR = 0x44208000
  170. DEVICE_PACKAGES := -swconfig -kmod-ata-ahci -kmod-ata-ahci-platform \
  171. -kmod-usb-ohci -kmod-usb2 -kmod-usb-ledtrig-usbport \
  172. -kmod-phy-qcom-ipq806x-usb -kmod-usb3 -kmod-usb-dwc3-qcom \
  173. -uboot-envtools ath10k-firmware-qca9887-ct \
  174. ath10k-firmware-qca99x0-ct kmod-eeprom-at24 kmod-hwmon-ina2xx \
  175. kmod-leds-tlc591xx
  176. endef
  177. TARGET_DEVICES += meraki_mr42
  178. define Device/meraki_mr52
  179. $(call Device/FitImage)
  180. DEVICE_VENDOR := Cisco Meraki
  181. DEVICE_MODEL := MR52
  182. SOC := qcom-ipq8068
  183. BLOCKSIZE := 128k
  184. PAGESIZE := 2048
  185. KERNEL_LOADADDR = 0x44208000
  186. DEVICE_DTS_CONFIG := config@2
  187. DEVICE_PACKAGES := -swconfig -kmod-ata-ahci -kmod-ata-ahci-platform \
  188. -kmod-usb-ohci -kmod-usb2 -kmod-usb-ledtrig-usbport \
  189. -kmod-phy-qcom-ipq806x-usb -kmod-usb3 -kmod-usb-dwc3-qcom \
  190. -uboot-envtools ath10k-firmware-qca9887-ct \
  191. ath10k-firmware-qca9984-ct kmod-eeprom-at24 kmod-hwmon-ina2xx \
  192. kmod-leds-tlc591xx
  193. endef
  194. TARGET_DEVICES += meraki_mr52
  195. define Device/nec_wg2600hp
  196. $(call Device/LegacyImage)
  197. DEVICE_VENDOR := NEC
  198. DEVICE_MODEL := Aterm WG2600HP
  199. SOC := qcom-ipq8064
  200. BLOCKSIZE := 64k
  201. BOARD_NAME := wg2600hp
  202. IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \
  203. pad-rootfs | append-metadata
  204. DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
  205. endef
  206. TARGET_DEVICES += nec_wg2600hp
  207. define Device/nec_wg2600hp3
  208. $(call Device/LegacyImage)
  209. DEVICE_VENDOR := NEC Platforms
  210. DEVICE_MODEL := Aterm WG2600HP3
  211. SOC := qcom-ipq8062
  212. BLOCKSIZE := 64k
  213. IMAGES := sysupgrade.bin
  214. IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \
  215. pad-rootfs | append-metadata
  216. DEVICE_PACKAGES := -kmod-ata-ahci -kmod-ata-ahci-platform \
  217. -kmod-usb-ohci -kmod-usb2 -kmod-usb-ledtrig-usbport \
  218. -kmod-usb-phy-qcom-dwc3 -kmod-usb3 -kmod-usb-dwc3-qcom \
  219. ath10k-firmware-qca9984-ct ipq-wifi-nec_wg2600hp3
  220. endef
  221. TARGET_DEVICES += nec_wg2600hp3
  222. define Device/netgear_d7800
  223. $(call Device/DniImage)
  224. DEVICE_VENDOR := NETGEAR
  225. DEVICE_MODEL := Nighthawk X4 D7800
  226. SOC := qcom-ipq8064
  227. KERNEL_SIZE := 4096k
  228. NETGEAR_BOARD_ID := D7800
  229. NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4
  230. BLOCKSIZE := 128k
  231. PAGESIZE := 2048
  232. BOARD_NAME := d7800
  233. SUPPORTED_DEVICES += d7800
  234. DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
  235. DEVICE_COMPAT_VERSION := 2.0
  236. DEVICE_COMPAT_MESSAGE := Sysupgrade does not work due to rootfs ubi partition size change. \
  237. Use factory image with the TFTP recovery flash routine.
  238. endef
  239. TARGET_DEVICES += netgear_d7800
  240. define Device/netgear_r7500
  241. $(call Device/DniImage)
  242. DEVICE_VENDOR := NETGEAR
  243. DEVICE_MODEL := Nighthawk X4 R7500
  244. DEVICE_VARIANT := v1
  245. SOC := qcom-ipq8064
  246. KERNEL_SIZE := 4096k
  247. NETGEAR_BOARD_ID := R7500
  248. NETGEAR_HW_ID := 29764841+0+128+256+3x3+4x4
  249. BLOCKSIZE := 128k
  250. PAGESIZE := 2048
  251. BOARD_NAME := r7500
  252. SUPPORTED_DEVICES += r7500
  253. DEVICE_PACKAGES := ath10k-firmware-qca988x-ct
  254. endef
  255. TARGET_DEVICES += netgear_r7500
  256. define Device/netgear_r7500v2
  257. $(call Device/DniImage)
  258. DEVICE_VENDOR := NETGEAR
  259. DEVICE_MODEL := Nighthawk X4 R7500
  260. DEVICE_VARIANT := v2
  261. SOC := qcom-ipq8064
  262. KERNEL_SIZE := 4096k
  263. NETGEAR_BOARD_ID := R7500v2
  264. NETGEAR_HW_ID := 29764958+0+128+512+3x3+4x4
  265. BLOCKSIZE := 128k
  266. PAGESIZE := 2048
  267. BOARD_NAME := r7500v2
  268. SUPPORTED_DEVICES += r7500v2
  269. DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct \
  270. ath10k-firmware-qca988x-ct
  271. endef
  272. TARGET_DEVICES += netgear_r7500v2
  273. define Device/netgear_r7800
  274. $(call Device/DniImage)
  275. DEVICE_VENDOR := NETGEAR
  276. DEVICE_MODEL := Nighthawk X4S R7800
  277. SOC := qcom-ipq8065
  278. KERNEL_SIZE := 4096k
  279. NETGEAR_BOARD_ID := R7800
  280. NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4+cascade
  281. BLOCKSIZE := 128k
  282. PAGESIZE := 2048
  283. BOARD_NAME := r7800
  284. SUPPORTED_DEVICES += r7800
  285. DEVICE_PACKAGES := ath10k-firmware-qca9984-ct kmod-ramoops
  286. endef
  287. TARGET_DEVICES += netgear_r7800
  288. define Device/netgear_xr500
  289. $(call Device/DniImage)
  290. DEVICE_VENDOR := NETGEAR
  291. DEVICE_MODEL := Nighthawk XR500
  292. SOC := qcom-ipq8065
  293. KERNEL_SIZE := 4096k
  294. NETGEAR_BOARD_ID := XR500
  295. NETGEAR_HW_ID := 29764958+0+256+512+4x4+4x4+cascade
  296. BLOCKSIZE := 128k
  297. PAGESIZE := 2048
  298. DEVICE_PACKAGES := ath10k-firmware-qca9984-ct kmod-ramoops
  299. endef
  300. TARGET_DEVICES += netgear_xr500
  301. define Device/qcom_ipq8064-ap148
  302. $(call Device/FitImage)
  303. $(call Device/UbiFit)
  304. DEVICE_VENDOR := Qualcomm
  305. DEVICE_MODEL := AP148
  306. DEVICE_VARIANT := standard
  307. SOC := qcom-ipq8064
  308. DEVICE_DTS := qcom-ipq8064-ap148
  309. KERNEL_INSTALL := 1
  310. BLOCKSIZE := 128k
  311. PAGESIZE := 2048
  312. BOARD_NAME := ap148
  313. SUPPORTED_DEVICES += ap148
  314. DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
  315. endef
  316. TARGET_DEVICES += qcom_ipq8064-ap148
  317. define Device/qcom_ipq8064-ap148-legacy
  318. $(call Device/LegacyImage)
  319. $(call Device/UbiFit)
  320. DEVICE_VENDOR := Qualcomm
  321. DEVICE_MODEL := AP148
  322. DEVICE_VARIANT := legacy
  323. SOC := qcom-ipq8064
  324. DEVICE_DTS := qcom-ipq8064-ap148
  325. BLOCKSIZE := 128k
  326. PAGESIZE := 2048
  327. BOARD_NAME := ap148
  328. SUPPORTED_DEVICES := qcom,ipq8064-ap148 ap148
  329. DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
  330. endef
  331. TARGET_DEVICES += qcom_ipq8064-ap148-legacy
  332. define Device/qcom_ipq8064-ap161
  333. $(call Device/FitImage)
  334. $(call Device/UbiFit)
  335. DEVICE_VENDOR := Qualcomm
  336. DEVICE_MODEL := AP161
  337. SOC := qcom-ipq8064
  338. DEVICE_DTS := qcom-ipq8064-ap161
  339. KERNEL_INSTALL := 1
  340. BLOCKSIZE := 128k
  341. PAGESIZE := 2048
  342. BOARD_NAME := ap161
  343. DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
  344. endef
  345. TARGET_DEVICES += qcom_ipq8064-ap161
  346. define Device/qcom_ipq8064-db149
  347. $(call Device/FitImage)
  348. DEVICE_VENDOR := Qualcomm
  349. DEVICE_MODEL := DB149
  350. SOC := qcom-ipq8064
  351. DEVICE_DTS := qcom-ipq8064-db149
  352. KERNEL_INSTALL := 1
  353. BOARD_NAME := db149
  354. DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
  355. endef
  356. TARGET_DEVICES += qcom_ipq8064-db149
  357. define Device/tplink_ad7200
  358. $(call Device/TpSafeImage)
  359. DEVICE_VENDOR := TP-Link
  360. DEVICE_MODEL := AD7200
  361. DEVICE_VARIANT := v1/v2
  362. DEVICE_ALT0_VENDOR := TP-Link
  363. DEVICE_ALT0_MODEL := Talon AD7200
  364. DEVICE_ALT0_VARIANT := v1/v2
  365. SOC := qcom-ipq8064
  366. BLOCKSIZE := 128k
  367. PAGESIZE := 2048
  368. TPLINK_BOARD_ID := AD7200
  369. DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct kmod-wil6210
  370. endef
  371. TARGET_DEVICES += tplink_ad7200
  372. define Device/tplink_c2600
  373. $(call Device/TpSafeImage)
  374. DEVICE_VENDOR := TP-Link
  375. DEVICE_MODEL := Archer C2600
  376. DEVICE_VARIANT := v1
  377. SOC := qcom-ipq8064
  378. BLOCKSIZE := 128k
  379. PAGESIZE := 2048
  380. BOARD_NAME := c2600
  381. SUPPORTED_DEVICES += c2600
  382. TPLINK_BOARD_ID := C2600
  383. DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
  384. endef
  385. TARGET_DEVICES += tplink_c2600
  386. define Device/tplink_vr2600v
  387. DEVICE_VENDOR := TP-Link
  388. DEVICE_MODEL := Archer VR2600v
  389. DEVICE_VARIANT := v1
  390. KERNEL_SUFFIX := -uImage
  391. KERNEL = kernel-bin | append-dtb | uImage none
  392. KERNEL_NAME := zImage
  393. IMAGE_SIZE := 12672k
  394. SOC := qcom-ipq8064
  395. BLOCKSIZE := 128k
  396. PAGESIZE := 2048
  397. BOARD_NAME := vr2600v
  398. SUPPORTED_DEVICES += vr2600v
  399. DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
  400. IMAGE/sysupgrade.bin := pad-extra 512 | append-kernel | \
  401. append-rootfs | pad-rootfs | append-metadata
  402. endef
  403. TARGET_DEVICES += tplink_vr2600v
  404. define Device/ubnt_unifi-ac-hd
  405. $(call Device/FitImageLzma)
  406. DEVICE_VENDOR := Ubiquiti
  407. DEVICE_MODEL := UniFi AC HD
  408. SOC := qcom-ipq8064
  409. BLOCKSIZE := 64k
  410. IMAGE_SIZE := 14784k
  411. DEVICE_PACKAGES := ath10k-firmware-qca9984-ct
  412. IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
  413. append-rootfs | pad-rootfs | check-size | append-metadata
  414. endef
  415. TARGET_DEVICES += ubnt_unifi-ac-hd
  416. define Device/zyxel_nbg6817
  417. DEVICE_VENDOR := ZyXEL
  418. DEVICE_MODEL := NBG6817
  419. SOC := qcom-ipq8065
  420. KERNEL_SIZE := 4096k
  421. BLOCKSIZE := 64k
  422. BOARD_NAME := nbg6817
  423. RAS_BOARD := NBG6817
  424. RAS_ROOTFS_SIZE := 20934k
  425. RAS_VERSION := "V1.99(OWRT.9999)C0"
  426. SUPPORTED_DEVICES += nbg6817
  427. DEVICE_PACKAGES := ath10k-firmware-qca9984-ct e2fsprogs \
  428. kmod-fs-ext4 losetup
  429. $(call Device/ZyXELImage)
  430. endef
  431. TARGET_DEVICES += zyxel_nbg6817