922064b7f78b80670cdb1ec7e9f86ede224cb7fb
[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 #
18 # This is intended to be used on an interim basis until device-specific
19 # board data for new devices is available through the upstream compilation
20 #
21 # Please send a mail with your device-specific board files upstream.
22 # You can find instructions and examples on the linux-wireless wiki:
23 # <https://wireless.wiki.kernel.org/en/users/drivers/ath10k/boardfiles>
24 #
25
26 ALLWIFIBOARDS:= \
27 alfa-network_ap120c-ac \
28 asus_map-ac2200 \
29 avm_fritzbox-7530 \
30 avm_fritzrepeater-3000 \
31 engenius_eap1300 \
32 engenius_ens620ext \
33 linksys_ea6350v3 \
34 linksys_ea8300 \
35 qxwlan_e2600ac
36
37 ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
38
39 define Package/ipq-wifi-default
40 SUBMENU:=ath10k Board-Specific Overrides
41 SECTION:=firmware
42 CATEGORY:=Firmware
43 DEPENDS:=@TARGET_ipq40xx
44 TITLE:=Custom Board
45 endef
46
47 define ipq-wifi-install-one-to
48 $(INSTALL_DIR) $(2)/lib/firmware/ath10k/$(3)/
49 $(INSTALL_DATA) $(1) $(2)/lib/firmware/ath10k/$(3)/board-2.bin
50 endef
51
52 # Note: .bin deprecated; supports existing boards
53
54 define ipq-wifi-install-one
55 $(if $(filter $(suffix $(1)),.QCA4019 .qca4019 .bin),\
56 $(call ipq-wifi-install-one-to,$(1),$(2),QCA4019/hw1.0),\
57 $(if $(filter $(suffix $(1)),.QCA9888 .qca9888),\
58 $(call ipq-wifi-install-one-to,$(1),$(2),QCA9888/hw2.0),\
59 $(if $(filter $(suffix $(1)),.QCA9984 .qca9984),\
60 $(call ipq-wifi-install-one-to,$(1),$(2),QCA9984/hw1.0),\
61 $(error Unrecognized board-file suffix '$(suffix $(1))' for '$(1)')\
62 )))
63
64 endef
65 # Blank line required at end of above define due to foreach context
66
67 define generate-ipq-wifi-package
68 define Package/ipq-wifi-$(1)
69 $(call Package/ipq-wifi-default)
70 TITLE:=board-2.bin Overrides for $(2)
71 CONFLICTS:=$(PREV_BOARD)
72 endef
73
74 define Package/ipq-wifi-$(1)/description
75 The $(2) requires board-specific, reference ("cal") data
76 that is not yet present in the upstream wireless firmware distribution.
77
78 This package supplies board-2.bin file(s) that, in the interim,
79 overwrite those supplied by the ath10k-firmware-* packages.
80
81 This is package is only necessary for the $(2).
82
83 Do not install it for any other device!
84 endef
85
86 define Package/ipq-wifi-$(1)/install-overlay
87 $$$$(foreach IPQ_WIFI_BOARD_FILE,$$$$(wildcard board-$(1).*),\
88 $$$$(call ipq-wifi-install-one,$$$$(IPQ_WIFI_BOARD_FILE),$$(1)))
89 endef
90
91 PREV_BOARD+=ipq-wifi-$(1)
92 endef
93
94 # Add board name to ALLWIFIBOARDS
95 # Place files in this directory as board-<devicename>.<qca4019|qca9888|qca9984>
96 # Add $(eval $(call generate-ipq-wifi-package,<devicename>,<display name>))
97
98 $(eval $(call generate-ipq-wifi-package,alfa-network_ap120c-ac,ALFA Network AP120C-AC))
99 $(eval $(call generate-ipq-wifi-package,asus_map-ac2200,ASUS MAP-AC2200))
100 $(eval $(call generate-ipq-wifi-package,avm_fritzbox-7530,AVM FRITZ!Box 7530))
101 $(eval $(call generate-ipq-wifi-package,avm_fritzrepeater-3000,AVM FRITZ!Repeater 3000))
102 $(eval $(call generate-ipq-wifi-package,engenius_eap1300,EnGenius EAP1300))
103 $(eval $(call generate-ipq-wifi-package,engenius_ens620ext,EnGenius ENS620EXT))
104 $(eval $(call generate-ipq-wifi-package,linksys_ea6350v3,Linksys EA6350v3))
105 $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300))
106 $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac,Qxwlan E2600AC))
107
108 $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE))))