ipq50xx.mk 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. DEVICE_VARS += BOOT_SCRIPT
  2. define Build/mstc-header
  3. $(eval version=$(word 1,$(1)))
  4. $(eval hdrlen=$(if $(word 2,$(1)),$(word 2,$(1)),0x400))
  5. gzip -c $@ | tail -c8 > [email protected]
  6. ( \
  7. printf "CMOC"; \
  8. tail -c+5 [email protected]; head -c4 [email protected]; \
  9. printf '$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION)' | \
  10. dd bs=64 count=1 conv=sync 2>/dev/null; \
  11. printf "$(version)" | \
  12. dd bs=64 count=1 conv=sync 2>/dev/null; \
  13. dd if=/dev/zero bs=$$(($(hdrlen) - 0x8c)) count=1 2>/dev/null; \
  14. cat $@; \
  15. ) > [email protected]
  16. mv [email protected] $@
  17. rm -f [email protected]
  18. endef
  19. define Device/cmcc_pz-l8
  20. $(call Device/FitImageLzma)
  21. $(call Device/UbiFit)
  22. DEVICE_VENDOR := CMCC
  23. DEVICE_MODEL := PZ-L8
  24. DEVICE_DTS_CONFIG := [email protected]
  25. SOC := ipq5018
  26. BLOCKSIZE := 128k
  27. PAGESIZE := 2048
  28. IMAGE_SIZE := 59392k
  29. NAND_SIZE := 128m
  30. endef
  31. TARGET_DEVICES += cmcc_pz-l8
  32. define Device/elecom_wrc-x3000gs2
  33. $(call Device/FitImageLzma)
  34. DEVICE_VENDOR := ELECOM
  35. DEVICE_MODEL := WRC-X3000GS2
  36. DEVICE_DTS_CONFIG := [email protected]
  37. SOC := ipq5018
  38. KERNEL_IN_UBI := 1
  39. BLOCKSIZE := 128k
  40. PAGESIZE := 2048
  41. IMAGE_SIZE := 52480k
  42. NAND_SIZE := 128m
  43. IMAGES += factory.bin
  44. IMAGE/factory.bin := append-ubi | qsdk-ipq-factory-nand | \
  45. mstc-header 4.04(XZF.0)b90 | elecom-product-header WRC-X3000GS2
  46. DEVICE_PACKAGES := ath11k-firmware-ipq5018-qcn6122 \
  47. ipq-wifi-elecom_wrc-x3000gs2
  48. endef
  49. TARGET_DEVICES += elecom_wrc-x3000gs2
  50. define Device/glinet_gl-b3000
  51. $(call Device/FitImage)
  52. DEVICE_VENDOR := GL.iNet
  53. DEVICE_MODEL := GL-B3000
  54. SOC := ipq5018
  55. KERNEL_IN_UBI := 1
  56. BLOCKSIZE := 128k
  57. PAGESIZE := 2048
  58. NAND_SIZE := 128m
  59. DEVICE_DTS_CONFIG := [email protected]
  60. SUPPORTED_DEVICES += b3000
  61. BOOT_SCRIPT:= glinet_gl-b3000.bootscript
  62. IMAGES := factory.img sysupgrade.bin
  63. IMAGE/factory.img := append-ubi | gl-qsdk-factory | append-metadata
  64. DEVICE_PACKAGES := \
  65. ath11k-firmware-ipq5018-qcn6122 \
  66. ipq-wifi-glinet_gl-b3000 \
  67. dumpimage
  68. endef
  69. TARGET_DEVICES += glinet_gl-b3000
  70. define Device/iodata_wn-dax3000gr
  71. $(call Device/FitImageLzma)
  72. DEVICE_VENDOR := I-O DATA
  73. DEVICE_MODEL := WN-DAX3000GR
  74. DEVICE_DTS_CONFIG := [email protected]
  75. SOC := ipq5018
  76. KERNEL_IN_UBI := 1
  77. BLOCKSIZE := 128k
  78. PAGESIZE := 2048
  79. IMAGE_SIZE := 52480k
  80. NAND_SIZE := 128m
  81. IMAGES += factory.bin
  82. IMAGE/factory.bin := append-ubi | qsdk-ipq-factory-nand | \
  83. mstc-header 4.04(XZH.1)b90 0x480
  84. DEVICE_PACKAGES := ath11k-firmware-ipq5018-qcn6122 \
  85. ipq-wifi-iodata_wn-dax3000gr
  86. endef
  87. TARGET_DEVICES += iodata_wn-dax3000gr
  88. define Device/linksys_ipq50xx_mx_base
  89. $(call Device/FitImageLzma)
  90. DEVICE_VENDOR := Linksys
  91. BLOCKSIZE := 128k
  92. PAGESIZE := 2048
  93. KERNEL_SIZE := 8192k
  94. IMAGE_SIZE := 83968k
  95. NAND_SIZE := 256m
  96. SOC := ipq5018
  97. IMAGES += factory.bin
  98. IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=$$$$(DEVICE_MODEL)
  99. endef
  100. define Device/linksys_mr5500
  101. $(call Device/linksys_ipq50xx_mx_base)
  102. DEVICE_MODEL := MR5500
  103. DEVICE_DTS_CONFIG := [email protected]
  104. DEVICE_PACKAGES := ath11k-firmware-ipq5018 \
  105. kmod-ath11k-pci \
  106. ath11k-firmware-qcn9074 \
  107. ipq-wifi-linksys_mr5500 \
  108. kmod-usb-ledtrig-usbport
  109. endef
  110. TARGET_DEVICES += linksys_mr5500
  111. define Device/linksys_mx2000
  112. $(call Device/linksys_ipq50xx_mx_base)
  113. DEVICE_MODEL := MX2000
  114. DEVICE_DTS_CONFIG := [email protected]
  115. DEVICE_PACKAGES := ath11k-firmware-ipq5018-qcn6122 \
  116. ipq-wifi-linksys_mx2000
  117. endef
  118. TARGET_DEVICES += linksys_mx2000
  119. define Device/linksys_mx5500
  120. $(call Device/linksys_ipq50xx_mx_base)
  121. DEVICE_MODEL := MX5500
  122. DEVICE_DTS_CONFIG := [email protected]
  123. DEVICE_PACKAGES := ath11k-firmware-ipq5018 \
  124. kmod-ath11k-pci \
  125. ath11k-firmware-qcn9074 \
  126. ipq-wifi-linksys_mx5500
  127. endef
  128. TARGET_DEVICES += linksys_mx5500
  129. define Device/linksys_mx6200
  130. $(call Device/FitImage)
  131. $(call Device/UbiFit)
  132. DEVICE_VENDOR := Linksys
  133. DEVICE_MODEL := MX6200
  134. BLOCKSIZE := 128k
  135. PAGESIZE := 2048
  136. DEVICE_DTS_CONFIG := [email protected]
  137. KERNEL_SIZE := 8192k
  138. IMAGE_SIZE := 51200k
  139. NAND_SIZE := 256m
  140. SOC := ipq5018
  141. IMAGE/factory.ubi := append-ubi | linksys-image type=$$$$(DEVICE_MODEL)
  142. DEVICE_PACKAGES := ath11k-firmware-ipq5018-qcn6122 \
  143. ipq-wifi-linksys_mx6200
  144. endef
  145. TARGET_DEVICES += linksys_mx6200
  146. define Device/linksys_spnmx56
  147. $(call Device/linksys_ipq50xx_mx_base)
  148. DEVICE_MODEL := SPNMX56
  149. DEVICE_DTS_CONFIG := [email protected]
  150. DEVICE_PACKAGES := ath11k-firmware-ipq5018 \
  151. kmod-ath11k-pci \
  152. ath11k-firmware-qcn9074 \
  153. ipq-wifi-linksys_spnmx56
  154. endef
  155. TARGET_DEVICES += linksys_spnmx56
  156. define Device/xiaomi_ax6000
  157. $(call Device/FitImage)
  158. $(call Device/UbiFit)
  159. DEVICE_VENDOR := Xiaomi
  160. DEVICE_MODEL := AX6000
  161. BLOCKSIZE := 128k
  162. PAGESIZE := 2048
  163. DEVICE_DTS_CONFIG := [email protected]
  164. SOC := ipq5018
  165. KERNEL_SIZE := 36864k
  166. NAND_SIZE := 128m
  167. DEVICE_PACKAGES := ath11k-firmware-ipq5018 \
  168. kmod-ath11k-pci \
  169. ath11k-firmware-qcn9074 \
  170. kmod-ath10k-ct-smallbuffers \
  171. ath10k-firmware-qca9887-ct \
  172. ipq-wifi-xiaomi_ax6000
  173. ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  174. ARTIFACTS := initramfs-factory.ubi
  175. ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-uImage.itb | ubinize-kernel
  176. endif
  177. endef
  178. TARGET_DEVICES += xiaomi_ax6000
  179. define Device/yuncore_ax830
  180. $(call Device/FitImage)
  181. $(call Device/UbiFit)
  182. DEVICE_VENDOR := Yuncore
  183. DEVICE_MODEL := AX830
  184. BLOCKSIZE := 128k
  185. PAGESIZE := 2048
  186. SOC := ipq5018
  187. DEVICE_DTS_CONFIG := [email protected]
  188. DEVICE_PACKAGES := ath11k-firmware-ipq5018-qcn6122 \
  189. ipq-wifi-yuncore_ax830
  190. endef
  191. TARGET_DEVICES += yuncore_ax830
  192. define Device/yuncore_ax850
  193. $(call Device/FitImage)
  194. $(call Device/UbiFit)
  195. DEVICE_VENDOR := Yuncore
  196. DEVICE_MODEL := AX850
  197. BLOCKSIZE := 128k
  198. PAGESIZE := 2048
  199. SOC := ipq5018
  200. DEVICE_DTS_CONFIG := [email protected]
  201. DEVICE_PACKAGES := ath11k-firmware-ipq5018 \
  202. kmod-ath11k-pci \
  203. ath11k-firmware-qcn9074 \
  204. ipq-wifi-yuncore_ax850
  205. endef
  206. TARGET_DEVICES += yuncore_ax850