bmips: dgnd3700v2: fix network config
[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 devolo_magic-2-wifi-next \
29 edgecore_ecw5410 \
30 edgecore_oap100 \
31 glinet_gl-ap1300 \
32 glinet_gl-b2200 \
33 glinet_gl-s1300 \
34 linksys_ea8300 \
35 p2w_r619ac \
36 qxwlan_e2600ac-c1 \
37 qxwlan_e2600ac-c2 \
38 teltonika_rutx
39
40 ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
41
42 define Package/ipq-wifi-default
43 SUBMENU:=ath10k Board-Specific Overrides
44 SECTION:=firmware
45 CATEGORY:=Firmware
46 DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x)
47 TITLE:=Custom Board
48 endef
49
50 define ipq-wifi-install-one-to
51 $(INSTALL_DIR) $(2)/lib/firmware/ath10k/$(3)/
52 $(INSTALL_DATA) $(1) $(2)/lib/firmware/ath10k/$(3)/board-2.bin
53 endef
54
55 define ipq-wifi-install-one
56 $(if $(filter $(suffix $(1)),.QCA4019 .qca4019),\
57 $(call ipq-wifi-install-one-to,$(1),$(2),QCA4019/hw1.0),\
58 $(if $(filter $(suffix $(1)),.QCA9888 .qca9888),\
59 $(call ipq-wifi-install-one-to,$(1),$(2),QCA9888/hw2.0),\
60 $(if $(filter $(suffix $(1)),.QCA9984 .qca9984),\
61 $(call ipq-wifi-install-one-to,$(1),$(2),QCA9984/hw1.0),\
62 $(error Unrecognized board-file suffix '$(suffix $(1))' for '$(1)')\
63 )))
64
65 endef
66 # Blank line required at end of above define due to foreach context
67
68 define generate-ipq-wifi-package
69 define Package/ipq-wifi-$(1)
70 $(call Package/ipq-wifi-default)
71 TITLE:=board-2.bin Overrides for $(2)
72 CONFLICTS:=$(PREV_BOARD)
73 endef
74
75 define Package/ipq-wifi-$(1)/description
76 The $(2) requires board-specific, reference ("cal") data
77 that is not yet present in the upstream wireless firmware distribution.
78
79 This package supplies board-2.bin file(s) that, in the interim,
80 overwrite those supplied by the ath10k-firmware-* packages.
81
82 This is package is only necessary for the $(2).
83
84 Do not install it for any other device!
85 endef
86
87 define Package/ipq-wifi-$(1)/install-overlay
88 $$$$(foreach IPQ_WIFI_BOARD_FILE,$$$$(wildcard board-$(1).*),\
89 $$$$(call ipq-wifi-install-one,$$$$(IPQ_WIFI_BOARD_FILE),$$(1)))
90 endef
91
92 PREV_BOARD+=ipq-wifi-$(1)
93 endef
94
95 # Add board name to ALLWIFIBOARDS
96 # Place files in this directory as board-<devicename>.<qca4019|qca9888|qca9984>
97 # Add $(eval $(call generate-ipq-wifi-package,<devicename>,<display name>))
98
99 $(eval $(call generate-ipq-wifi-package,devolo_magic-2-wifi-next,devolo Magic 2 WiFi next))
100 $(eval $(call generate-ipq-wifi-package,edgecore_ecw5410,Edgecore ECW5410))
101 $(eval $(call generate-ipq-wifi-package,edgecore_oap100,Edgecore OAP100))
102 $(eval $(call generate-ipq-wifi-package,glinet_gl-ap1300,GL.iNet GL-AP1300))
103 $(eval $(call generate-ipq-wifi-package,glinet_gl-b2200,GL.iNet GL-B2200))
104 $(eval $(call generate-ipq-wifi-package,glinet_gl-s1300,GL.iNet GL-S1300))
105 $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300))
106 $(eval $(call generate-ipq-wifi-package,p2w_r619ac,P&W R619AC))
107 $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac-c1,Qxwlan E2600AC C1))
108 $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac-c2,Qxwlan E2600AC C2))
109 $(eval $(call generate-ipq-wifi-package,teltonika_rutx,Teltonika RUTX))
110
111 $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE))))