ath79: update WA/XC devices UBNT_VERSION to 8.7.4
[openwrt/staging/wigyori.git] / package / firmware / ipq-wifi / Makefile
1 include $(TOPDIR)/rules.mk
2 include $(INCLUDE_DIR)/version.mk
3
4 PKG_NAME:=ipq-wifi
5 PKG_RELEASE:=1
6
7 PKG_SOURCE_PROTO:=git
8 PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
9 PKG_SOURCE_DATE:=2024-01-06
10 PKG_SOURCE_VERSION:=71f45cff8944405b7cc2bf5c19df2bd8fe7f2421
11 PKG_MIRROR_HASH:=90c3c1659c54cdb4685d0a71633746c1000230e459801eb8ce12c805a994cc37
12
13 PKG_FLAGS:=nonshared
14
15 include $(INCLUDE_DIR)/package.mk
16
17 define Build/Compile
18 endef
19
20 # Use ath10k-bdencoder from https://github.com/qca/qca-swiss-army-knife.git
21 # to generate the board-* files here.
22 #
23 # This is intended to be used on an interim basis until device-specific
24 # board data for new devices is available through the upstream compilation
25 #
26 # Please send a mail with your device-specific board files upstream.
27 # You can find instructions and examples on the linux-wireless wiki:
28 # <https://wireless.wiki.kernel.org/en/users/drivers/ath10k/boardfiles>
29
30 ALLWIFIBOARDS:= \
31 arcadyan_aw1000 \
32 buffalo_wxr-5950ax12 \
33 cmcc_rm2-6 \
34 compex_wpq873 \
35 dynalink_dl-wrx36 \
36 edgecore_eap102 \
37 edimax_cax1800 \
38 linksys_mx4200 \
39 netgear_rax120v2 \
40 netgear_wax218 \
41 netgear_wax620 \
42 netgear_wax630 \
43 prpl_haze \
44 qnap_301w \
45 redmi_ax6 \
46 wallys_dr40x9 \
47 xiaomi_ax3600 \
48 xiaomi_ax9000 \
49 yyets_le1 \
50 yuncore_ax880 \
51 zte_mf269 \
52 zte_mf289f \
53 zte_mf287 \
54 zte_mf287plus \
55 zyxel_nbg7815
56
57 ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
58
59 define Package/ipq-wifi-default
60 SUBMENU:=ath10k Board-Specific Overrides
61 SECTION:=firmware
62 CATEGORY:=Firmware
63 DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x||TARGET_qualcommax)
64 TITLE:=Custom Board
65 endef
66
67 define ipq-wifi-install-one-to
68 $(INSTALL_DIR) $(2)/lib/firmware/ath10k/$(3)/
69 $(INSTALL_DATA) $(1) $(2)/lib/firmware/ath10k/$(3)/board-2.bin
70 endef
71
72 define ipq-wifi-install-ath11-one-to
73 $(INSTALL_DIR) $(2)/lib/firmware/ath11k/$(3)/
74 $(INSTALL_DATA) $(1) $(2)/lib/firmware/ath11k/$(3)/board-2.bin
75 endef
76
77 define ipq-wifi-install-one
78 $(if $(filter $(suffix $(1)),.QCA4019 .qca4019),\
79 $(call ipq-wifi-install-one-to,$(1),$(2),QCA4019/hw1.0),\
80 $(if $(filter $(suffix $(1)),.QCA9888 .qca9888),\
81 $(call ipq-wifi-install-one-to,$(1),$(2),QCA9888/hw2.0),\
82 $(if $(filter $(suffix $(1)),.QCA9889 .qca9889),\
83 $(call ipq-wifi-install-one-to,$(1),$(2),QCA9887/hw1.0),\
84 $(if $(filter $(suffix $(1)),.QCA9984 .qca9984),\
85 $(call ipq-wifi-install-one-to,$(1),$(2),QCA9984/hw1.0),\
86 $(if $(filter $(suffix $(1)),.QCA99X0 .qca99x0),\
87 $(call ipq-wifi-install-one-to,$(1),$(2),QCA99X0/hw2.0),\
88 $(if $(filter $(suffix $(1)),.IPQ8074 .ipq8074 .ipq8174),\
89 $(call ipq-wifi-install-ath11-one-to,$(1),$(2),IPQ8074/hw2.0),\
90 $(if $(filter $(suffix $(1)),.QCN9074 .qcn9074),\
91 $(call ipq-wifi-install-ath11-one-to,$(1),$(2),QCN9074/hw1.0),\
92 $(error Unrecognized board-file suffix '$(suffix $(1))' for '$(1)')\
93 )))))))
94
95 endef
96 # Blank line required at end of above define due to foreach context
97
98 define generate-ipq-wifi-package
99 define Package/ipq-wifi-$(1)
100 $(call Package/ipq-wifi-default)
101 TITLE:=board-2.bin Overrides for $(2)
102 CONFLICTS:=$(PREV_BOARD)
103 endef
104
105 define Package/ipq-wifi-$(1)/description
106 The $(2) requires board-specific, reference ("cal") data
107 that is not yet present in the upstream wireless firmware distribution.
108
109 This package supplies board-2.bin file(s) that, in the interim,
110 overwrite those supplied by the ath10k-firmware-* packages.
111
112 This is package is only necessary for the $(2).
113
114 Do not install it for any other device!
115 endef
116
117 define Package/ipq-wifi-$(1)/install-overlay
118 $$$$(foreach IPQ_WIFI_BOARD_FILE,$$$$(wildcard $(PKG_BUILD_DIR)/board-$(1).*),\
119 $$$$(call ipq-wifi-install-one,$$$$(IPQ_WIFI_BOARD_FILE),$$(1)))
120 endef
121
122 PREV_BOARD+=ipq-wifi-$(1)
123 endef
124
125 # To add local files for testing:
126 # 1. create a new directory in the ipq-wifi package directory called "files".
127 # 2. place there the needed board files.
128 #
129 # To send a board file upstream:
130 # 1. create a pull request in https://github.com/openwrt/firmware_qca-wireless or
131 # send a patch to the mailing list adding the tag firmware/qca-wireless before
132 # the PATCH tag.
133 # 2. create a pull request in the main openwrt repository bumping the ipq-wifi
134 # package to the new version and adding the required lines to add the board file.
135 #
136 # Changes needed to the ipq-wifi Makefile:
137 # 1. Add board name to ALLWIFIBOARDS
138 # 2. Add $(eval $(call generate-ipq-wifi-package,<devicename>,<display name>))
139 #
140 # Board files should follow this name structure:
141 # board-<devicename>.<qca4019|qca9888|qca9889|qca9984|qca99x0|ipq8074>
142
143 $(eval $(call generate-ipq-wifi-package,arcadyan_aw1000,Arcadyan AW1000))
144 $(eval $(call generate-ipq-wifi-package,buffalo_wxr-5950ax12,Buffalo WXR-5950AX12))
145 $(eval $(call generate-ipq-wifi-package,cmcc_rm2-6,CMCC RM2-6))
146 $(eval $(call generate-ipq-wifi-package,compex_wpq873,Compex WPQ-873))
147 $(eval $(call generate-ipq-wifi-package,dynalink_dl-wrx36,Dynalink DL-WRX36))
148 $(eval $(call generate-ipq-wifi-package,edgecore_eap102,Edgecore EAP102))
149 $(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800))
150 $(eval $(call generate-ipq-wifi-package,linksys_mx4200,Linksys MX4200))
151 $(eval $(call generate-ipq-wifi-package,netgear_rax120v2,Netgear RAX120v2))
152 $(eval $(call generate-ipq-wifi-package,netgear_wax218,Netgear WAX218))
153 $(eval $(call generate-ipq-wifi-package,netgear_wax620,Netgear WAX620))
154 $(eval $(call generate-ipq-wifi-package,netgear_wax630,Netgear WAX630))
155 $(eval $(call generate-ipq-wifi-package,qnap_301w,QNAP 301w))
156 $(eval $(call generate-ipq-wifi-package,prpl_haze,prpl Haze))
157 $(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6))
158 $(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9))
159 $(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600))
160 $(eval $(call generate-ipq-wifi-package,xiaomi_ax9000,Xiaomi AX9000))
161 $(eval $(call generate-ipq-wifi-package,yyets_le1,YYeTs LE1))
162 $(eval $(call generate-ipq-wifi-package,yuncore_ax880,Yuncore AX880))
163 $(eval $(call generate-ipq-wifi-package,zte_mf269,ZTE MF269))
164 $(eval $(call generate-ipq-wifi-package,zte_mf289f,ZTE MF289F))
165 $(eval $(call generate-ipq-wifi-package,zte_mf287,ZTE MF287))
166 $(eval $(call generate-ipq-wifi-package,zte_mf287plus,ZTE MF287Plus))
167 $(eval $(call generate-ipq-wifi-package,zyxel_nbg7815,Zyxel NBG7815))
168
169 $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE))))