openwrt/target/linux/bcm63xx/patches-5.4
Daniel González Cabanelas a0e0e621ca bcm63xx: sprom: override the PCI device ID
The PCI device ID detected by the wifi drivers on devices using a fallback
SPROM is wrong. Currently the chipnum is used for this parameter.

Most SSB based Broadcom wifi chips are 2.4 and 5GHz capable. But on
devices without a physical SPROM, the only one way to detect if the device
suports both bands or only the 5GHz band, is by reading the device ID from
the fallback SPROM.

In some devices, this may lead to a non working wifi on a 5GHz-only card,
or in the best case a working 2.4GHz-only in a dual band wifi card.

The offset for the deviceid in SSB SPROMs is 0x0008, whereas in BCMA is
0x0060. This is true for any SPROM version.

Override the PCI device ID with the one defined at the fallback SPROM, to
detect the correct wifi card model and allow using the 5GHz band if
supported.

The patch has been tested with the following wifi radios:

BCM43222: b43: both 2.4/5GHz working
          brcm-wl: both 2.4/5GHz working

BCM43225: b43: 2.4GHz, working
	 brcmsmac: working
	 brcm-wl: it lacks support

BCM43217: b43: 2.4GHz, working
	 brcmsmac: it lacks support
	 brcm-wl: it lacks support

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
[amend commit description, rework patch to avoid using a new global variable
and keep ssb sprom extraction code as close to ssb/pci.c as possible]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-02 20:40:31 +01:00
..
010-v5.8-MIPS-BCM63xx-fix-6328-boot-selection-bit.patch bcm63xx: bcm6328: switch to upstream boot sel patch 2020-06-07 20:26:17 +02:00
021-v5.8-mtd-rawnand-brcmnand-improve-hamming-oob-layout.patch kernel: bump 5.4 to 5.4.58 2020-08-18 18:14:54 +02:00
023-v5.8-mtd-rawnand-brcmnand-rename-v4-registers.patch bcm63xx: switch to upstream NAND patches 2020-06-11 09:07:04 +02:00
025-v5.8-mtd-rawnand-brcmnand-rename-page-sizes.patch bcm63xx: switch to upstream NAND patches 2020-06-11 09:07:04 +02:00
026-v5.8-mtd-rawnand-brcmnand-support-v2.1-v2.2-controllers.patch bcm63xx: switch to upstream NAND patches 2020-06-11 09:07:04 +02:00
030-v5.9-leds-bcm6328-support-second-hw-blinking-interval.patch bcm63xx: switch to upstream LED patch 2020-08-06 23:06:12 +02:00
031-v5.9-MIPS-BCM63xx-add-endif-comments.patch bcm63xx: switch to upstream endif comments patch 2020-08-06 23:06:12 +02:00
032-v5.9-MIPS-BCM63xx-improve-CFE-version-detection.patch bcm63xx: switch to upstream CFE version detection patch 2020-08-06 23:06:12 +02:00
033-v5.9-mtd-parsers-bcm63xx-simplify-CFE-detection.patch bcm63xx: switch to upstream CFE detection patch 2020-08-11 08:04:40 +02:00
040-v5.12-bcm63xx_enet-batch-process-rx-path.patch bcm63xx: sync ethernet driver with net-next 2021-01-22 12:42:30 +01:00
041-v5.12-bcm63xx_enet-add-BQL-support.patch bcm63xx: sync ethernet driver with net-next 2021-01-22 12:42:30 +01:00
042-v5.12-bcm63xx_enet-add-xmit_more-support.patch bcm63xx: sync ethernet driver with net-next 2021-01-22 12:42:30 +01:00
043-v5.12-bcm63xx_enet-alloc-rx-skb-with-NET_IP_ALIGN.patch bcm63xx: sync ethernet driver with net-next 2021-01-22 12:42:30 +01:00
044-v5.12-bcm63xx_enet-consolidate-rx-SKB-ring-cleanup-code.patch bcm63xx: sync ethernet driver with net-next 2021-01-22 12:42:30 +01:00
045-v5.12-bcm63xx_enet-convert-to-build_skb.patch bcm63xx: sync ethernet driver with net-next 2021-01-22 12:42:30 +01:00
046-v5.12-bcm63xx_enet-improve-rx-loop.patch bcm63xx: sync ethernet driver with net-next 2021-01-22 12:42:30 +01:00
047-bcm63xx_enet-fix-kernel-panic.patch bcm63xx: fix bcm63xx ethernet kernel panics 2021-01-28 12:01:14 +01:00
100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch
101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch
102-MIPS-BCM63XX-move-code-touching-the-USB-private-regi.patch
103-MIPS-BCM63XX-add-OHCI-EHCI-configuration-bits-to-com.patch
104-MIPS-BCM63XX-introduce-BCM63XX_OHCI-configuration-sy.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
105-MIPS-BCM63XX-add-support-for-the-on-chip-OHCI-contro.patch
106-MIPS-BCM63XX-register-OHCI-controller-if-board-enabl.patch bcm63xx: switch to upstream CFE version detection patch 2020-08-06 23:06:12 +02:00
107-MIPS-BCM63XX-introduce-BCM63XX_EHCI-configuration-sy.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
108-MIPS-BCM63XX-add-support-for-the-on-chip-EHCI-contro.patch
109-MIPS-BCM63XX-register-EHCI-controller-if-board-enabl.patch bcm63xx: switch to upstream CFE version detection patch 2020-08-06 23:06:12 +02:00
110-MIPS-BCM63XX-EHCI-controller-does-not-support-overcu.patch
130-pinctrl-add-bcm63xx-base-code.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
131-Documentation-add-BCM6328-pincontroller-binding-docu.patch
132-pinctrl-add-a-pincontrol-driver-for-BCM6328.patch
133-Documentation-add-BCM6348-pincontroller-binding-docu.patch
134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch
135-Documentation-add-BCM6358-pincontroller-binding-docu.patch
136-pinctrl-add-a-pincontrol-driver-for-BCM6358.patch
137-Documentation-add-BCM6362-pincontroller-binding-docu.patch
138-pinctrl-add-a-pincontrol-driver-for-BCM6362.patch
139-Documentation-add-BCM6368-pincontroller-binding-docu.patch
140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch
141-Documentation-add-BCM63268-pincontroller-binding-doc.patch
142-pinctrl-add-a-pincontrol-driver-for-BCM63268.patch
143-gpio-fix-device-tree-gpio-hogs-on-dual-role-gpio-pin.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
144-add-removed-syscon_regmap_lookup_by_pdevname.patch bcm63xx: 5.4: fix compilation for changed driver_find_device 2020-04-12 12:45:56 +02:00
145-pinctrl-BCM6362-fix-gpio-mode.patch bcm63xx: bcm6362: fix pinctrl bug 2020-05-14 16:12:12 +02:00
206-USB-EHCI-allow-limiting-ports-for-ehci-platform.patch kernel: bump 5.4 to 5.4.93 2021-01-29 14:22:09 +01:00
207-MIPS-BCM63XX-move-device-registration-code-into-its-.patch bcm63xx: switch to upstream CFE version detection patch 2020-08-06 23:06:12 +02:00
208-MIPS-BCM63XX-pass-a-mac-addresss-allocator-to-board-.patch bcm63xx: switch to upstream CFE version detection patch 2020-08-06 23:06:12 +02:00
320-irqchip-add-support-for-bcm6345-style-periphery-irq-.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
321-irqchip-add-support-for-bcm6345-style-external-inter.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
322-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch bcm63xx: switch to upstream endif comments patch 2020-08-06 23:06:12 +02:00
323-MIPS-BCM63XX-wire-up-BCM6358-s-external-interrupts-4.patch
324-irqchip-bcm6345-periph-fix-block-uninitialized.patch bcm63xx: periph_intc: fix warning 2020-05-14 16:27:31 +02:00
325-irqchip-bcm6345-external-fix-base-uninitialized.patch bcm63xx: ext_intc: fix warning 2020-05-14 16:28:31 +02:00
326-irqchip-bcm6345-report-eff-affinity.patch bcm63xx: periph_intc: report effective affinity 2020-05-14 18:10:12 +02:00
327-irqchip-bcm6345-periph-clear-on-init.patch bcm63xx: mask interrupts on init 2020-05-17 23:29:48 +02:00
330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
331-MIPS-BCM63XX-define-variant-id-field.patch
332-MIPS-BCM63XX-detect-BCM6328-variants.patch
333-MIPS-BCM63XX-detect-BCM6362-variants.patch
334-MIPS-BCM63XX-detect-BCM6368-variants.patch
335-MIPS-BCM63XX-fix-PCIe-memory-window-size.patch
336-MIPS-BCM63XX-dynamically-set-the-pcie-memory-windows.patch
337-MIPS-BCM63XX-widen-cpuid-field.patch
338-MIPS-BCM63XX-increase-number-of-IRQs.patch
339-MIPS-BCM63XX-add-support-for-BCM63268.patch bcm63xx: switch to upstream endif comments patch 2020-08-06 23:06:12 +02:00
340-MIPS-BCM63XX-add-pcie-support-for-BCM63268.patch
341-MIPS-BCM63XX-add-support-for-BCM6318.patch bcm63xx: switch to upstream endif comments patch 2020-08-06 23:06:12 +02:00
342-MIPS-BCM63XX-split-PCIe-reset-signals.patch
343-MIPS-BCM63XX-add-PCIe-support-for-BCM6318.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
344-MIPS-BCM63XX-detect-flash-type-early-and-store-the-r.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
345-MIPS-BCM63XX-fixup-mapped-SPI-flash-access-on-boot.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch
347-MIPS-BCM6318-USB-support.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
348-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch
349-MIPS-BCM63XX-add-BCM63268-USB-support.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
350-MIPS-BCM63XX-support-settings-num-usbh-ports.patch
351-set-board-usbh-ports.patch bcm63xx: switch to upstream endif comments patch 2020-08-06 23:06:12 +02:00
354-MIPS-BCM63XX-allow-building-support-for-more-than-on.patch bcm63xx: switch to upstream endif comments patch 2020-08-06 23:06:12 +02:00
355-MIPS-BCM63XX-allow-board-implementations-to-force-fl.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
356-MIPS-BCM63XX-move-fallback-sprom-support-into-its-ow.patch
357-MIPS-BCM63XX-use-platform-data-for-the-sprom.patch
358-MIPS-BCM63XX-make-fallback-sprom-optional.patch bcm63xx: switch to upstream endif comments patch 2020-08-06 23:06:12 +02:00
359-MIPS-BCM63XX-allow-different-types-of-sprom.patch
360-MIPS-BCM63XX-add-support-for-raw-sproms.patch bcm63xx: backport upstream SSB SPROM extraction 2021-02-02 20:40:29 +01:00
361-MIPS-BCM63XX-add-raw-fallback-sproms-for-most-common.patch bcm63xx: backport upstream SSB SPROM extraction 2021-02-02 20:40:29 +01:00
362-MIPS-BCM63XX-also-register-a-fallback-sprom-for-bcma.patch bcm63xx: backport upstream SSB SPROM extraction 2021-02-02 20:40:29 +01:00
363-MIPS-BCM63XX-add-BCMA-based-sprom-templates.patch bcm63xx: backport upstream SSB SPROM extraction 2021-02-02 20:40:29 +01:00
364-MIPS-BCM63XX-allow-board-files-to-provide-sprom-fixu.patch bcm63xx: backport upstream SSB SPROM extraction 2021-02-02 20:40:29 +01:00
365-MIPS-BCM63XX-allow-setting-a-pci-bus-device-for-fall.patch bcm63xx: backport upstream SSB SPROM extraction 2021-02-02 20:40:29 +01:00
366-MIPS-BCM63XX-fallback-sprom-override-devid.patch bcm63xx: sprom: override the PCI device ID 2021-02-02 20:40:31 +01:00
367-MIPS-BCM63XX-add-support-for-loading-DTB.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
368-MIPS-BCM63XX-add-support-for-matching-the-board_info.patch bcm63xx: switch to upstream CFE version detection patch 2020-08-06 23:06:12 +02:00
371_add_of_node_available_by_alias.patch
372_dont_register_pflash_when_available_in_dtb.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
373-MIPS-BCM63XX-register-interrupt-controllers-through-.patch
374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
375-MIPS-BCM63XX-switch-to-new-gpio-driver.patch
377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch bcm63xx: switch to upstream endif comments patch 2020-08-06 23:06:12 +02:00
378-MIPS-BCM63XX-do-not-register-gpio-controller-if-pres.patch
379-MIPS-BCM63XX-provide-a-gpio-lookup-for-the-pcmcia-re.patch
380-pcmcia-bcm63xx_pmcia-use-the-new-named-gpio.patch
381-Documentation-add-BCM6318-pincontroller-binding-docu.patch
382-pinctrl-add-a-pincontrol-driver-for-BCM6318.patch
383-bcm63xx_select_pinctrl.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
389-MIPS-BCM63XX-add-clkdev-lookups-for-device-tree.patch
390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch
391-MIPS-BCM63XX-do-not-register-uart.patch bcm63xx: switch to upstream endif comments patch 2020-08-06 23:06:12 +02:00
392-MIPS-BCM63XX-remove-leds-and-buttons.patch bcm63xx: switch to upstream endif comments patch 2020-08-06 23:06:12 +02:00
400-bcm963xx_flashmap.patch bcm63xx: redboot: fix warning 2020-05-14 16:12:12 +02:00
401-bcm963xx_real_rootfs_length.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
402_bcm63xx_enet_vlan_incoming_fixed.patch bcm63xx: fix bcm63xx ethernet kernel panics 2021-01-28 12:01:14 +01:00
403-6358-enet1-external-mii-clk.patch
404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch bcm63xx: fix bcm63xx ethernet kernel panics 2021-01-28 12:01:14 +01:00
408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch bcm63xx: fix bcm63xx ethernet kernel panics 2021-01-28 12:01:14 +01:00
411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch bcm63xx: bcm6328: fix strapbus boot sel 2020-05-19 13:33:39 +02:00
413-BCM63XX-allow-providing-fixup-data-in-board-data.patch
415-MIPS-BCM63XX-export-the-attached-flash-type.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
416-BCM63XX-add-a-fixup-for-ath9k-devices.patch bcm63xx: prevent fall-through in kernel patches for 5.4 2020-04-12 12:43:55 +02:00
420-BCM63XX-add-endian-check-for-ath9k.patch bcm63xx: prevent fall-through in kernel patches for 5.4 2020-04-12 12:43:55 +02:00
421-BCM63XX-add-led-pin-for-ath9k.patch bcm63xx: prevent fall-through in kernel patches for 5.4 2020-04-12 12:43:55 +02:00
422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch
423-bcm63xx_enet_add_b53_support.patch bcm63xx: fix bcm63xx ethernet kernel panics 2021-01-28 12:01:14 +01:00
424-bcm63xx_enet_no_request_mem_region.patch bcm63xx: fix bcm63xx ethernet kernel panics 2021-01-28 12:01:14 +01:00
427-boards_probe_switch.patch bcm63xx: switch to upstream endif comments patch 2020-08-06 23:06:12 +02:00
428-bcm63xx_enet-rgmii-ctrl-fix.patch bcm63xx: fix bcm63xx ethernet kernel panics 2021-01-28 12:01:14 +01:00
430-MIPS-BCM63XX-add-nand-clocks.patch bcm63xx: smp: add NAND support 2020-05-18 18:24:06 +02:00
431-MIPS-BCM63XX-add-nand-rset.patch bcm63xx: kernel: add BCM63167 cpuid variant 2020-06-07 20:26:17 +02:00
432-MIPS-BCM63XX-detect-nand-nvram.patch bcm63xx: smp: add NAND support 2020-05-18 18:24:06 +02:00
433-MIPS-BCM63XX-enable-nand-support.patch bcm63xx: smp: add NAND support 2020-05-18 18:24:06 +02:00
434-nand-brcmnand-fix-OOB-R-W-with-Hamming-ECC.patch bcm63xx: nand: fix OOB R/W for non Hamming ECC 2021-01-22 11:36:49 +01:00
500-MIPS-BCM63XX-populate-the-compatible-to-board_info-l.patch bcm63xx: reorganize board patches 2020-08-16 01:03:39 +02:00
501-board_bcm6328-extend-96328avng-reference-board.patch bcm63xx: reorganize board patches into fewer files 2020-10-26 23:48:08 +01:00
502-board-bcm6358-DWV-S0_fixes.patch bcm63xx: reorganize board patches into fewer files 2020-10-26 23:48:08 +01:00
511-board_bcm6318.patch bcm63xx: reorganize board patches into fewer files 2020-10-26 23:48:08 +01:00
512-board_bcm6328.patch bcm63xx: add support for Innacomm W3400V6 2020-12-09 08:42:26 +01:00
513-board-bcm6338.patch bcm63xx: add support for Innacomm W3400V6 2020-12-09 08:42:26 +01:00
514-board_bcm6345.patch bcm63xx: add support for Innacomm W3400V6 2020-12-09 08:42:26 +01:00
515-board-bcm6348.patch bcm63xx: add support for Innacomm W3400V6 2020-12-09 08:42:26 +01:00
516-board-bcm6358.patch bcm63xx: add support for Innacomm W3400V6 2020-12-09 08:42:26 +01:00
517-board_bcm6362.patch bcm63xx: add support for Innacomm W3400V6 2020-12-09 08:42:26 +01:00
518-board_bcm6368.patch bcm63xx: DGND3700v1: use the real board name 2020-12-11 11:47:37 +01:00
519-board_bcm63268.patch bcm63xx: add support for Innacomm W3400V6 2020-12-09 08:42:26 +01:00
531-board_bcm6348-bt-voyager-2500v-bb.patch bcm63xx: add support for Innacomm W3400V6 2020-12-09 08:42:26 +01:00
532-MIPS-BCM63XX-add-inventel-Livebox-support.patch bcm63xx: reorganize board patches into fewer files 2020-10-26 23:48:08 +01:00
800-wl_exports.patch bcm63xx: refresh patches for kernel 5.4 2020-04-12 12:36:43 +02:00
801-ssb_export_fallback_sprom.patch bcm63xx: sprom: override the PCI device ID 2021-02-02 20:40:31 +01:00
802-rtl8367r_fix_RGMII_support.patch
803-jffs2-work-around-unaligned-accesses-failing-on-bcm6.patch