Adding support for DLink DSL 3580L

I am adding support for DLink DSL 3580L (broadcom 6362 with integrated wifi + bcm4352 variant mini-pcie), i have successfully run an image that do not crash and have working ethernet, if someone is interested on helping the port, please check https://github.com/aleferri/openwrt-dsl3580l.

I am also looking for information on the strange flash layout i found, the router has 16 MB flash, checked visually by looking at the chip soldered, but also reported by the dmesg, but the stock firmware use just 7.5 MB of space, and just after CFE + stock there are 4 different areas, one 1.5 Mb non-erased block with high entropy, one erased block of around 7 MB, some padding with low entropy and then the broadcom nvmem, maybe some of you encountered a similar layout somewhere else and can explain its purpose

That sounds a lot like a split firmware image. It's common for a device to store two firmware images to flash in case one of them gets corrupt. After you make a backup of the whole flash, you should be able use to space occupied by the two vendor OS images for a single openwrt one.

After i found the bin of the original firmware, i think i got it, the 1.5 MB block with high entropy is the linux kernel, because the firmware image has the kernel at the end of rootfs, instead of using openwrt convention (kernel at start + rootfs after), so, the 7.5MB + 1.5 MB = 9 MB occupied for original firmware, so i can safely override that block too

Update: encountered endiannes problem enumerating internal SoC components with bcma, will create a temp patche to fix; bcma sprom rev11 now read correctly, will begin testing ac network

Partial victory, bcma now sees the integrated wifi inside the SoC, switching to filling the bits in b43 to add support

Dmesg after patches:

[    1.070000] bcma-sprom bcm6362-sprom: patching SPROM with 1 fixups...
[    1.080000] bcma-sprom bcm6362-sprom: mtd mac d8:fe:e3:e2:a1:3d
[    1.090000] bcma-sprom bcm6362-sprom: registered SPROM for SoC bcma [wlan]
[    1.090000] bcma-fbs: SPROM r11: board=0x0668 rev=4947 ccode=0x0000 txchain=0x3 rxchain=0x3 subband5gver=4
[    1.100000] bcma-fbs: SPROM r11 rxgains 5gl: c0={3,6,1} c1={3,6,1}
[    1.110000] bcma-sprom bcm4352-sprom: mtd mac d8:fe:e3:e2:a1:3e
[    1.120000] bcma-sprom bcm4352-sprom: registered SPROM for [1:0]
[    1.280000] bcma-host-soc 10004000.axi: bus0: Found chip with id 0x6362, rev 0x01 and package 0x00
[    1.290000] bcma-host-soc 10004000.axi: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x23, class 0x0)
[    1.310000] bcma-host-soc 10004000.axi: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x16, class 0x0)
[    1.320000] bcma-host-soc 10004000.axi: bus0: Core 2 found: SHIM (manuf 0x4BF, id 0x837, rev 0x01, class 0x0)
[    1.330000] bcma-host-soc 10004000.axi: bus0: Flash type not supported
[    1.330000] bcma-sprom bcm6362-sprom: requested by SoC bcma [wlan]
[    1.340000] bcma-host-soc 10004000.axi: bus0: Bus registered
[    1.750000] bcma-pci-bridge 0000:01:00.0: enabling device (0000 -> 0002)
[    1.760000] bcma-pci-bridge 0000:01:00.0: bus1: Found chip with id 0x4352, rev 0x03 and package 0x01
[    1.770000] bcma-pci-bridge 0000:01:00.0: bus1: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x2B, class 0x0)
[    1.780000] bcma-pci-bridge 0000:01:00.0: bus1: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x2A, class 0x0)
[    1.790000] bcma-pci-bridge 0000:01:00.0: bus1: Core 2 found: ARM CR4 (manuf 0x4BF, id 0x83E, rev 0x02, class 0x0)
[    1.800000] bcma-pci-bridge 0000:01:00.0: bus1: Core 3 found: PCIe Gen2 (manuf 0x4BF, id 0x83C, rev 0x01, class 0x0)
[    1.810000] bcma-pci-bridge 0000:01:00.0: bus1: Core 4 found: USB 2.0 Device (manuf 0x4BF, id 0x81A, rev 0x11, class 0x0)
[    1.860000] bcma: bcma: SPROM rev 11 parsed: board=0x0668 rev=4947 ccode=0x0000 txchain=0x3 rxchain=0x3 antswitch=0 subband5gver=4
[    1.870000] bcma: bcma: SPROM r11 chain0 rxgains 2g={0,0,0} 5gl={3,6,1} 5gm={7,15,1} 5gh={7,15,1}
[    1.880000] bcma: bcma: SPROM r11 chain1 rxgains 2g={0,0,0} 5gl={3,6,1} 5gm={7,15,1} 5gh={7,15,1}
[    1.890000] bcma: bcma: SPROM r11 chain2 rxgains 2g={0,0,0} 5gl={3,6,1} 5gm={7,15,1} 5gh={7,15,1}
[    1.900000] bcma-pci-bridge 0000:01:00.0: bus1: Bus registered

