387b23d5563fd7a276c8ce17ecb527da2ccc7787
[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 8dev_habanero-dvk \
29 aruba_ap-303 \
30 avm_fritzrepeater-1200 \
31 buffalo_wtr-m2133hp \
32 cellc_rtl30vw \
33 dlink_dap2610 \
34 edgecore_ecw5211 \
35 edgecore_ecw5410 \
36 edgecore_oap100 \
37 engenius_eap2200 \
38 engenius_emd1 \
39 engenius_emr3500 \
40 ezviz_cs-w3-wd1200g-eup \
41 glinet_gl-s1300 \
42 linksys_ea8300 \
43 mobipromo_cm520-79f \
44 qxwlan_e2600ac
45
46 ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
47
48 define Package/ipq-wifi-default
49 SUBMENU:=ath10k Board-Specific Overrides
50 SECTION:=firmware
51 CATEGORY:=Firmware
52 DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x)
53 TITLE:=Custom Board
54 endef
55
56 define ipq-wifi-install-one-to
57 $(INSTALL_DIR) $(2)/lib/firmware/ath10k/$(3)/
58 $(INSTALL_DATA) $(1) $(2)/lib/firmware/ath10k/$(3)/board-2.bin
59 endef
60
61 define ipq-wifi-install-one
62 $(if $(filter $(suffix $(1)),.QCA4019 .qca4019),\
63 $(call ipq-wifi-install-one-to,$(1),$(2),QCA4019/hw1.0),\
64 $(if $(filter $(suffix $(1)),.QCA9888 .qca9888),\
65 $(call ipq-wifi-install-one-to,$(1),$(2),QCA9888/hw2.0),\
66 $(if $(filter $(suffix $(1)),.QCA9984 .qca9984),\
67 $(call ipq-wifi-install-one-to,$(1),$(2),QCA9984/hw1.0),\
68 $(error Unrecognized board-file suffix '$(suffix $(1))' for '$(1)')\
69 )))
70
71 endef
72 # Blank line required at end of above define due to foreach context
73
74 define generate-ipq-wifi-package
75 define Package/ipq-wifi-$(1)
76 $(call Package/ipq-wifi-default)
77 TITLE:=board-2.bin Overrides for $(2)
78 CONFLICTS:=$(PREV_BOARD)
79 endef
80
81 define Package/ipq-wifi-$(1)/description
82 The $(2) requires board-specific, reference ("cal") data
83 that is not yet present in the upstream wireless firmware distribution.
84
85 This package supplies board-2.bin file(s) that, in the interim,
86 overwrite those supplied by the ath10k-firmware-* packages.
87
88 This is package is only necessary for the $(2).
89
90 Do not install it for any other device!
91 endef
92
93 define Package/ipq-wifi-$(1)/install-overlay
94 $$$$(foreach IPQ_WIFI_BOARD_FILE,$$$$(wildcard board-$(1).*),\
95 $$$$(call ipq-wifi-install-one,$$$$(IPQ_WIFI_BOARD_FILE),$$(1)))
96 endef
97
98 PREV_BOARD+=ipq-wifi-$(1)
99 endef
100
101 # Add board name to ALLWIFIBOARDS
102 # Place files in this directory as board-<devicename>.<qca4019|qca9888|qca9984>
103 # Add $(eval $(call generate-ipq-wifi-package,<devicename>,<display name>))
104
105 $(eval $(call generate-ipq-wifi-package,8dev_habanero-dvk,8devices Habanero DVK))
106 $(eval $(call generate-ipq-wifi-package,aruba_ap-303,Aruba AP-303))
107 $(eval $(call generate-ipq-wifi-package,avm_fritzrepeater-1200,AVM FRITZRepeater 1200))
108 $(eval $(call generate-ipq-wifi-package,buffalo_wtr-m2133hp,Buffalo WTR-M2133HP))
109 $(eval $(call generate-ipq-wifi-package,cellc_rtl30vw, Cell C RTL30VW))
110 $(eval $(call generate-ipq-wifi-package,dlink_dap2610,D-Link DAP-2610))
111 $(eval $(call generate-ipq-wifi-package,edgecore_ecw5211,Edgecore ECW5211))
112 $(eval $(call generate-ipq-wifi-package,edgecore_ecw5410,Edgecore ECW5410))
113 $(eval $(call generate-ipq-wifi-package,edgecore_oap100,Edgecore OAP100))
114 $(eval $(call generate-ipq-wifi-package,engenius_eap2200,EnGenius EAP2200))
115 $(eval $(call generate-ipq-wifi-package,engenius_emd1,EnGenius EMD1))
116 $(eval $(call generate-ipq-wifi-package,engenius_emr3500,EnGenius EMR3500))
117 $(eval $(call generate-ipq-wifi-package,ezviz_cs-w3-wd1200g-eup,EZVIZ CS-W3-WD1200G EUP))
118 $(eval $(call generate-ipq-wifi-package,glinet_gl-s1300,GL.iNet GL-S1300))
119 $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300))
120 $(eval $(call generate-ipq-wifi-package,mobipromo_cm520-79f,MobiPromo CM520-79F))
121 $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac,Qxwlan E2600AC))
122
123 $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE))))