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