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