ipq807x: add Dynalink DL-WRX36
[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 PKG_FLAGS:=nonshared
7
8 include $(INCLUDE_DIR)/package.mk
9
10 define Build/Prepare
11 mkdir -p $(PKG_BUILD_DIR)
12 endef
13
14 define Build/Compile
15 endef
16
17 # Use ath10k-bdencoder from https://github.com/qca/qca-swiss-army-knife.git
18 # to generate the board-* files here.
19 #
20 # This is intended to be used on an interim basis until device-specific
21 # board data for new devices is available through the upstream compilation
22 #
23 # Please send a mail with your device-specific board files upstream.
24 # You can find instructions and examples on the linux-wireless wiki:
25 # <https://wireless.wiki.kernel.org/en/users/drivers/ath10k/boardfiles>
26
27 ALLWIFIBOARDS:= \
28 aruba_ap-365 \
29 devolo_magic-2-wifi-next \
30 dynalink_dl-wrx36 \
31 edgecore_eap102 \
32 edgecore_ecw5410 \
33 edgecore_oap100 \
34 edimax_cax1800 \
35 extreme-networks_ws-ap3915i \
36 glinet_gl-a1300 \
37 glinet_gl-ap1300 \
38 glinet_gl-s1300 \
39 linksys_ea8300 \
40 linksys_whw03v2 \
41 p2w_r619ac \
42 pakedge_wr-1 \
43 qnap_301w \
44 qxwlan_e2600ac-c1 \
45 qxwlan_e2600ac-c2 \
46 redmi_ax6 \
47 sony_ncp-hg100-cellular \
48 teltonika_rutx \
49 xiaomi_ax3600 \
50 xiaomi_ax9000 \
51 zte_mf18a \
52 zte_mf289f
53
54 ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
55
56 define Package/ipq-wifi-default
57 SUBMENU:=ath10k Board-Specific Overrides
58 SECTION:=firmware
59 CATEGORY:=Firmware
60 DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x||TARGET_ipq807x)
61 TITLE:=Custom Board
62 endef
63
64 define ipq-wifi-install-one-to
65 $(INSTALL_DIR) $(2)/lib/firmware/ath10k/$(3)/
66 $(INSTALL_DATA) $(1) $(2)/lib/firmware/ath10k/$(3)/board-2.bin
67 endef
68
69 define ipq-wifi-install-ath11-one-to
70 $(INSTALL_DIR) $(2)/lib/firmware/ath11k/$(3)/
71 $(INSTALL_DATA) $(1) $(2)/lib/firmware/ath11k/$(3)/board-2.bin
72 endef
73
74 define ipq-wifi-install-one
75 $(if $(filter $(suffix $(1)),.QCA4019 .qca4019),\
76 $(call ipq-wifi-install-one-to,$(1),$(2),QCA4019/hw1.0),\
77 $(if $(filter $(suffix $(1)),.QCA9888 .qca9888),\
78 $(call ipq-wifi-install-one-to,$(1),$(2),QCA9888/hw2.0),\
79 $(if $(filter $(suffix $(1)),.QCA9889 .qca9889),\
80 $(call ipq-wifi-install-one-to,$(1),$(2),QCA9887/hw1.0),\
81 $(if $(filter $(suffix $(1)),.QCA9984 .qca9984),\
82 $(call ipq-wifi-install-one-to,$(1),$(2),QCA9984/hw1.0),\
83 $(if $(filter $(suffix $(1)),.QCA99X0 .qca99x0),\
84 $(call ipq-wifi-install-one-to,$(1),$(2),QCA99X0/hw2.0),\
85 $(if $(filter $(suffix $(1)),.IPQ8074 .ipq8074),\
86 $(call ipq-wifi-install-ath11-one-to,$(1),$(2),IPQ8074/hw2.0),\
87 $(if $(filter $(suffix $(1)),.QCN9074 .qcn9074),\
88 $(call ipq-wifi-install-ath11-one-to,$(1),$(2),QCN9074/hw1.0),\
89 $(error Unrecognized board-file suffix '$(suffix $(1))' for '$(1)')\
90 )))))))
91
92 endef
93 # Blank line required at end of above define due to foreach context
94
95 define generate-ipq-wifi-package
96 define Package/ipq-wifi-$(1)
97 $(call Package/ipq-wifi-default)
98 TITLE:=board-2.bin Overrides for $(2)
99 CONFLICTS:=$(PREV_BOARD)
100 endef
101
102 define Package/ipq-wifi-$(1)/description
103 The $(2) requires board-specific, reference ("cal") data
104 that is not yet present in the upstream wireless firmware distribution.
105
106 This package supplies board-2.bin file(s) that, in the interim,
107 overwrite those supplied by the ath10k-firmware-* packages.
108
109 This is package is only necessary for the $(2).
110
111 Do not install it for any other device!
112 endef
113
114 define Package/ipq-wifi-$(1)/install-overlay
115 $$$$(foreach IPQ_WIFI_BOARD_FILE,$$$$(wildcard board-$(1).*),\
116 $$$$(call ipq-wifi-install-one,$$$$(IPQ_WIFI_BOARD_FILE),$$(1)))
117 endef
118
119 PREV_BOARD+=ipq-wifi-$(1)
120 endef
121
122 # Add board name to ALLWIFIBOARDS
123 # Place files in this directory as board-<devicename>.<qca4019|qca9888|qca9889|qca9984|qca99x0|ipq8074>
124 # Add $(eval $(call generate-ipq-wifi-package,<devicename>,<display name>))
125
126 $(eval $(call generate-ipq-wifi-package,aruba_ap-365,Aruba AP-365))
127 $(eval $(call generate-ipq-wifi-package,devolo_magic-2-wifi-next,devolo Magic 2 WiFi next))
128 $(eval $(call generate-ipq-wifi-package,dynalink_dl-wrx36,Dynalink DL-WRX36))
129 $(eval $(call generate-ipq-wifi-package,edgecore_eap102,Edgecore EAP102))
130 $(eval $(call generate-ipq-wifi-package,edgecore_ecw5410,Edgecore ECW5410))
131 $(eval $(call generate-ipq-wifi-package,edgecore_oap100,Edgecore OAP100))
132 $(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800))
133 $(eval $(call generate-ipq-wifi-package,extreme-networks_ws-ap3915i,Edgecore OAP100))
134 $(eval $(call generate-ipq-wifi-package,glinet_gl-a1300,GL.iNet GL-A1300))
135 $(eval $(call generate-ipq-wifi-package,glinet_gl-ap1300,GL.iNet GL-AP1300))
136 $(eval $(call generate-ipq-wifi-package,glinet_gl-s1300,GL.iNet GL-S1300))
137 $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300))
138 $(eval $(call generate-ipq-wifi-package,linksys_whw03v2,Linksys WHW03 V2))
139 $(eval $(call generate-ipq-wifi-package,p2w_r619ac,P&W R619AC))
140 $(eval $(call generate-ipq-wifi-package,pakedge_wr-1,Pakedge WR-1))
141 $(eval $(call generate-ipq-wifi-package,qnap_301w,QNAP 301w))
142 $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac-c1,Qxwlan E2600AC C1))
143 $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac-c2,Qxwlan E2600AC C2))
144 $(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6))
145 $(eval $(call generate-ipq-wifi-package,sony_ncp-hg100-cellular,Sony NCP-HG100/Cellular))
146 $(eval $(call generate-ipq-wifi-package,teltonika_rutx,Teltonika RUTX))
147 $(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600))
148 $(eval $(call generate-ipq-wifi-package,xiaomi_ax9000,Xiaomi AX9000))
149 $(eval $(call generate-ipq-wifi-package,zte_mf18a,ZTE MF18A))
150 $(eval $(call generate-ipq-wifi-package,zte_mf289f,ZTE MF289F))
151
152 $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE))))