To the onlookers, do not try to run at this stage, b43 will trigger a kernel panic on load trying to access unavailable locations on the shim, if you wish to try it, build b43 as a kernel module and then load it from /tmp, it will crash anyway, but at least the router will only hard reset. I am working out a patch to fix this from bcma, leaving b43 with minimal patches for 2.4Ghz

Yes, forward steps finally, no more kernel panic, now i need to fix dma and rewire the bits inside b43 for the rev 8 phy:

[  245.490000] Loading modules backported from Linux version v6.18.26-0-g1fe060681
[  245.490000] Backport generated by backports.git 6ecbb44
[  259.080000] b43-phy0: Broadcom 6362 WLAN found (core revision 22)
[  259.080000] bcma: bcma: synth RESET_CTL routed core=0x812 SHIM 00000001->00010001 (req 00000001)
[  259.090000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00010001->00012004 (req 00002004)
[  259.100000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00012004->00012007 (req 00002007)
[  259.110000] bcma: bcma: synth RESET_CTL routed core=0x812 SHIM 00012007->00002007 (req 00000000)
[  259.120000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002007->00002005 (req 00002005)
[  259.130000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002005->00000049 (req 00000049)
[  259.140000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00000049->00000003 (req 00000003)
[  259.150000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00000003->00000005 (req 00000005)
[  259.160000] b43-phy0: Found PHY: Analog 9, Type 4 (N), Revision 8
[  259.160000] b43-phy0 ERROR: FOUND UNSUPPORTED RADIO (Manuf 0x17F, ID 0x2057, Revision 8, Version 0)
[  259.170000] b43 bcma0:1: probe with driver b43 failed with error -122
[  259.180000] b43-phy1: Broadcom 4352 WLAN found (core revision 42)
[  259.180000] b43-phy1: Found PHY: Analog 12, Type 11 (AC), Revision 1
[  259.190000] b43-phy1: Found Radio: Manuf 0x17F, ID 0x2069, Revision 4, Version 0
[  259.200000] Broadcom 43xx driver loaded [ Features: NL ]
[  259.220000] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
[  264.830000] b43-phy1: Loading firmware version 784.2 (2012-08-15 21:43:22)
[  264.840000] b43-phy1: phy-ac: rxgain_init applied (2 cores, UNII-1 5gl, sprom rev 11)
[  264.840000] b43-phy1: phy-ac: rxgain core0: triso=6 elnagain=3 trelnabyp=1 (gainctx=0x14)
[  264.850000] b43-phy1: phy-ac: rxgain core1: triso=6 elnagain=3 trelnabyp=1 (gainctx=0x14)
[  264.950000] br-lan: port 5(phy1-ap0) entered blocking state
[  264.960000] br-lan: port 5(phy1-ap0) entered disabled state
[  264.960000] b43 bcma1:1 phy1-ap0: entered allmulticast mode
[  264.970000] b43 bcma1:1 phy1-ap0: entered promiscuous mode
[  265.030000] br-lan: port 5(phy1-ap0) entered blocking state
[  265.030000] br-lan: port 5(phy1-ap0) entered forwarding state

Bring up for the integrated WLAN complete!!!!!
D11 core is on and running, missing the IPA tables, so not working yet, but progress finally.

[  329.170000] Broadcom 43xx driver loaded [ Features: NL ]
[  366.680000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00010000->00012007 (req 00002007)
[  366.690000] bcma: bcma: synth RESET_CTL routed core=0x812 SHIM 00012007->00002007 (req 00000000)
[  366.690000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002007->00002005 (req 00002005)
[  366.700000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002005->0000204d (req 0000204d)
[  366.710000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 0000204d->00002043 (req 00002043)
[  366.720000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002043->00002045 (req 00002045)
[  366.830000] b43-phy0: DEBUG pre-PSM_RUN: MACCTL=0x80020504 IRQ_REASON=0x00000000 SHM[UCODEREV]=0x0000
[  366.840000] b43-phy0: DEBUG post-PSM_RUN: MACCTL=0x80020502 IRQ_REASON=0x00000000
[  366.850000] b43-phy0: Loading firmware version 784.2 (2012-08-15 21:35:19)
[  366.870000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002045->00002047 (req 00002047)
[  366.880000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002047->00002045 (req 00002045)
[  366.890000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002045->00002055 (req 00002055)
[  366.900000] b43-phy0 ERROR: No 2GHz IPA gain table available for this device
[  366.910000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002055->00002057 (req 00002057)
[  366.910000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002057->00002055 (req 00002055)
[  366.920000] b43-phy0 ERROR: No 2GHz IPA gain table available for this device
[  366.970000] b43-phy0 ERROR: PHY init: Channel switch to default failed

Ok, now base setup is complete for integrated wlan, the interface at 147 the interface is being set up, but the it gets disabled:

[  140.640000] Broadcom 43xx driver loaded [ Features: NL ]
[  140.740000] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
[  146.650000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00010000->00012007 (req 00002007)
[  146.660000] bcma: bcma: synth RESET_CTL routed core=0x812 SHIM 00012007->00002007 (req 00000000)
[  146.670000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002007->00002005 (req 00002005)
[  146.680000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002005->0000204d (req 0000204d)
[  146.690000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 0000204d->00002043 (req 00002043)
[  146.700000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002043->00002045 (req 00002045)
[  146.810000] b43-phy0: DEBUG pre-PSM_RUN: MACCTL=0x80020504 IRQ_REASON=0x00000000 SHM[UCODEREV]=0x0000
[  146.820000] b43-phy0: DEBUG post-PSM_RUN: MACCTL=0x80020502 IRQ_REASON=0x00000000
[  146.830000] b43-phy0: Loading firmware version 784.2 (2012-08-15 21:35:19)
[  146.840000] bcma-host-soc 10004000.axi: bus0: Unknown spuravoidance settings for chip 0x6362, not changing PLL
[  146.850000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002045->00002047 (req 00002047)
[  146.860000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002047->00002045 (req 00002045)
[  146.900000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002045->00002047 (req 00002047)
[  146.910000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002047->00002045 (req 00002045)
[  146.920000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002045->00002055 (req 00002055)
[  146.930000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002055->00002057 (req 00002057)
[  146.940000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002057->00002055 (req 00002055)
[  147.030000] bcma-host-soc 10004000.axi: bus0: Unknown spuravoidance settings for chip 0x6362, not changing PLL
[  147.040000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002055->00002057 (req 00002057)
[  147.050000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002057->00002055 (req 00002055)
[  147.080000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002055->00002055 (req 00002055)
[  147.090000] b43-phy0: DEBUG dma_setup RX DMA64: ringbase=0x01980000 addrlo=0x01980000 addrhi=0x00000000 addrext=0x0 translation=0x00000000 in_low=0 ctl=0x0000084d
[  147.100000] bcma-host-soc 10004000.axi: bus0: Unknown spuravoidance settings for chip 0x6362, not changing PLL
[  147.110000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002055->00002057 (req 00002057)
[  147.120000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002057->00002055 (req 00002055)
[  147.160000] bcma-host-soc 10004000.axi: bus0: Unknown spuravoidance settings for chip 0x6362, not changing PLL
[  147.170000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002055->00002057 (req 00002057)
[  147.180000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00002057->00002055 (req 00002055)
[  147.210000] br-lan: port 5(phy0-ap0) entered blocking state
[  147.220000] br-lan: port 5(phy0-ap0) entered disabled state
[  147.230000] b43 bcma0:1 phy0-ap0: entered allmulticast mode
[  147.230000] b43 bcma0:1 phy0-ap0: entered promiscuous mode
[  147.300000] b43 bcma0:1 phy0-ap0: left allmulticast mode
[  147.300000] b43 bcma0:1 phy0-ap0: left promiscuous mode
[  147.310000] br-lan: port 5(phy0-ap0) entered disabled state
[  147.550000] bcma: bcma: synth RESET_CTL routed core=0x812 SHIM 00002055->00012055 (req 00000001)
[  147.550000] bcma: bcma: synth IOCTL routed core=0x812 SHIM 00012055->00010000 (req 00000000)

How stupid i am, i was just missing the regulatory config.
Integrated WLAN is UP! And i can connect from my phone.

Only the pci-e addon 4352 on 5Ghz left to configure. Will post all the patches upstream for the integrated wlan

Sun May 17 21:42:34 2026 daemon.notice hostapd: Set new config for phy phy0: /var/run/hostapd-phy0.conf
Sun May 17 21:42:34 2026 daemon.notice hostapd: Restart interface for phy phy0
Sun May 17 21:42:34 2026 daemon.notice hostapd: Configuration file: <inline> (phy phy0) --> new PHY
Sun May 17 21:42:34 2026 daemon.notice hostapd: Configuration file: Reading configuration file '<inline>'
Sun May 17 21:42:34 2026 daemon.notice hostapd: Configuration file: Reading configuration file '<inline>'
Sun May 17 21:42:34 2026 daemon.notice hostapd: phy0-ap0: interface state UNINITIALIZED->COUNTRY_UPDATE
Sun May 17 21:42:35 2026 daemon.notice hostapd: phy0-ap0: interface state COUNTRY_UPDATE->ENABLED
Sun May 17 21:42:35 2026 daemon.notice hostapd: phy0-ap0: AP-ENABLED

I posted some patches for b43 upstream and created a cleaned up version in https://github.com/aleferri/openwrt-dev on the main branch if you want to test the device (only integrated wlan working).

DMA now works for AC, all good, TX next