eada8baf6f28275627476d025fa90c90aac670e3
[oweals/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-303 \
29         avm_fritzrepeater-1200 \
30         dlink_dap2610 \
31         engenius_emd1 \
32         ezviz_cs-w3-wd1200g-eup \
33         linksys_ea8300 \
34         qxwlan_e2600ac
35
36 ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
37
38 define Package/ipq-wifi-default
39   SUBMENU:=ath10k Board-Specific Overrides
40   SECTION:=firmware
41   CATEGORY:=Firmware
42   DEPENDS:=@TARGET_ipq40xx
43   TITLE:=Custom Board
44 endef
45
46 define ipq-wifi-install-one-to
47   $(INSTALL_DIR)  $(2)/lib/firmware/ath10k/$(3)/
48   $(INSTALL_DATA) $(1) $(2)/lib/firmware/ath10k/$(3)/board-2.bin
49 endef
50
51 # Note: .bin deprecated; supports existing boards
52
53 define ipq-wifi-install-one
54   $(if $(filter $(suffix $(1)),.QCA4019 .qca4019 .bin),\
55     $(call ipq-wifi-install-one-to,$(1),$(2),QCA4019/hw1.0),\
56   $(if $(filter $(suffix $(1)),.QCA9888 .qca9888),\
57     $(call ipq-wifi-install-one-to,$(1),$(2),QCA9888/hw2.0),\
58   $(if $(filter $(suffix $(1)),.QCA9984 .qca9984),\
59     $(call ipq-wifi-install-one-to,$(1),$(2),QCA9984/hw1.0),\
60     $(error Unrecognized board-file suffix '$(suffix $(1))' for '$(1)')\
61   )))
62
63 endef
64 # Blank line required at end of above define due to foreach context
65
66 define generate-ipq-wifi-package
67   define Package/ipq-wifi-$(1)
68     $(call Package/ipq-wifi-default)
69     TITLE:=board-2.bin Overrides for $(2)
70     CONFLICTS:=$(PREV_BOARD)
71   endef
72
73   define Package/ipq-wifi-$(1)/description
74 The $(2) requires board-specific, reference ("cal") data
75 that is not yet present in the upstream wireless firmware distribution.
76
77 This package supplies board-2.bin file(s) that, in the interim,
78 overwrite those supplied by the ath10k-firmware-* packages.
79
80 This is package is only necessary for the $(2).
81
82 Do not install it for any other device!
83   endef
84
85   define Package/ipq-wifi-$(1)/install-overlay
86     $$$$(foreach IPQ_WIFI_BOARD_FILE,$$$$(wildcard board-$(1).*),\
87       $$$$(call ipq-wifi-install-one,$$$$(IPQ_WIFI_BOARD_FILE),$$(1)))
88   endef
89
90   PREV_BOARD+=ipq-wifi-$(1)
91 endef
92
93 # Add board name to ALLWIFIBOARDS
94 # Place files in this directory as board-<devicename>.<qca4019|qca9888|qca9984>
95 # Add $(eval $(call generate-ipq-wifi-package,<devicename>,<display name>))
96
97 $(eval $(call generate-ipq-wifi-package,aruba_ap-303,Aruba AP-303))
98 $(eval $(call generate-ipq-wifi-package,avm_fritzrepeater-1200,AVM FRITZRepeater 1200))
99 $(eval $(call generate-ipq-wifi-package,dlink_dap2610,D-Link DAP-2610))
100 $(eval $(call generate-ipq-wifi-package,engenius_emd1,EnGenius EMD1))
101 $(eval $(call generate-ipq-wifi-package,ezviz_cs-w3-wd1200g-eup,EZVIZ CS-W3-WD1200G EUP))
102 $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300))
103 $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac,Qxwlan E2600AC))
104
105 $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE))))