ath79: update WA/XC devices UBNT_VERSION to 8.7.4
[openwrt/staging/wigyori.git] / package / kernel / mac80211 / broadcom.mk
1 PKG_DRIVERS += \
2 b43 brcmsmac brcmfmac brcmutil
3
4 PKG_CONFIG_DEPENDS += \
5 CONFIG_PACKAGE_B43_DEBUG \
6 CONFIG_PACKAGE_B43_PIO \
7 CONFIG_PACKAGE_B43_PHY_G \
8 CONFIG_PACKAGE_B43_PHY_N \
9 CONFIG_PACKAGE_B43_PHY_LP \
10 CONFIG_PACKAGE_B43_PHY_HT \
11 CONFIG_PACKAGE_B43_BUSES_BCMA_AND_SSB \
12 CONFIG_PACKAGE_B43_BUSES_BCMA \
13 CONFIG_PACKAGE_B43_BUSES_SSB \
14 CONFIG_PACKAGE_BRCM80211_DEBUG
15
16 config-$(call config_package,b43) += B43
17 config-$(CONFIG_PACKAGE_B43_BUSES_BCMA_AND_SSB) += B43_BUSES_BCMA_AND_SSB
18 config-$(CONFIG_PACKAGE_B43_BUSES_BCMA) += B43_BUSES_BCMA
19 config-$(CONFIG_PACKAGE_B43_BUSES_SSB) += B43_BUSES_SSB
20 config-$(CONFIG_PACKAGE_B43_PHY_G) += B43_PHY_G
21 config-$(CONFIG_PACKAGE_B43_PHY_N) += B43_PHY_N
22 config-$(CONFIG_PACKAGE_B43_PHY_LP) += B43_PHY_LP
23 config-$(CONFIG_PACKAGE_B43_PHY_HT) += B43_PHY_HT
24 config-$(CONFIG_PACKAGE_B43_PIO) += B43_PIO
25 config-$(CONFIG_PACKAGE_B43_DEBUG) += B43_DEBUG
26
27 config-$(call config_package,brcmutil) += BRCMUTIL
28 config-$(call config_package,brcmsmac) += BRCMSMAC
29 config-$(call config_package,brcmfmac) += BRCMFMAC
30 config-$(CONFIG_BRCMFMAC_SDIO) += BRCMFMAC_SDIO
31 config-$(CONFIG_BRCMFMAC_USB) += BRCMFMAC_USB
32 config-$(CONFIG_BRCMFMAC_PCIE) += BRCMFMAC_PCIE
33 config-$(CONFIG_PACKAGE_BRCM80211_DEBUG) += BRCMDBG
34
35 config-$(CONFIG_LEDS_TRIGGERS) += B43_LEDS B43LEGACY_LEDS
36
37 #Broadcom firmware
38 ifneq ($(CONFIG_B43_FW_6_30),)
39 PKG_B43_FWV4_NAME:=broadcom-wl
40 PKG_B43_FWV4_VERSION:=6.30.163.46
41 PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).wl_apsta.o
42 PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
43 PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
44 PKG_B43_FWV4_HASH:=a07c3b6b277833c7dbe61daa511f908cd66c5e2763eb7a0859abc36cd9335c2d
45 else
46 ifneq ($(CONFIG_B43_FW_5_10),)
47 PKG_B43_FWV4_NAME:=broadcom-wl
48 PKG_B43_FWV4_VERSION:=5.10.56.27.3
49 PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta/wl_prebuilt.o
50 PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)_mipsel.tar.bz2
51 PKG_B43_FWV4_SOURCE_URL:=@OPENWRT
52 PKG_B43_FWV4_HASH:=26a8c370f48fc129d0731cfd751c36cae1419b0bc8ca35781126744e60eae009
53 else
54 ifneq ($(CONFIG_B43_FW_4_178),)
55 PKG_B43_FWV4_NAME:=broadcom-wl
56 PKG_B43_FWV4_VERSION:=4.178.10.4
57 PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o
58 PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
59 PKG_B43_FWV4_SOURCE_URL:=@OPENWRT
60 PKG_B43_FWV4_HASH:=32f6ad98facbb9045646fdc8b54bb03086d204153253f9c65d0234a5d90ae53f
61 else
62 ifneq ($(CONFIG_B43_FW_5_100_138),)
63 PKG_B43_FWV4_NAME:=broadcom-wl
64 PKG_B43_FWV4_VERSION:=5.100.138
65 PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o
66 PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
67 PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
68 PKG_B43_FWV4_HASH:=f1e7067aac5b62b67b8b6e4c517990277804339ac16065eb13c731ff909ae46f
69 else
70 PKG_B43_FWV4_NAME:=broadcom-wl
71 PKG_B43_FWV4_VERSION:=4.150.10.5
72 PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta_mimo.o
73 PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
74 PKG_B43_FWV4_SOURCE_URL:=@OPENWRT
75 PKG_B43_FWV4_HASH:=a9f4e276a4d8d3a1cd0f2eb87080ae89b77f0a7140f06d4e9e2135fc44fdd533
76 endif
77 endif
78 endif
79 endif
80 ifneq ($(CONFIG_B43_OPENFIRMWARE),)
81 PKG_B43_FWV4_NAME:=broadcom-wl
82 PKG_B43_FWV4_VERSION:=5.2
83 PKG_B43_FWV4_OBJECT:=openfwwf-$(PKG_B43_FWV4_VERSION)
84 PKG_B43_FWV4_SOURCE:=openfwwf-$(PKG_B43_FWV4_VERSION).tar.gz
85 PKG_B43_FWV4_SOURCE_URL:=http://netweb.ing.unibs.it/~openfwwf/firmware
86 PKG_B43_FWV4_HASH:=9de03320083201080b2e94b81637ac07a159cf4e6f3481383e1a217e627bc0dc
87 endif
88
89
90 define Download/b43
91 FILE:=$(PKG_B43_FWV4_SOURCE)
92 URL:=$(PKG_B43_FWV4_SOURCE_URL)
93 HASH:=$(PKG_B43_FWV4_HASH)
94 endef
95 $(eval $(call Download,b43))
96
97 define KernelPackage/b43
98 $(call KernelPackage/mac80211/Default)
99 TITLE:=Broadcom 43xx wireless support
100 URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43
101 KCONFIG:= \
102 CONFIG_HW_RANDOM=y
103 # Depend on PCI_SUPPORT to make sure we can select kmod-bcma or kmod-ssb
104 DEPENDS += \
105 @PCI_SUPPORT +kmod-mac80211 +kmod-lib-cordic \
106 $(if $(CONFIG_PACKAGE_B43_USE_SSB),+kmod-ssb) \
107 $(if $(CONFIG_PACKAGE_B43_USE_BCMA),+kmod-bcma)
108 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/b43/b43.ko
109 AUTOLOAD:=$(call AutoProbe,b43)
110 MENU:=1
111 endef
112
113 define KernelPackage/b43/config
114
115 config PACKAGE_B43_USE_SSB
116 select PACKAGE_kmod-ssb
117 tristate
118 depends on !TARGET_bcm47xx && !TARGET_bcm63xx
119 default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB
120 default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_SSB
121
122 config PACKAGE_B43_USE_BCMA
123 select PACKAGE_kmod-bcma
124 tristate
125 depends on !TARGET_bcm47xx && !TARGET_bcm53xx
126 default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB
127 default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA
128
129 if PACKAGE_kmod-b43
130
131 choice
132 prompt "b43 firmware version"
133 default B43_FW_5_100_138
134 help
135 This option allows you to select the version of the b43 firmware.
136
137 config B43_FW_4_150
138 bool "Firmware 410.2160 from driver 4.150.10.5 (old stable)"
139 help
140 Old stable firmware for BCM43xx devices.
141
142 If unsure, select this.
143
144 config B43_FW_4_178
145 bool "Firmware 478.104 from driver 4.178.10.4"
146 help
147 Older firmware for BCM43xx devices.
148
149 If unsure, select the "stable" firmware.
150
151 config B43_FW_5_10
152 bool "Firmware 508.1084 from driver 5.10.56.27"
153 help
154 Older firmware for BCM43xx devices.
155
156 If unsure, select the "stable" firmware.
157
158 config B43_FW_5_100_138
159 bool "Firmware 666.2 from driver 5.100.138 (stable)"
160 help
161 The currently default firmware for BCM43xx devices.
162
163 This firmware currently gets most of the testing and is needed for some N-PHY devices.
164
165 If unsure, select the this firmware.
166
167 config B43_FW_6_30
168 bool "Firmware 784.2 from driver 6.30.163.46 (experimental)"
169 help
170 Newer experimental firmware for BCM43xx devices.
171
172 This firmware is mostly untested.
173
174 If unsure, select the "stable" firmware.
175
176 config B43_OPENFIRMWARE
177 bool "Open FirmWare for WiFi networks"
178 help
179 Opensource firmware for BCM43xx devices.
180
181 Do _not_ select this, unless you know what you are doing.
182 The Opensource firmware is not suitable for embedded devices, yet.
183 It does not support QoS, which is bad for AccessPoints.
184 It does not support hardware crypto acceleration, which is a showstopper
185 for embedded devices with low CPU resources.
186
187 If unsure, select the "stable" firmware.
188
189 endchoice
190
191 config B43_FW_SQUASH
192 bool "Remove unnecessary firmware files"
193 depends on !B43_OPENFIRMWARE
194 default y
195 help
196 This options allows you to remove unnecessary b43 firmware files
197 from the final rootfs image. This can reduce the rootfs size by
198 up to 200k.
199
200 If unsure, say Y.
201
202 config B43_FW_SQUASH_COREREVS
203 string "Core revisions to include"
204 depends on B43_FW_SQUASH
205 default "5,6,7,8,9,10,11,13,15" if TARGET_bcm47xx_legacy
206 default "16,28,29,30" if TARGET_bcm47xx_mips74k
207 default "5,6,7,8,9,10,11,13,15,16,28,29,30"
208 help
209 This is a comma separated list of core revision numbers.
210
211 Example (keep files for rev5 only):
212 5
213
214 Example (keep files for rev5 and rev11):
215 5,11
216
217 config B43_FW_SQUASH_PHYTYPES
218 string "PHY types to include"
219 depends on B43_FW_SQUASH
220 default "G,N,LP" if TARGET_bcm47xx_legacy
221 default "N,HT" if TARGET_bcm47xx_mips74k
222 default "G,N,LP,HT"
223 help
224 This is a comma separated list of PHY types:
225 A => A-PHY
226 AG => Dual A-PHY G-PHY
227 G => G-PHY
228 LP => LP-PHY
229 N => N-PHY
230 HT => HT-PHY
231 LCN => LCN-PHY
232 LCN40 => LCN40-PHY
233 AC => AC-PHY
234
235 Example (keep files for G-PHY only):
236 G
237
238 Example (keep files for G-PHY and N-PHY):
239 G,N
240
241 choice
242 prompt "Supported buses"
243 default PACKAGE_B43_BUSES_BCMA_AND_SSB
244 help
245 This allows choosing buses that b43 should support.
246
247 config PACKAGE_B43_BUSES_BCMA_AND_SSB
248 depends on !TARGET_bcm47xx_legacy && !TARGET_bcm47xx_mips74k && !TARGET_bcm53xx && !TARGET_bmips
249 bool "BCMA and SSB"
250
251 config PACKAGE_B43_BUSES_BCMA
252 depends on !TARGET_bcm47xx_legacy && !TARGET_bmips_bcm6358 && !TARGET_bmips_bcm6368
253 bool "BCMA only"
254
255 config PACKAGE_B43_BUSES_SSB
256 depends on !TARGET_bcm47xx_mips74k && !TARGET_bcm53xx
257 bool "SSB only"
258
259 endchoice
260
261 config PACKAGE_B43_DEBUG
262 bool "Enable debug output and debugfs for b43"
263 default n
264 help
265 Enable additional debug output and runtime sanity checks for b43
266 and enables the debugfs interface.
267
268 If unsure, say N.
269
270 config PACKAGE_B43_PIO
271 bool "Enable support for PIO transfer mode"
272 default n
273 help
274 Enable support for using PIO instead of DMA. Unless you have DMA
275 transfer problems you don't need this.
276
277 If unsure, say N.
278
279 config PACKAGE_B43_PHY_G
280 bool "Enable support for G-PHYs"
281 default n if TARGET_bcm47xx_mips74k
282 default y
283 help
284 Enable support for G-PHY. This includes support for the following devices:
285 PCI: BCM4306, BCM4311, BCM4318
286 SoC: BCM5352E, BCM4712
287
288 If unsure, say Y.
289
290 config PACKAGE_B43_PHY_N
291 bool "Enable support for N-PHYs"
292 default y
293 help
294 Enable support for N-PHY. This includes support for the following devices:
295 PCI: BCM4321, BCM4322, BCM43222, BCM43224, BCM43225
296 SoC: BCM4716, BCM4717, BCM4718
297
298 Currently only 11g speed is available.
299
300 If unsure, say Y.
301
302 config PACKAGE_B43_PHY_LP
303 bool "Enable support for LP-PHYs"
304 default n if TARGET_bcm47xx_mips74k
305 default y
306 help
307 Enable support for LP-PHY. This includes support for the following devices:
308 PCI: BCM4312
309 SoC: BCM5354
310
311 If unsure, say Y.
312
313 config PACKAGE_B43_PHY_HT
314 bool "Enable support for HT-PHYs"
315 default n if TARGET_bcm47xx_legacy
316 default y
317 help
318 Enable support for HT-PHY. This includes support for the following devices:
319 PCI: BCM4331
320
321 Currently only 11g speed is available.
322
323 If unsure, say Y.
324
325 config PACKAGE_B43_PHY_LCN
326 bool "Enable support for LCN-PHYs"
327 depends on BROKEN
328 default n
329 help
330 Currently broken.
331
332 If unsure, say N.
333
334 endif
335 endef
336
337 define KernelPackage/b43/description
338 Kernel module for Broadcom 43xx wireless support (mac80211 stack) new
339 endef
340
341 define KernelPackage/brcmutil
342 $(call KernelPackage/mac80211/Default)
343 TITLE:=Broadcom IEEE802.11n common driver parts
344 URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
345 DEPENDS+=@PCI_SUPPORT||USB_SUPPORT
346 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmutil/brcmutil.ko
347 AUTOLOAD:=$(call AutoProbe,brcmutil)
348 MENU:=1
349 endef
350
351 define KernelPackage/brcmutil/description
352 This module contains some common parts needed by Broadcom Wireless drivers brcmsmac and brcmfmac.
353 endef
354
355 define KernelPackage/brcmutil/config
356 if PACKAGE_kmod-brcmutil
357
358 config PACKAGE_BRCM80211_DEBUG
359 bool "Broadcom wireless driver debugging"
360 help
361 Say Y, if you want to debug brcmsmac and brcmfmac wireless driver.
362
363 endif
364 endef
365
366 PKG_BRCMSMAC_FW_NAME:=broadcom-wl
367 PKG_BRCMSMAC_FW_VERSION:=5.100.138
368 PKG_BRCMSMAC_FW_OBJECT:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION)/linux/wl_apsta.o
369 PKG_BRCMSMAC_FW_SOURCE:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION).tar.bz2
370 PKG_BRCMSMAC_FW_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
371 PKG_BRCMSMAC_FW_HASH:=f1e7067aac5b62b67b8b6e4c517990277804339ac16065eb13c731ff909ae46f
372
373 define Download/brcmsmac
374 FILE:=$(PKG_BRCMSMAC_FW_SOURCE)
375 URL:=$(PKG_BRCMSMAC_FW_SOURCE_URL)
376 HASH:=$(PKG_BRCMSMAC_FW_HASH)
377 endef
378 $(eval $(call Download,brcmsmac))
379
380 define KernelPackage/brcmsmac
381 $(call KernelPackage/mac80211/Default)
382 TITLE:=Broadcom IEEE802.11n PCIe SoftMAC WLAN driver
383 URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
384 DEPENDS+=@!TARGET_bcm47xx_legacy +kmod-mac80211 +!TARGET_bcm47xx:kmod-bcma +kmod-lib-cordic +kmod-lib-crc8 +kmod-brcmutil +!BRCMSMAC_USE_FW_FROM_WL:brcmsmac-firmware
385 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmsmac/brcmsmac.ko
386 AUTOLOAD:=$(call AutoProbe,brcmsmac)
387 MENU:=1
388 endef
389
390 define KernelPackage/brcmsmac/description
391 Kernel module for Broadcom IEEE802.11n PCIe Wireless cards
392 endef
393
394 define KernelPackage/brcmsmac/config
395 if PACKAGE_kmod-brcmsmac
396
397 config BRCMSMAC_USE_FW_FROM_WL
398 bool "Use firmware extracted from broadcom proprietary driver"
399 default y
400 help
401 Instead of using the official brcmsmac firmware a firmware
402 version 666.2 extracted from the proprietary Broadcom driver
403 is used. This is needed to get core rev 17 used in bcm4716
404 to work.
405
406 If unsure, say Y.
407
408 endif
409 endef
410
411
412 define KernelPackage/brcmfmac
413 $(call KernelPackage/mac80211/Default)
414 TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver
415 URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
416 DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +@DRIVER_11AC_SUPPORT \
417 +kmod-brcmutil +BRCMFMAC_SDIO:kmod-mmc @!TARGET_uml \
418 +BRCMFMAC_USB:kmod-usb-core +BRCMFMAC_USB:brcmfmac-firmware-usb
419 FILES:= \
420 $(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko \
421 $(foreach type,bca cyw wcc, \
422 $(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/$(type)/brcmfmac-$(type).ko)
423 AUTOLOAD:=$(call AutoProbe,brcmfmac)
424 endef
425
426 define KernelPackage/brcmfmac/description
427 Kernel module for Broadcom IEEE802.11n USB Wireless cards
428 endef
429
430 define KernelPackage/brcmfmac/config
431 if PACKAGE_kmod-brcmfmac
432
433 config BRCMFMAC_SDIO
434 bool "Enable SDIO bus interface support"
435 default y if TARGET_bcm27xx
436 default y if TARGET_imx_cortexa7
437 default y if TARGET_rockchip
438 default y if TARGET_sunxi
439 default n
440 help
441 Enable support for cards attached to an SDIO bus.
442 Select this option only if you are sure that your
443 board has a Broadcom wireless chip atacched to
444 that bus.
445
446 config BRCMFMAC_USB
447 bool "Enable USB bus interface support"
448 depends on USB_SUPPORT
449 default y
450 help
451 Supported USB connected chipsets:
452 BCM43235, BCM43236, BCM43238 (all in revision 3 only)
453 BCM43143, BCM43242, BCM43566, BCM43569
454
455 config BRCMFMAC_PCIE
456 bool "Enable PCIE bus interface support"
457 depends on PCI_SUPPORT
458 default y
459 help
460 Supported PCIe connected chipsets:
461 BCM4354, BCM4356, BCM43567, BCM43570, BCM43602
462
463 endif
464 endef
465
466
467 define KernelPackage/b43/install
468 rm -rf $(1)/lib/firmware/
469 ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
470 tar xzf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
471 else
472 tar xjf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
473 endif
474 $(INSTALL_DIR) $(1)/lib/firmware/
475 ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
476 $(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/"
477 $(INSTALL_DIR) $(1)/lib/firmware/b43-open/
478 $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/ucode5.fw $(1)/lib/firmware/b43-open/ucode5.fw
479 $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0bsinitvals5.fw $(1)/lib/firmware/b43-open/b0g0bsinitvals5.fw
480 $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0initvals5.fw $(1)/lib/firmware/b43-open/b0g0initvals5.fw
481 else
482 b43-fwcutter -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)
483 endif
484 ifneq ($(CONFIG_B43_FW_SQUASH),)
485 b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43"
486 endif
487 endef
488
489 define KernelPackage/brcmsmac/install
490 $(INSTALL_DIR) $(1)/lib/firmware/brcm
491 ifeq ($(CONFIG_BRCMSMAC_USE_FW_FROM_WL),y)
492 tar xjf "$(DL_DIR)/$(PKG_BRCMSMAC_FW_SOURCE)" -C "$(PKG_BUILD_DIR)"
493 b43-fwcutter --brcmsmac -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_BRCMSMAC_FW_OBJECT)
494 endif
495 endef