* [PATCH 0/4] bcma/ssb/b43: BCM4352 AC-PHY wip
@ 2026-06-17 21:42 Alessio Ferri
2026-06-17 21:42 ` [PATCH 1/4] bcma: host_pci: add BCM4352 device ID 0x43b3 Alessio Ferri
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Alessio Ferri @ 2026-06-17 21:42 UTC (permalink / raw)
To: Rafał Miłecki, Michael Buesch
Cc: linux-wireless, linux-kernel, b43-dev, Alessio Ferri,
Alessio Ferri
This series introduce the initial support for BCM4352, an AC class
chip, this is just a gentle introduction before the bulk of edits,
because in reality i already have AC support working up to RX signal
and now debugging TX.
From the latest dmesg grepped from my router, this patch series allow
the user to reach to the "Bus registered" message plus the correct init
of the DMA that took me two weeks to discover.
[ 18.280000] bcma-pci-bridge 0000:01:00.0: enabling device (0000 -> 0002)
[ 18.280000] bcma-pci-bridge 0000:01:00.0: bus0: Found chip with id 0x4352, rev 0x03 and package 0x01
[ 18.290000] bcma-pci-bridge 0000:01:00.0: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x2B, class 0x0)
[ 18.300000] bcma-pci-bridge 0000:01:00.0: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x2A, class 0x0)
[ 18.320000] bcma-pci-bridge 0000:01:00.0: bus0: Core 2 found: ARM CR4 (manuf 0x4BF, id 0x83E, rev 0x02, class 0x0)
[ 18.330000] bcma-pci-bridge 0000:01:00.0: bus0: Core 3 found: PCIe Gen2 (manuf 0x4BF, id 0x83C, rev 0x01, class 0x0)
[ 18.340000] bcma-pci-bridge 0000:01:00.0: bus0: Core 4 found: USB 2.0 Device (manuf 0x4BF, id 0x81A, rev 0x11, class 0x0)
[ 18.380000] bcma: bcma: SPROM rev 11 parsed: board=0x0668 rev=4947 ccode=0x0000 txchain=0x3 rxchain=0x3 antswitch=0 subband5gver=4
[ 18.390000] bcma: bcma: SPROM r11 chain0 rxgains 2g={0,0,0} 5gl={3,6,1} 5gm={7,15,1} 5gh={7,15,1}
[ 18.400000] bcma: bcma: SPROM r11 chain1 rxgains 2g={0,0,0} 5gl={3,6,1} 5gm={7,15,1} 5gh={7,15,1}
[ 18.410000] bcma: bcma: SPROM r11 chain2 rxgains 2g={0,0,0} 5gl={3,6,1} 5gm={7,15,1} 5gh={7,15,1}
[ 18.420000] bcma-pci-bridge 0000:01:00.0: bus0: Bus registered
[ 19.340000] b43-phy0: Broadcom 4352 WLAN found (core revision 42)
[ 19.340000] b43-phy0: Found PHY: Analog 12, Type 11 (AC), Revision 1
[ 19.350000] b43-phy0: Found Radio: Manuf 0x17F, ID 0x2069, Revision 4, Version 0
[ 44.250000] b43-phy0: DEBUG pre-PSM_RUN: MACCTL=0x00020504 IRQ_REASON=0x00000000 SHM[UCODEREV]=0x0000
[ 44.260000] b43-phy0: DEBUG post-PSM_RUN: MACCTL=0x00020502 IRQ_REASON=0x00000000
[ 44.260000] b43-phy0: Loading firmware version 784.2 (2012-08-15 21:43:22)
[ 44.270000] b43-phy0: phy-ac: rxgain_init applied (2 cores, UNII-1 5gl, sprom rev 11)
[ 44.280000] b43-phy0: phy-ac: rxgain core0: triso=6 elnagain=3 trelnabyp=1 (gainctx=0x14)
[ 44.290000] b43-phy0: phy-ac: rxgain core1: triso=6 elnagain=3 trelnabyp=1 (gainctx=0x14)
[ 44.500000] b43-phy0: DEBUG dma_setup RX DMA64: base=0x020c0000 alo=0x020c0000 ahi=0x80000000 addrext=0x0 translation=0x80000000 in_low=0 ctl=0x0000084d
[ 44.720000] b43 bcma0:1 phy0-ap0: entered allmulticast mode
[ 44.730000] b43 bcma0:1 phy0-ap0: entered promiscuous mode
The two patches generated with the help of claude are marked as such.
The other two are minimal and did not require assistance from claude.
Assisted-by: claude:claude-Opus-4.8
Signed-off-by: Alessio Ferri <alessio.ferri@mythread.it>
---
Alessio Ferri (4):
bcma: host_pci: add BCM4352 device ID 0x43b3
bcma: pmu: program max resource mask on BCM4352/BCM4360
ssb: bcma: add SPROM revision 11 extraction
b43: align DMA64 descriptor ring to 64K on AC cores
drivers/bcma/driver_chipcommon_pmu.c | 8 +++
drivers/bcma/host_pci.c | 1 +
drivers/bcma/sprom.c | 100 +++++++++++++++++++++++++++++++-
drivers/net/wireless/broadcom/b43/dma.c | 20 +++++--
include/linux/ssb/ssb.h | 31 ++++++++++
include/linux/ssb/ssb_regs.h | 44 ++++++++++++++
6 files changed, 199 insertions(+), 5 deletions(-)
---
base-commit: e771677c937da5808f7b6c1f0e4a97ec1a84f8a8
change-id: 20260617-b43-add-4352-wip-f3c3a3d159d8
Best regards,
--
Alessio Ferri <alessio.ferri.3012@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] bcma: host_pci: add BCM4352 device ID 0x43b3
2026-06-17 21:42 [PATCH 0/4] bcma/ssb/b43: BCM4352 AC-PHY wip Alessio Ferri
@ 2026-06-17 21:42 ` Alessio Ferri
2026-06-18 17:57 ` Michael Büsch
2026-06-17 21:42 ` [PATCH 2/4] bcma: pmu: program max resource mask on BCM4352/BCM4360 Alessio Ferri
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Alessio Ferri @ 2026-06-17 21:42 UTC (permalink / raw)
To: Rafał Miłecki, Michael Buesch
Cc: linux-wireless, linux-kernel, b43-dev, Alessio Ferri,
Alessio Ferri
From: Alessio Ferri <alessio.ferri.3012@gmail.com>
The BCM4352 is an AC PHY. It is missing from bcma_pci_bridge_tbl[],
so bcma-pci-bridge does not bind. Add the ID.
The chip identifies as BCM4352 (chip rev 3, PHY type AC); b43 with AC-PHY
support handles it once bcma reaches the D11 core.
Signed-off-by: Alessio Ferri <alessio.ferri@mythread.it>
---
drivers/bcma/host_pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index 3dc2985063f1..f6cf722a3798 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -298,6 +298,7 @@ static const struct pci_device_id bcma_pci_bridge_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43b1) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43b3) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43227) }, /* 0xa8db, BCM43217 (sic!) */
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43228) }, /* 0xa8dc */
--
2.54.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] bcma: pmu: program max resource mask on BCM4352/BCM4360
2026-06-17 21:42 [PATCH 0/4] bcma/ssb/b43: BCM4352 AC-PHY wip Alessio Ferri
2026-06-17 21:42 ` [PATCH 1/4] bcma: host_pci: add BCM4352 device ID 0x43b3 Alessio Ferri
@ 2026-06-17 21:42 ` Alessio Ferri
2026-06-17 21:42 ` [PATCH 3/4] ssb: bcma: add SPROM revision 11 extraction Alessio Ferri
2026-06-17 21:42 ` [PATCH 4/4] b43: align DMA64 descriptor ring to 64K on AC cores Alessio Ferri
3 siblings, 0 replies; 6+ messages in thread
From: Alessio Ferri @ 2026-06-17 21:42 UTC (permalink / raw)
To: Rafał Miłecki, Michael Buesch
Cc: linux-wireless, linux-kernel, b43-dev, Alessio Ferri,
Alessio Ferri
From: Alessio Ferri <alessio.ferri.3012@gmail.com>
bcma_pmu_resources_init() has no case for the BCM4352/BCM4360 family.
The vendor instead set the max mask for chip rev > 2 with CS bit 5 clear.
Match the vendor behaviour.
Signed-off-by: Alessio Ferri <alessio.ferri@mythread.it>
---
drivers/bcma/driver_chipcommon_pmu.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/bcma/driver_chipcommon_pmu.c b/drivers/bcma/driver_chipcommon_pmu.c
index 263ef6fa1d0f..cdd5f7d668ba 100644
--- a/drivers/bcma/driver_chipcommon_pmu.c
+++ b/drivers/bcma/driver_chipcommon_pmu.c
@@ -188,6 +188,14 @@ static void bcma_pmu_resources_init(struct bcma_drv_cc *cc)
BCMA_RES_4314_WL_CORE_READY;
max_msk = 0x3FFFFFFF;
break;
+ case BCMA_CHIP_ID_BCM4352:
+ case BCMA_CHIP_ID_BCM4360:
+ /*
+ * Vendor programs the max mask here for chip rev > 2 with ChipStatus bit 5 clear
+ */
+ if (bus->chipinfo.rev > 2 && !(cc->status & BIT(5)))
+ max_msk = 0x1ff;
+ break;
default:
bcma_debug(bus, "PMU resource config unknown or not needed for device 0x%04X\n",
bus->chipinfo.id);
--
2.54.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] ssb: bcma: add SPROM revision 11 extraction
2026-06-17 21:42 [PATCH 0/4] bcma/ssb/b43: BCM4352 AC-PHY wip Alessio Ferri
2026-06-17 21:42 ` [PATCH 1/4] bcma: host_pci: add BCM4352 device ID 0x43b3 Alessio Ferri
2026-06-17 21:42 ` [PATCH 2/4] bcma: pmu: program max resource mask on BCM4352/BCM4360 Alessio Ferri
@ 2026-06-17 21:42 ` Alessio Ferri
2026-06-17 21:42 ` [PATCH 4/4] b43: align DMA64 descriptor ring to 64K on AC cores Alessio Ferri
3 siblings, 0 replies; 6+ messages in thread
From: Alessio Ferri @ 2026-06-17 21:42 UTC (permalink / raw)
To: Rafał Miłecki, Michael Buesch
Cc: linux-wireless, linux-kernel, b43-dev, Alessio Ferri,
Alessio Ferri
From: Alessio Ferri <alessio.ferri.3012@gmail.com>
SPROM revision 11 is needed with the BCM4352/BCM4360 family. Extend
struct ssb_sprom with the rev-11 fields actually parsed (per-band rxgains,
per-chain maxp/pa power info, 80/160 MHz MCS power offsets, pdoffset40ma)
and add bcma_sprom_extract_r11(), dispatched from bcma_sprom_get() when the
SPROM revision word reads as 11. bcma_sprom_get() already probes the rev-11
buffer size, and bcma_sprom_valid() populates bus->sprom.revision before
the dispatch. Revisions <= 10 keep the extract_r8 path.
Header fields (IL0MAC/ANTAVAIL/TXRXC/CCODE) reuse the rev-8 masks/shifts;
only the absolute offsets moved. CCODE uses 0x96, since rev-8 0x92 collides
with the middle word of the rev-11 IL0MAC block.
Assisted-by: Claude:claude-Opus-4.8
Signed-off-by: Alessio Ferri <alessio.ferri@mythread.it>
---
drivers/bcma/sprom.c | 100 ++++++++++++++++++++++++++++++++++++++++++-
include/linux/ssb/ssb.h | 31 ++++++++++++++
include/linux/ssb/ssb_regs.h | 44 +++++++++++++++++++
3 files changed, 174 insertions(+), 1 deletion(-)
diff --git a/drivers/bcma/sprom.c b/drivers/bcma/sprom.c
index e668ad7963fc..514c8149dbe7 100644
--- a/drivers/bcma/sprom.c
+++ b/drivers/bcma/sprom.c
@@ -474,6 +474,101 @@ static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom)
SSB_SPROM8_TEMPDELTA_HYSTERESIS_SHIFT);
}
+static void bcma_sprom_unpack_rxgains(struct ssb_sprom_rxgains *out,
+ int chain, u8 packed)
+{
+ out->trelnabyp[chain] = (packed >> 7) & 0x01;
+ out->triso[chain] = (packed >> 3) & 0x0f;
+ out->elnagain[chain] = packed & 0x07;
+}
+
+static void bcma_sprom_extract_r11(struct bcma_bus *bus, const u16 *sprom)
+{
+ static const u16 pwr_info_offset[] = {
+ SSB_SPROM11_PWR_INFO_CORE0,
+ SSB_SPROM11_PWR_INFO_CORE1,
+ SSB_SPROM11_PWR_INFO_CORE2,
+ };
+ u16 v;
+ int i, j;
+
+ BUILD_BUG_ON(ARRAY_SIZE(pwr_info_offset) >
+ ARRAY_SIZE(bus->sprom.core_pwr_info));
+
+ /* Header: rev-11 offsets, rev-8 masks/shifts. */
+ for (i = 0; i < 3; i++) {
+ v = sprom[SPOFF(SSB_SPROM11_IL0MAC) + i];
+ *(((__be16 *)bus->sprom.il0mac) + i) = cpu_to_be16(v);
+ }
+
+ SPEX(board_rev, SSB_SPROM8_BOARDREV, ~0, 0);
+ SPEX(board_type, SSB_SPROM1_SPID, ~0, 0);
+
+ SPEX(country_code, SSB_SPROM11_CCODE, ~0, 0);
+ SPEX(ant_available_a, SSB_SPROM11_ANTAVAIL, SSB_SPROM8_ANTAVAIL_A,
+ SSB_SPROM8_ANTAVAIL_A_SHIFT);
+ SPEX(ant_available_bg, SSB_SPROM11_ANTAVAIL, SSB_SPROM8_ANTAVAIL_BG,
+ SSB_SPROM8_ANTAVAIL_BG_SHIFT);
+ SPEX(txchain, SSB_SPROM11_TXRXC, SSB_SPROM8_TXRXC_TXCHAIN,
+ SSB_SPROM8_TXRXC_TXCHAIN_SHIFT);
+ SPEX(rxchain, SSB_SPROM11_TXRXC, SSB_SPROM8_TXRXC_RXCHAIN,
+ SSB_SPROM8_TXRXC_RXCHAIN_SHIFT);
+ SPEX(antswitch, SSB_SPROM11_TXRXC, SSB_SPROM8_TXRXC_SWITCH,
+ SSB_SPROM8_TXRXC_SWITCH_SHIFT);
+ SPEX(subband5gver, SSB_SPROM11_SUBBAND5GVER, 0x00ff, 0);
+
+ /* Per-chain power info. */
+ for (i = 0; i < ARRAY_SIZE(pwr_info_offset); i++) {
+ struct ssb_sprom_core_pwr_info *p = &bus->sprom.core_pwr_info[i];
+ u16 base = pwr_info_offset[i];
+
+ p->maxp2ga = sprom[SPOFF(base + SSB_SPROM11_PWR_MAXP2GA)] & 0xff;
+
+ for (j = 0; j < 3; j++)
+ p->pa2ga[j] = sprom[SPOFF(base + SSB_SPROM11_PWR_PA2GA) + j];
+
+ v = sprom[SPOFF(base + SSB_SPROM11_PWR_MAXP5GA)];
+ p->maxp5ga[0] = v & 0xff;
+ p->maxp5ga[1] = (v >> 8) & 0xff;
+ v = sprom[SPOFF(base + SSB_SPROM11_PWR_MAXP5GA) + 1];
+ p->maxp5ga[2] = v & 0xff;
+ p->maxp5ga[3] = (v >> 8) & 0xff;
+
+ for (j = 0; j < 12; j++)
+ p->pa5ga[j] = sprom[SPOFF(base + SSB_SPROM11_PWR_PA5GA) + j];
+
+ v = sprom[SPOFF(base + SSB_SPROM11_PWR_RXGAINS0)];
+ bcma_sprom_unpack_rxgains(&bus->sprom.rxgains_5gm, i, v & 0xff);
+ bcma_sprom_unpack_rxgains(&bus->sprom.rxgains_5gh, i, (v >> 8) & 0xff);
+ v = sprom[SPOFF(base + SSB_SPROM11_PWR_RXGAINS1)];
+ bcma_sprom_unpack_rxgains(&bus->sprom.rxgains_2g, i, v & 0xff);
+ bcma_sprom_unpack_rxgains(&bus->sprom.rxgains_5gl, i, (v >> 8) & 0xff);
+ }
+
+ for (i = 0; i < 3; i++)
+ bus->sprom.pdoffset40ma[i] =
+ sprom[SPOFF(SSB_SPROM11_PDOFFSET40MA) + i];
+
+ SPEX(cckbw202gpo, SSB_SPROM11_CCKBW202GPO, ~0, 0);
+ SPEX(cckbw20ul2gpo, SSB_SPROM11_CCKBW20UL2GPO, ~0, 0);
+ SPEX32(mcsbw202gpo, SSB_SPROM11_MCSBW202GPO, ~0, 0);
+ SPEX32(mcsbw402gpo, SSB_SPROM11_MCSBW402GPO, ~0, 0);
+ SPEX(dot11agofdmhrbw202gpo, SSB_SPROM11_DOT11AGOFDMHRBW202GPO, ~0, 0);
+ SPEX(ofdmlrbw202gpo, SSB_SPROM11_OFDMLRBW202GPO, ~0, 0);
+ SPEX32(mcsbw205glpo, SSB_SPROM11_MCSBW205GLPO, ~0, 0);
+ SPEX32(mcsbw405glpo, SSB_SPROM11_MCSBW405GLPO, ~0, 0);
+ SPEX32(mcsbw805glpo, SSB_SPROM11_MCSBW805GLPO, ~0, 0);
+ SPEX32(mcsbw1605glpo, SSB_SPROM11_MCSBW1605GLPO, ~0, 0);
+ SPEX32(mcsbw205gmpo, SSB_SPROM11_MCSBW205GMPO, ~0, 0);
+ SPEX32(mcsbw405gmpo, SSB_SPROM11_MCSBW405GMPO, ~0, 0);
+ SPEX32(mcsbw805gmpo, SSB_SPROM11_MCSBW805GMPO, ~0, 0);
+ SPEX32(mcsbw1605gmpo, SSB_SPROM11_MCSBW1605GMPO, ~0, 0);
+ SPEX32(mcsbw205ghpo, SSB_SPROM11_MCSBW205GHPO, ~0, 0);
+ SPEX32(mcsbw405ghpo, SSB_SPROM11_MCSBW405GHPO, ~0, 0);
+ SPEX32(mcsbw805ghpo, SSB_SPROM11_MCSBW805GHPO, ~0, 0);
+ SPEX32(mcsbw1605ghpo, SSB_SPROM11_MCSBW1605GHPO, ~0, 0);
+}
+
/*
* Indicates the presence of external SPROM.
*/
@@ -640,7 +735,10 @@ int bcma_sprom_get(struct bcma_bus *bus)
bcma_warn(bus, "Invalid SPROM read from the PCIe card, trying to use fallback SPROM\n");
err = bcma_fill_sprom_with_fallback(bus, &bus->sprom);
} else {
- bcma_sprom_extract_r8(bus, sprom);
+ if (bus->sprom.revision == 11)
+ bcma_sprom_extract_r11(bus, sprom);
+ else
+ bcma_sprom_extract_r8(bus, sprom);
kfree(sprom);
}
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index e1fb11e0f12c..9d4a13c4eca3 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -23,6 +23,19 @@ struct ssb_sprom_core_pwr_info {
u8 itssi_2g, itssi_5g;
u8 maxpwr_2g, maxpwr_5gl, maxpwr_5g, maxpwr_5gh;
u16 pa_2g[4], pa_5gl[4], pa_5g[4], pa_5gh[4];
+
+ /* SROM rev 11 */
+ u8 maxp2ga;
+ u8 maxp5ga[4];
+ u16 pa2ga[3];
+ u16 pa5ga[12];
+};
+
+/* Per-band rx gain context, one value per RF chain. SROM rev 11. */
+struct ssb_sprom_rxgains {
+ u8 elnagain[3];
+ u8 triso[3];
+ u8 trelnabyp[3];
};
struct ssb_sprom {
@@ -192,6 +205,24 @@ struct ssb_sprom {
u16 legofdm40duppo;
u8 sar2g;
u8 sar5g;
+
+ /* SROM rev 11. Populated only by the rev 11 extractor; zero on
+ * rev <= 10 boards.
+ */
+ struct ssb_sprom_rxgains rxgains_2g;
+ struct ssb_sprom_rxgains rxgains_5gl;
+ struct ssb_sprom_rxgains rxgains_5gm;
+ struct ssb_sprom_rxgains rxgains_5gh;
+ u8 subband5gver;
+ u16 dot11agofdmhrbw202gpo;
+ u16 ofdmlrbw202gpo;
+ u32 mcsbw805glpo;
+ u32 mcsbw805gmpo;
+ u32 mcsbw805ghpo;
+ u32 mcsbw1605glpo;
+ u32 mcsbw1605gmpo;
+ u32 mcsbw1605ghpo;
+ u16 pdoffset40ma[3];
};
/* Information about the PCB the circuitry is soldered on. */
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index 210f46494065..9fedf5dcdccd 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -606,6 +606,50 @@
#define SSB_SPROM8_BW40PO 0x0196
#define SSB_SPROM8_BWDUPPO 0x0198
+/* SROM revision 11. Only the header fields whose absolute offset moved
+ * are redefined; the bitfield masks/shifts are reused from rev 8.
+ */
+#define SSB_SPROM11_IL0MAC 0x0090 /* 6 byte MAC address */
+#define SSB_SPROM11_CCODE 0x0096 /* 2 byte country code */
+#define SSB_SPROM11_ANTAVAIL 0x00A0
+#define SSB_SPROM11_TXRXC 0x00A8
+#define SSB_SPROM11_PDOFFSET40MA 0x00CA /* 3 x u16, one per chain */
+#define SSB_SPROM11_SUBBAND5GVER 0x00D6
+
+/* Per-chain power info blocks. Stride 0x28 bytes; field layout given by
+ * SSB_SPROM11_PWR_* below.
+ */
+#define SSB_SPROM11_PWR_INFO_CORE0 0x00D8
+#define SSB_SPROM11_PWR_INFO_CORE1 0x0100
+#define SSB_SPROM11_PWR_INFO_CORE2 0x0128
+
+#define SSB_SPROM11_PWR_MAXP2GA 0x0000 /* u8 in low byte */
+#define SSB_SPROM11_PWR_PA2GA 0x0002 /* 3 x u16 */
+#define SSB_SPROM11_PWR_RXGAINS0 0x0008 /* 5gm (lo) / 5gh (hi) */
+#define SSB_SPROM11_PWR_RXGAINS1 0x000A /* 2g (lo) / 5gl (hi) */
+#define SSB_SPROM11_PWR_MAXP5GA 0x000C /* 2 x u16 -> 4 x u8 */
+#define SSB_SPROM11_PWR_PA5GA 0x0010 /* 12 x u16 */
+
+/* Power-per-rate region. */
+#define SSB_SPROM11_CCKBW202GPO 0x0150
+#define SSB_SPROM11_CCKBW20UL2GPO 0x0152
+#define SSB_SPROM11_MCSBW202GPO 0x0154
+#define SSB_SPROM11_MCSBW402GPO 0x0158
+#define SSB_SPROM11_DOT11AGOFDMHRBW202GPO 0x015C
+#define SSB_SPROM11_OFDMLRBW202GPO 0x015E
+#define SSB_SPROM11_MCSBW205GLPO 0x0160
+#define SSB_SPROM11_MCSBW405GLPO 0x0164
+#define SSB_SPROM11_MCSBW805GLPO 0x0168
+#define SSB_SPROM11_MCSBW1605GLPO 0x016C
+#define SSB_SPROM11_MCSBW205GMPO 0x0170
+#define SSB_SPROM11_MCSBW405GMPO 0x0174
+#define SSB_SPROM11_MCSBW805GMPO 0x0178
+#define SSB_SPROM11_MCSBW1605GMPO 0x017C
+#define SSB_SPROM11_MCSBW205GHPO 0x0180
+#define SSB_SPROM11_MCSBW405GHPO 0x0184
+#define SSB_SPROM11_MCSBW805GHPO 0x0188
+#define SSB_SPROM11_MCSBW1605GHPO 0x018C
+
/* Values for boardflags_lo read from SPROM */
#define SSB_BFL_BTCOEXIST 0x0001 /* implements Bluetooth coexistance */
#define SSB_BFL_PACTRL 0x0002 /* GPIO 9 controlling the PA */
--
2.54.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] b43: align DMA64 descriptor ring to 64K on AC cores
2026-06-17 21:42 [PATCH 0/4] bcma/ssb/b43: BCM4352 AC-PHY wip Alessio Ferri
` (2 preceding siblings ...)
2026-06-17 21:42 ` [PATCH 3/4] ssb: bcma: add SPROM revision 11 extraction Alessio Ferri
@ 2026-06-17 21:42 ` Alessio Ferri
3 siblings, 0 replies; 6+ messages in thread
From: Alessio Ferri @ 2026-06-17 21:42 UTC (permalink / raw)
To: Rafał Miłecki, Michael Buesch
Cc: linux-wireless, linux-kernel, b43-dev, Alessio Ferri,
Alessio Ferri
From: Alessio Ferri <alessio.ferri.3012@gmail.com>
The AC d11 core (core_rev 40/42, BCM4352) exposes a 16-bit DMA descriptor
pointer (wrap mask 0xffff, not the 0x1fff b43 assumes). With an 8K-aligned
ring the engine wraps the pointer outside the ring and raises I_DE on RX.
Allocate the 64-bit ring with 64K size on these cores so the base is
64K-aligned and (base & 0xffff) == 0; dma_alloc_coherent() aligns to the
allocation size. ring_mem_size widens to u32 to hold 0x10000. N-PHY cores
report 0x1fff and keep the 8K allocation.
Assisted-by: claude:claude-Opus-4.8
Signed-off-by: Alessio Ferri <alessio.ferri@mythread.it>
---
drivers/net/wireless/broadcom/b43/dma.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/broadcom/b43/dma.c b/drivers/net/wireless/broadcom/b43/dma.c
index 05da6987a845..cb308080312b 100644
--- a/drivers/net/wireless/broadcom/b43/dma.c
+++ b/drivers/net/wireless/broadcom/b43/dma.c
@@ -404,6 +404,18 @@ static inline
}
}
+static u32 b43_dma64_ringmem_size(struct b43_dmaring *ring)
+{
+ /* AC d11 cores (core_rev 40/42) expose a 16-bit descriptor pointer
+ * (mask 0xffff) and need a 64K-aligned ring; dma_alloc_coherent()
+ * aligns to the (power-of-2) allocation size. Smaller cores use the
+ * 0x1fff mask and are fine with 8K.
+ */
+ if (ring->dev->dev->core_rev == 40 || ring->dev->dev->core_rev == 42)
+ return 0x10000;
+ return B43_DMA64_RINGMEMSIZE;
+}
+
static int alloc_ringmemory(struct b43_dmaring *ring)
{
/* The specs call for 4K buffers for 30- and 32-bit DMA with 4K
@@ -415,8 +427,8 @@ static int alloc_ringmemory(struct b43_dmaring *ring)
* B43_DMA64_RXSTATDPTR. Let's just use 8K buffers even if we don't use
* more than 256 slots for ring.
*/
- u16 ring_mem_size = (ring->type == B43_DMA_64BIT) ?
- B43_DMA64_RINGMEMSIZE : B43_DMA32_RINGMEMSIZE;
+ u32 ring_mem_size = (ring->type == B43_DMA_64BIT) ?
+ b43_dma64_ringmem_size(ring) : B43_DMA32_RINGMEMSIZE;
ring->descbase = dma_alloc_coherent(ring->dev->dev->dma_dev,
ring_mem_size, &(ring->dmabase),
@@ -429,8 +441,8 @@ static int alloc_ringmemory(struct b43_dmaring *ring)
static void free_ringmemory(struct b43_dmaring *ring)
{
- u16 ring_mem_size = (ring->type == B43_DMA_64BIT) ?
- B43_DMA64_RINGMEMSIZE : B43_DMA32_RINGMEMSIZE;
+ u32 ring_mem_size = (ring->type == B43_DMA_64BIT) ?
+ b43_dma64_ringmem_size(ring) : B43_DMA32_RINGMEMSIZE;
dma_free_coherent(ring->dev->dev->dma_dev, ring_mem_size,
ring->descbase, ring->dmabase);
}
--
2.54.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] bcma: host_pci: add BCM4352 device ID 0x43b3
2026-06-17 21:42 ` [PATCH 1/4] bcma: host_pci: add BCM4352 device ID 0x43b3 Alessio Ferri
@ 2026-06-18 17:57 ` Michael Büsch
0 siblings, 0 replies; 6+ messages in thread
From: Michael Büsch @ 2026-06-18 17:57 UTC (permalink / raw)
To: Alessio Ferri
Cc: Rafał Miłecki, linux-wireless, linux-kernel, b43-dev,
Alessio Ferri
[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]
On Wed, 17 Jun 2026 23:42:08 +0200
Alessio Ferri <alessio.ferri@mythread.it> wrote:
> From: Alessio Ferri <alessio.ferri.3012@gmail.com>
>
> The BCM4352 is an AC PHY. It is missing from bcma_pci_bridge_tbl[],
> so bcma-pci-bridge does not bind. Add the ID.
>
> The chip identifies as BCM4352 (chip rev 3, PHY type AC); b43 with AC-PHY
> support handles it once bcma reaches the D11 core.
>
> Signed-off-by: Alessio Ferri <alessio.ferri@mythread.it>
> ---
> drivers/bcma/host_pci.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
> index 3dc2985063f1..f6cf722a3798 100644
> --- a/drivers/bcma/host_pci.c
> +++ b/drivers/bcma/host_pci.c
> @@ -298,6 +298,7 @@ static const struct pci_device_id bcma_pci_bridge_tbl[] = {
> { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) },
> { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) },
> { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43b1) },
> + { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43b3) },
> { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) },
> { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43227) }, /* 0xa8db, BCM43217 (sic!) */
> { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43228) }, /* 0xa8dc */
>
Please submit this patch last, after the driver is expected to actually work
on the device.
--
Michael Büsch
https://bues.ch/
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-06-18 18:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-17 21:42 [PATCH 0/4] bcma/ssb/b43: BCM4352 AC-PHY wip Alessio Ferri
2026-06-17 21:42 ` [PATCH 1/4] bcma: host_pci: add BCM4352 device ID 0x43b3 Alessio Ferri
2026-06-18 17:57 ` Michael Büsch
2026-06-17 21:42 ` [PATCH 2/4] bcma: pmu: program max resource mask on BCM4352/BCM4360 Alessio Ferri
2026-06-17 21:42 ` [PATCH 3/4] ssb: bcma: add SPROM revision 11 extraction Alessio Ferri
2026-06-17 21:42 ` [PATCH 4/4] b43: align DMA64 descriptor ring to 64K on AC cores Alessio Ferri
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox