ipq806x: add support for Nokia Airscale AC400i
[openwrt/openwrt.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:=2023-03-18
10 PKG_SOURCE_VERSION:=86180c4c07330e303edf0afd6c017932903ee080
11 PKG_MIRROR_HASH:=283d6651f8a9088981065d476c01c7c0794279e108a96377468d5fcdc3882a12
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 8dev_habanero \
32 8dev_jalapeno \
33 aruba_ap-365 \
34 buffalo_wxr-5950ax12 \
35 devolo_magic-2-wifi-next \
36 dynalink_dl-wrx36 \
37 edgecore_eap102 \
38 edgecore_ecw5410 \
39 edgecore_oap100 \
40 edimax_cax1800 \
41 extreme-networks_ws-ap3915i \
42 glinet_gl-a1300 \
43 glinet_gl-ap1300 \
44 glinet_gl-s1300 \
45 linksys_ea8300 \
46 linksys_whw03v2 \
47 nokia_ac400i \
48 p2w_r619ac \
49 pakedge_wr-1 \
50 qnap_301w \
51 qxwlan_e2600ac-c1 \
52 qxwlan_e2600ac-c2 \
53 redmi_ax6 \
54 sony_ncp-hg100-cellular \
55 teltonika_rutx \
56 xiaomi_ax3600 \
57 xiaomi_ax9000 \
58 zte_mf18a \
59 zte_mf289f \
60 zyxel_nbg7815
61
62 ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
63
64 define Package/ipq-wifi-default
65 SUBMENU:=ath10k Board-Specific Overrides
66 SECTION:=firmware
67 CATEGORY:=Firmware
68 DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x||TARGET_ipq807x)
69 TITLE:=Custom Board
70 endef
71
72 define ipq-wifi-install-one-to
73 $(INSTALL_DIR) $(2)/lib/firmware/ath10k/$(3)/
74 $(INSTALL_DATA) $(1) $(2)/lib/firmware/ath10k/$(3)/board-2.bin
75 endef
76
77 define ipq-wifi-install-ath11-one-to
78 $(INSTALL_DIR) $(2)/lib/firmware/ath11k/$(3)/
79 $(INSTALL_DATA) $(1) $(2)/lib/firmware/ath11k/$(3)/board-2.bin
80 endef
81
82 define ipq-wifi-install-one
83 $(if $(filter $(suffix $(1)),.QCA4019 .qca4019),\
84 $(call ipq-wifi-install-one-to,$(1),$(2),QCA4019/hw1.0),\
85 $(if $(filter $(suffix $(1)),.QCA9888 .qca9888),\
86 $(call ipq-wifi-install-one-to,$(1),$(2),QCA9888/hw2.0),\
87 $(if $(filter $(suffix $(1)),.QCA9889 .qca9889),\
88 $(call ipq-wifi-install-one-to,$(1),$(2),QCA9887/hw1.0),\
89 $(if $(filter $(suffix $(1)),.QCA9984 .qca9984),\
90 $(call ipq-wifi-install-one-to,$(1),$(2),QCA9984/hw1.0),\
91 $(if $(filter $(suffix $(1)),.QCA99X0 .qca99x0),\
92 $(call ipq-wifi-install-one-to,$(1),$(2),QCA99X0/hw2.0),\
93 $(if $(filter $(suffix $(1)),.IPQ8074 .ipq8074),\
94 $(call ipq-wifi-install-ath11-one-to,$(1),$(2),IPQ8074/hw2.0),\
95 $(if $(filter $(suffix $(1)),.QCN9074 .qcn9074),\
96 $(call ipq-wifi-install-ath11-one-to,$(1),$(2),QCN9074/hw1.0),\
97 $(error Unrecognized board-file suffix '$(suffix $(1))' for '$(1)')\
98 )))))))
99
100 endef
101 # Blank line required at end of above define due to foreach context
102
103 define generate-ipq-wifi-package
104 define Package/ipq-wifi-$(1)
105 $(call Package/ipq-wifi-default)
106 TITLE:=board-2.bin Overrides for $(2)
107 CONFLICTS:=$(PREV_BOARD)
108 endef
109
110 define Package/ipq-wifi-$(1)/description
111 The $(2) requires board-specific, reference ("cal") data
112 that is not yet present in the upstream wireless firmware distribution.
113
114 This package supplies board-2.bin file(s) that, in the interim,
115 overwrite those supplied by the ath10k-firmware-* packages.
116
117 This is package is only necessary for the $(2).
118
119 Do not install it for any other device!
120 endef
121
122 define Package/ipq-wifi-$(1)/install-overlay
123 $$$$(foreach IPQ_WIFI_BOARD_FILE,$$$$(wildcard $(PKG_BUILD_DIR)/board-$(1).*),\
124 $$$$(call ipq-wifi-install-one,$$$$(IPQ_WIFI_BOARD_FILE),$$(1)))
125 endef
126
127 PREV_BOARD+=ipq-wifi-$(1)
128 endef
129
130 # Add board name to ALLWIFIBOARDS
131 # Place files in this directory as board-<devicename>.<qca4019|qca9888|qca9889|qca9984|qca99x0|ipq8074>
132 # Add $(eval $(call generate-ipq-wifi-package,<devicename>,<display name>))
133
134 $(eval $(call generate-ipq-wifi-package,8dev_habanero,8devices Habanero))
135 $(eval $(call generate-ipq-wifi-package,8dev_jalapeno,8devices Jalapeno))
136 $(eval $(call generate-ipq-wifi-package,aruba_ap-365,Aruba AP-365))
137 $(eval $(call generate-ipq-wifi-package,buffalo_wxr-5950ax12,Buffalo WXR-5950AX12))
138 $(eval $(call generate-ipq-wifi-package,devolo_magic-2-wifi-next,devolo Magic 2 WiFi next))
139 $(eval $(call generate-ipq-wifi-package,dynalink_dl-wrx36,Dynalink DL-WRX36))
140 $(eval $(call generate-ipq-wifi-package,edgecore_eap102,Edgecore EAP102))
141 $(eval $(call generate-ipq-wifi-package,edgecore_ecw5410,Edgecore ECW5410))
142 $(eval $(call generate-ipq-wifi-package,edgecore_oap100,Edgecore OAP100))
143 $(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800))
144 $(eval $(call generate-ipq-wifi-package,extreme-networks_ws-ap3915i,Edgecore OAP100))
145 $(eval $(call generate-ipq-wifi-package,glinet_gl-a1300,GL.iNet GL-A1300))
146 $(eval $(call generate-ipq-wifi-package,glinet_gl-ap1300,GL.iNet GL-AP1300))
147 $(eval $(call generate-ipq-wifi-package,glinet_gl-s1300,GL.iNet GL-S1300))
148 $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300))
149 $(eval $(call generate-ipq-wifi-package,linksys_whw03v2,Linksys WHW03 V2))
150 $(eval $(call generate-ipq-wifi-package,nokia_ac400i,Nokia AC400i))
151 $(eval $(call generate-ipq-wifi-package,p2w_r619ac,P&W R619AC))
152 $(eval $(call generate-ipq-wifi-package,pakedge_wr-1,Pakedge WR-1))
153 $(eval $(call generate-ipq-wifi-package,qnap_301w,QNAP 301w))
154 $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac-c1,Qxwlan E2600AC C1))
155 $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac-c2,Qxwlan E2600AC C2))
156 $(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6))
157 $(eval $(call generate-ipq-wifi-package,sony_ncp-hg100-cellular,Sony NCP-HG100/Cellular))
158 $(eval $(call generate-ipq-wifi-package,teltonika_rutx,Teltonika RUTX))
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,zte_mf18a,ZTE MF18A))
162 $(eval $(call generate-ipq-wifi-package,zte_mf289f,ZTE MF289F))
163 $(eval $(call generate-ipq-wifi-package,zyxel_nbg7815,Zyxel NBG7815))
164
165 $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE))))