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