2022-01-01 20:27:36

by Stefan Wahren

[permalink] [raw]
Subject: [PATCH RFC 0/4] ARM: dts: Add Raspberry Pi Zero 2 W support

This small series tries to add support for the Raspberry Pi Zero 2 W.

Stefan Wahren (4):
brcmfmac: use separate firmware for 43430 revision 4
dt-bindings: arm: bcm2835: Add Raspberry Pi Zero 2 W
ARM: dts: Add Raspberry Pi Zero 2 W
arm64: dts: broadcom: Add reference to RPi Zero 2 W

.../devicetree/bindings/arm/bcm/bcm2835.yaml | 1 +
arch/arm/boot/dts/Makefile | 1 +
arch/arm/boot/dts/bcm2837-rpi-zero-2-w.dts | 136 +++++++++++++++++++++
arch/arm64/boot/dts/broadcom/Makefile | 3 +-
.../boot/dts/broadcom/bcm2837-rpi-zero-2-w.dts | 2 +
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 +-
6 files changed, 145 insertions(+), 2 deletions(-)
create mode 100644 arch/arm/boot/dts/bcm2837-rpi-zero-2-w.dts
create mode 100644 arch/arm64/boot/dts/broadcom/bcm2837-rpi-zero-2-w.dts

--
2.7.4



2022-01-01 20:27:39

by Stefan Wahren

[permalink] [raw]
Subject: [PATCH RFC 1/4] brcmfmac: use separate firmware for 43430 revision 4

A separate firmware is needed, for Broadcom 43430 revision 4. This
chip can be found on e.g. certain revisions of Raspberry Pi Zero 2 W.
Original firmware file from IC vendor is named 'brcmfmac43436-sdio.bin',
but brcmfmac and also btbcm drivers report chip id 43430, so requested
firmware file name is 'brcmfmac43430c0-sdio.bin' in line with other
43430 revisions.

Signed-off-by: Stefan Wahren <[email protected]>
---

Hi,
i'm not sure about all these mappings. All i can say is that the wifi
interface of the RPi Zero 2 cames up with this patch.

drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index 8effeb7..c79bd47 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -618,6 +618,7 @@ BRCMF_FW_DEF(43430A0, "brcmfmac43430a0-sdio");
/* Note the names are not postfixed with a1 for backward compatibility */
BRCMF_FW_CLM_DEF(43430A1, "brcmfmac43430-sdio");
BRCMF_FW_DEF(43430B0, "brcmfmac43430b0-sdio");
+BRCMF_FW_CLM_DEF(43430C0, "brcmfmac43430c0-sdio");
BRCMF_FW_CLM_DEF(43455, "brcmfmac43455-sdio");
BRCMF_FW_DEF(43456, "brcmfmac43456-sdio");
BRCMF_FW_CLM_DEF(4354, "brcmfmac4354-sdio");
@@ -649,7 +650,8 @@ static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
BRCMF_FW_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339),
BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000001, 43430A0),
BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000002, 43430A1),
- BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFFC, 43430B0),
+ BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000004, 43430C0),
+ BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFF8, 43430B0),
BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0x00000200, 43456),
BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFDC0, 43455),
BRCMF_FW_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354),
--
2.7.4


2022-01-01 20:27:39

by Stefan Wahren

[permalink] [raw]
Subject: [PATCH RFC 4/4] arm64: dts: broadcom: Add reference to RPi Zero 2 W

This adds a reference to the dts of the Raspberry Pi Zero 2 W,
so we don't need to maintain the content in arm64.

Signed-off-by: Stefan Wahren <[email protected]>
---
arch/arm64/boot/dts/broadcom/Makefile | 3 ++-
arch/arm64/boot/dts/broadcom/bcm2837-rpi-zero-2-w.dts | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
create mode 100644 arch/arm64/boot/dts/broadcom/bcm2837-rpi-zero-2-w.dts

diff --git a/arch/arm64/boot/dts/broadcom/Makefile b/arch/arm64/boot/dts/broadcom/Makefile
index c688203..5082fcd 100644
--- a/arch/arm64/boot/dts/broadcom/Makefile
+++ b/arch/arm64/boot/dts/broadcom/Makefile
@@ -5,7 +5,8 @@ dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-400.dtb \
bcm2837-rpi-3-a-plus.dtb \
bcm2837-rpi-3-b.dtb \
bcm2837-rpi-3-b-plus.dtb \
- bcm2837-rpi-cm3-io3.dtb
+ bcm2837-rpi-cm3-io3.dtb \
+ bcm2837-rpi-zero-2-w.dtb

subdir-y += bcm4908
subdir-y += northstar2
diff --git a/arch/arm64/boot/dts/broadcom/bcm2837-rpi-zero-2-w.dts b/arch/arm64/boot/dts/broadcom/bcm2837-rpi-zero-2-w.dts
new file mode 100644
index 0000000..307ae69
--- /dev/null
+++ b/arch/arm64/boot/dts/broadcom/bcm2837-rpi-zero-2-w.dts
@@ -0,0 +1,2 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "arm/bcm2837-rpi-zero-2-w.dts"
--
2.7.4


2022-01-23 15:11:03

by Stefan Wahren

[permalink] [raw]
Subject: Re: [PATCH RFC 1/4] brcmfmac: use separate firmware for 43430 revision 4

Am 01.01.22 um 21:26 schrieb Stefan Wahren:
> A separate firmware is needed, for Broadcom 43430 revision 4. This
> chip can be found on e.g. certain revisions of Raspberry Pi Zero 2 W.
> Original firmware file from IC vendor is named 'brcmfmac43436-sdio.bin',
> but brcmfmac and also btbcm drivers report chip id 43430, so requested
> firmware file name is 'brcmfmac43430c0-sdio.bin' in line with other
> 43430 revisions.
>
> Signed-off-by: Stefan Wahren <[email protected]>
> ---
>
> Hi,
> i'm not sure about all these mappings. All i can say is that the wifi
> interface of the RPi Zero 2 cames up with this patch.
gentle ping (yes, i'm aware of the merge window)
>
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
> index 8effeb7..c79bd47 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
> @@ -618,6 +618,7 @@ BRCMF_FW_DEF(43430A0, "brcmfmac43430a0-sdio");
> /* Note the names are not postfixed with a1 for backward compatibility */
> BRCMF_FW_CLM_DEF(43430A1, "brcmfmac43430-sdio");
> BRCMF_FW_DEF(43430B0, "brcmfmac43430b0-sdio");
> +BRCMF_FW_CLM_DEF(43430C0, "brcmfmac43430c0-sdio");
> BRCMF_FW_CLM_DEF(43455, "brcmfmac43455-sdio");
> BRCMF_FW_DEF(43456, "brcmfmac43456-sdio");
> BRCMF_FW_CLM_DEF(4354, "brcmfmac4354-sdio");
> @@ -649,7 +650,8 @@ static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
> BRCMF_FW_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339),
> BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000001, 43430A0),
> BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000002, 43430A1),
> - BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFFC, 43430B0),
> + BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000004, 43430C0),
> + BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFF8, 43430B0),
> BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0x00000200, 43456),
> BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFDC0, 43455),
> BRCMF_FW_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354),

2022-01-24 18:59:33

by Arend Van Spriel

[permalink] [raw]
Subject: Re: [PATCH RFC 1/4] brcmfmac: use separate firmware for 43430 revision 4

On 1/22/2022 1:35 PM, Stefan Wahren wrote:
> Am 01.01.22 um 21:26 schrieb Stefan Wahren:
>> A separate firmware is needed, for Broadcom 43430 revision 4. This
>> chip can be found on e.g. certain revisions of Raspberry Pi Zero 2 W.
>> Original firmware file from IC vendor is named 'brcmfmac43436-sdio.bin',
>> but brcmfmac and also btbcm drivers report chip id 43430, so requested
>> firmware file name is 'brcmfmac43430c0-sdio.bin' in line with other
>> 43430 revisions.
>>
>> Signed-off-by: Stefan Wahren <[email protected]>
>> ---
>>
>> Hi,
>> i'm not sure about all these mappings. All i can say is that the wifi
>> interface of the RPi Zero 2 cames up with this patch.
> gentle ping (yes, i'm aware of the merge window)

Sorry, Stefan

Should have seen this earlier, but here it is....

>>
>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>> index 8effeb7..c79bd47 100644
>> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>> @@ -618,6 +618,7 @@ BRCMF_FW_DEF(43430A0, "brcmfmac43430a0-sdio");
>> /* Note the names are not postfixed with a1 for backward compatibility */
>> BRCMF_FW_CLM_DEF(43430A1, "brcmfmac43430-sdio");
>> BRCMF_FW_DEF(43430B0, "brcmfmac43430b0-sdio");
>> +BRCMF_FW_CLM_DEF(43430C0, "brcmfmac43430c0-sdio");
>> BRCMF_FW_CLM_DEF(43455, "brcmfmac43455-sdio");
>> BRCMF_FW_DEF(43456, "brcmfmac43456-sdio");
>> BRCMF_FW_CLM_DEF(4354, "brcmfmac4354-sdio");
>> @@ -649,7 +650,8 @@ static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
>> BRCMF_FW_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339),
>> BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000001, 43430A0),
>> BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000002, 43430A1),
>> - BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFFC, 43430B0),
>> + BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000004, 43430C0),

According to the revision mask your firmware seems to be for numerical
revision 2 of this chip...

>> + BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFF8, 43430B0),

and for the b0 the chip revision is 3 (or higher). So the alphanumeric
revision of your chip would be 'a2' instead of 'c0'.

>> BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0x00000200, 43456),
>> BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFDC0, 43455),
>> BRCMF_FW_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354),


Attachments:
smime.p7s (4.12 kB)
S/MIME Cryptographic Signature

2022-02-01 10:28:31

by Stefan Wahren

[permalink] [raw]
Subject: Re: [PATCH RFC 1/4] brcmfmac: use separate firmware for 43430 revision 4

Hi Arend,

Am 24.01.22 um 10:43 schrieb Arend van Spriel:
> On 1/22/2022 1:35 PM, Stefan Wahren wrote:
>> Am 01.01.22 um 21:26 schrieb Stefan Wahren:
>>> A separate firmware is needed, for Broadcom 43430 revision 4. This
>>> chip can be found on e.g. certain revisions of Raspberry Pi Zero 2 W.
>>> Original firmware file from IC vendor is named
>>> 'brcmfmac43436-sdio.bin',
>>> but brcmfmac and also btbcm drivers report chip id 43430, so requested
>>> firmware file name is 'brcmfmac43430c0-sdio.bin' in line with other
>>> 43430 revisions.
>>>
>>> Signed-off-by: Stefan Wahren <[email protected]>
>>> ---
>>>
>>> Hi,
>>> i'm not sure about all these mappings. All i can say is that the wifi
>>> interface of the RPi Zero 2 cames up with this patch.
>> gentle ping (yes, i'm aware of the merge window)
>
> Sorry, Stefan
>
> Should have seen this earlier, but here it is....
>
>>>
>>>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 +++-
>>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>>> b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>>> index 8effeb7..c79bd47 100644
>>> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>>> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>>> @@ -618,6 +618,7 @@ BRCMF_FW_DEF(43430A0, "brcmfmac43430a0-sdio");
>>>   /* Note the names are not postfixed with a1 for backward
>>> compatibility */
>>>   BRCMF_FW_CLM_DEF(43430A1, "brcmfmac43430-sdio");
>>>   BRCMF_FW_DEF(43430B0, "brcmfmac43430b0-sdio");
>>> +BRCMF_FW_CLM_DEF(43430C0, "brcmfmac43430c0-sdio");
>>>   BRCMF_FW_CLM_DEF(43455, "brcmfmac43455-sdio");
>>>   BRCMF_FW_DEF(43456, "brcmfmac43456-sdio");
>>>   BRCMF_FW_CLM_DEF(4354, "brcmfmac4354-sdio");
>>> @@ -649,7 +650,8 @@ static const struct brcmf_firmware_mapping
>>> brcmf_sdio_fwnames[] = {
>>>       BRCMF_FW_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339),
>>>       BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000001, 43430A0),
>>>       BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000002, 43430A1),
>>> -    BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFFC, 43430B0),
>>> +    BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000004, 43430C0),
>
> According to the revision mask your firmware seems to be for numerical
> revision 2 of this chip...
>
>>> +    BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFF8, 43430B0),
>
> and for the b0 the chip revision is 3 (or higher). So the alphanumeric
> revision of your chip would be 'a2' instead of 'c0'.

i changed this to a2 for the next version of this series. But before i
send them out, please doublecheck the kernel log 5.17-rc1 of my RPi Zero
2 W. I confuses me that the bluetooth part tells about BCM43430B0:

[    9.653199] Bluetooth: hci0: BCM: chip id 115
[    9.653749] Bluetooth: hci0: BCM: features 0x0e
[    9.655466] Bluetooth: hci0: BCM43430B0
[    9.655502] Bluetooth: hci0: BCM43430B0 (002.001.012) build 0000
[    9.659512] vc4-drm soc:gpu: bound 3f400000.hvs (ops
vc4_drm_unregister [vc4])
[    9.667047] Bluetooth: hci0: BCM43430B0 'brcm/BCM43430B0.hcd' Patch
[    9.668052] brcmfmac: brcmf_fw_alloc_request: using
brcm/brcmfmac43430a2-sdio for chip BCM43430/2
[    9.668567] brcmfmac mmc1:0001:1: Direct firmware load for
brcm/brcmfmac43430a2-sdio.raspberrypi,model-zero-2-w.bin failed with
error -2
[    9.673724] vc4-drm soc:gpu: bound 3f400000.hvs (ops
vc4_drm_unregister [vc4])
[    9.697996] brcmfmac mmc1:0001:1: Direct firmware load for
brcm/brcmfmac43430a2-sdio.raspberrypi,model-zero-2-w.txt failed with
error -2
[    9.816030] brcmfmac: brcmf_fw_alloc_request: using
brcm/brcmfmac43430a2-sdio for chip BCM43430/2
[    9.840128] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/2
wl0: Oct  9 2020 14:44:32 version 9.88.4.65 (test) (f149b32@shgit) 
(r679549) FWID 01-f40f3270
[    9.919182] random: crng init done
[    9.919200] random: 7 urandom warning(s) missed due to ratelimiting
[   10.105524] vc4-drm soc:gpu: bound 3f400000.hvs (ops
vc4_drm_unregister [vc4])
[   10.118011] vc4-drm soc:gpu: bound 3f902000.hdmi (ops
vc4_drm_unregister [vc4])
[   10.118190] vc4-drm soc:gpu: bound 3f806000.vec (ops
vc4_drm_unregister [vc4])
[   10.118364] vc4-drm soc:gpu: bound 3f004000.txp (ops
vc4_drm_unregister [vc4])
[   10.118503] vc4-drm soc:gpu: bound 3f206000.pixelvalve (ops
vc4_drm_unregister [vc4])
[   10.118625] vc4-drm soc:gpu: bound 3f207000.pixelvalve (ops
vc4_drm_unregister [vc4])
[   10.118747] vc4-drm soc:gpu: bound 3f807000.pixelvalve (ops
vc4_drm_unregister [vc4])
[   10.118847] vc4-drm soc:gpu: bound 3fc00000.v3d (ops
vc4_drm_unregister [vc4])
[   10.119331] checking generic (1e330000 8ca000) vs hw (0 ffffffff)
[   10.119339] fb0: switching to vc4 from simple
[   10.122443] Console: switching to colour dummy device 80x30
[   10.125147] [drm] Initialized vc4 0.0.0 20140616 for soc:gpu on minor 0
[   10.203822] Console: switching to colour frame buffer device 240x75
[   10.241067] vc4-drm soc:gpu: [drm] fb0: vc4drmfb frame buffer device
[   10.414793] Bluetooth: hci0: BCM4343B0 37.4MHz wlbga_iLNA_iTR
[Baseline: 0092]
[   10.414822] Bluetooth: hci0: BCM43430B0 (002.001.012) build 0092

Thanks


2022-02-01 10:39:16

by Arend Van Spriel

[permalink] [raw]
Subject: Re: [PATCH RFC 1/4] brcmfmac: use separate firmware for 43430 revision 4

I am also a bit confused. The subject mentions revision 4, but your log
shows 43430/2. Took some digging but found that numerical rev 2 matches
'b0' and rev 3 matches 'b1'. The BT part is unknown territory for me so can
not clarify things there.

Regards,
Arend

On January 30, 2022 12:35:35 PM Stefan Wahren <[email protected]> wrote:

> Hi Arend,
>
> Am 24.01.22 um 10:43 schrieb Arend van Spriel:
>> On 1/22/2022 1:35 PM, Stefan Wahren wrote:
>>> Am 01.01.22 um 21:26 schrieb Stefan Wahren:
>>>> A separate firmware is needed, for Broadcom 43430 revision 4. This
>>>> chip can be found on e.g. certain revisions of Raspberry Pi Zero 2 W.
>>>> Original firmware file from IC vendor is named
>>>> 'brcmfmac43436-sdio.bin',
>>>> but brcmfmac and also btbcm drivers report chip id 43430, so requested
>>>> firmware file name is 'brcmfmac43430c0-sdio.bin' in line with other
>>>> 43430 revisions.
>>>>
>>>> Signed-off-by: Stefan Wahren <[email protected]>
>>>> ---
>>>>
>>>> Hi,
>>>> i'm not sure about all these mappings. All i can say is that the wifi
>>>> interface of the RPi Zero 2 cames up with this patch.
>>> gentle ping (yes, i'm aware of the merge window)
>>
>> Sorry, Stefan
>>
>> Should have seen this earlier, but here it is....
>>
>>>>
>>>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 +++-
>>>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>>>> b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>>>> index 8effeb7..c79bd47 100644
>>>> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>>>> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>>>> @@ -618,6 +618,7 @@ BRCMF_FW_DEF(43430A0, "brcmfmac43430a0-sdio");
>>>> /* Note the names are not postfixed with a1 for backward
>>>> compatibility */
>>>> BRCMF_FW_CLM_DEF(43430A1, "brcmfmac43430-sdio");
>>>> BRCMF_FW_DEF(43430B0, "brcmfmac43430b0-sdio");
>>>> +BRCMF_FW_CLM_DEF(43430C0, "brcmfmac43430c0-sdio");
>>>> BRCMF_FW_CLM_DEF(43455, "brcmfmac43455-sdio");
>>>> BRCMF_FW_DEF(43456, "brcmfmac43456-sdio");
>>>> BRCMF_FW_CLM_DEF(4354, "brcmfmac4354-sdio");
>>>> @@ -649,7 +650,8 @@ static const struct brcmf_firmware_mapping
>>>> brcmf_sdio_fwnames[] = {
>>>> BRCMF_FW_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339),
>>>> BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000001, 43430A0),
>>>> BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000002, 43430A1),
>>>> - BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFFC, 43430B0),
>>>> + BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000004, 43430C0),
>>
>> According to the revision mask your firmware seems to be for numerical
>> revision 2 of this chip...
>>
>>>> + BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFF8, 43430B0),
>>
>> and for the b0 the chip revision is 3 (or higher). So the alphanumeric
>> revision of your chip would be 'a2' instead of 'c0'.
>
> i changed this to a2 for the next version of this series. But before i
> send them out, please doublecheck the kernel log 5.17-rc1 of my RPi Zero
> 2 W. I confuses me that the bluetooth part tells about BCM43430B0:
>
> [ 9.653199] Bluetooth: hci0: BCM: chip id 115
> [ 9.653749] Bluetooth: hci0: BCM: features 0x0e
> [ 9.655466] Bluetooth: hci0: BCM43430B0
> [ 9.655502] Bluetooth: hci0: BCM43430B0 (002.001.012) build 0000
> [ 9.659512] vc4-drm soc:gpu: bound 3f400000.hvs (ops
> vc4_drm_unregister [vc4])
> [ 9.667047] Bluetooth: hci0: BCM43430B0 'brcm/BCM43430B0.hcd' Patch
> [ 9.668052] brcmfmac: brcmf_fw_alloc_request: using
> brcm/brcmfmac43430a2-sdio for chip BCM43430/2
> [ 9.668567] brcmfmac mmc1:0001:1: Direct firmware load for
> brcm/brcmfmac43430a2-sdio.raspberrypi,model-zero-2-w.bin failed with
> error -2
> [ 9.673724] vc4-drm soc:gpu: bound 3f400000.hvs (ops
> vc4_drm_unregister [vc4])
> [ 9.697996] brcmfmac mmc1:0001:1: Direct firmware load for
> brcm/brcmfmac43430a2-sdio.raspberrypi,model-zero-2-w.txt failed with
> error -2
> [ 9.816030] brcmfmac: brcmf_fw_alloc_request: using
> brcm/brcmfmac43430a2-sdio for chip BCM43430/2
> [ 9.840128] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/2
> wl0: Oct 9 2020 14:44:32 version 9.88.4.65 (test) (f149b32@shgit)
> (r679549) FWID 01-f40f3270
> [ 9.919182] random: crng init done
> [ 9.919200] random: 7 urandom warning(s) missed due to ratelimiting
> [ 10.105524] vc4-drm soc:gpu: bound 3f400000.hvs (ops
> vc4_drm_unregister [vc4])
> [ 10.118011] vc4-drm soc:gpu: bound 3f902000.hdmi (ops
> vc4_drm_unregister [vc4])
> [ 10.118190] vc4-drm soc:gpu: bound 3f806000.vec (ops
> vc4_drm_unregister [vc4])
> [ 10.118364] vc4-drm soc:gpu: bound 3f004000.txp (ops
> vc4_drm_unregister [vc4])
> [ 10.118503] vc4-drm soc:gpu: bound 3f206000.pixelvalve (ops
> vc4_drm_unregister [vc4])
> [ 10.118625] vc4-drm soc:gpu: bound 3f207000.pixelvalve (ops
> vc4_drm_unregister [vc4])
> [ 10.118747] vc4-drm soc:gpu: bound 3f807000.pixelvalve (ops
> vc4_drm_unregister [vc4])
> [ 10.118847] vc4-drm soc:gpu: bound 3fc00000.v3d (ops
> vc4_drm_unregister [vc4])
> [ 10.119331] checking generic (1e330000 8ca000) vs hw (0 ffffffff)
> [ 10.119339] fb0: switching to vc4 from simple
> [ 10.122443] Console: switching to colour dummy device 80x30
> [ 10.125147] [drm] Initialized vc4 0.0.0 20140616 for soc:gpu on minor 0
> [ 10.203822] Console: switching to colour frame buffer device 240x75
> [ 10.241067] vc4-drm soc:gpu: [drm] fb0: vc4drmfb frame buffer device
> [ 10.414793] Bluetooth: hci0: BCM4343B0 37.4MHz wlbga_iLNA_iTR
> [Baseline: 0092]
> [ 10.414822] Bluetooth: hci0: BCM43430B0 (002.001.012) build 0092
>
> Thanks




Attachments:
smime.p7s (4.12 kB)
S/MIME Cryptographic Signature

2022-02-01 20:46:48

by Stefan Wahren

[permalink] [raw]
Subject: Re: [PATCH RFC 1/4] brcmfmac: use separate firmware for 43430 revision 4

Hi Arend,

Am 30.01.22 um 13:56 schrieb Arend Van Spriel:
> I am also a bit confused. The subject mentions revision 4, but your
> log shows 43430/2. Took some digging but found that numerical rev 2
> matches 'b0' and rev 3 matches 'b1'. The BT part is unknown territory
> for me so can not clarify things there.

my patch based on a similar patch [1] by Mikhail Rudenko. I falsely
assumed that the Ampak AP6212 and Raspberry Pi Zero 2 W are using
different wifi chips. But now it i think they are identical. If i grep
the firmware blob for the Raspberry Pi Zero 2 W, i getting this:

# strings firmware.bin | grep 4343
43436b0-roml/sdio-g-pool-p2p-pno-pktfilter-keepalive-aoe-mchan-proptxstatus-ampduhostreorder-lpc-wl11u-fmc-wepso-anqpo-srmem-srfast-11nprop-ob-ndoe-rssiindur-bcol-gtr-mfp-sdiorxenhance-extsae
Version: 9.88.4.65 (test) (f149b32@shgit)? (r679549) CRC: 3e0bc4b6 Date:
Fri 2020-10-09 14:45:07 CST Ucode Ver: 1043.20742 FWID: 01-f40f3270

So i will drop this patch from the series and hope the firmware isn't
customized.

Best regards

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.17-rc2&id=f8d6523891cf07468f0bfe21aba8b562a6f75780

>
> Regards,
> Arend
>
> On January 30, 2022 12:35:35 PM Stefan Wahren <[email protected]>
> wrote:
>
>> Hi Arend,
>>
>> Am 24.01.22 um 10:43 schrieb Arend van Spriel:
>>> On 1/22/2022 1:35 PM, Stefan Wahren wrote:
>>>> Am 01.01.22 um 21:26 schrieb Stefan Wahren:
>>>>> A separate firmware is needed, for Broadcom 43430 revision 4. This
>>>>> chip can be found on e.g. certain revisions of Raspberry Pi Zero 2 W.
>>>>> Original firmware file from IC vendor is named
>>>>> 'brcmfmac43436-sdio.bin',
>>>>> but brcmfmac and also btbcm drivers report chip id 43430, so
>>>>> requested
>>>>> firmware file name is 'brcmfmac43430c0-sdio.bin' in line with other
>>>>> 43430 revisions.
>>>>>
>>>>> Signed-off-by: Stefan Wahren <[email protected]>
>>>>> ---
>>>>>
>>>>> Hi,
>>>>> i'm not sure about all these mappings. All i can say is that the wifi
>>>>> interface of the RPi Zero 2 cames up with this patch.
>>>> gentle ping (yes, i'm aware of the merge window)
>>>
>>> Sorry, Stefan
>>>
>>> Should have seen this earlier, but here it is....
>>>
>>>>>
>>>>> ?drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 +++-
>>>>> ?1 file changed, 3 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>>>>> b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>>>>> index 8effeb7..c79bd47 100644
>>>>> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>>>>> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>>>>> @@ -618,6 +618,7 @@ BRCMF_FW_DEF(43430A0, "brcmfmac43430a0-sdio");
>>>>> ?/* Note the names are not postfixed with a1 for backward
>>>>> compatibility */
>>>>> ?BRCMF_FW_CLM_DEF(43430A1, "brcmfmac43430-sdio");
>>>>> ?BRCMF_FW_DEF(43430B0, "brcmfmac43430b0-sdio");
>>>>> +BRCMF_FW_CLM_DEF(43430C0, "brcmfmac43430c0-sdio");
>>>>> ?BRCMF_FW_CLM_DEF(43455, "brcmfmac43455-sdio");
>>>>> ?BRCMF_FW_DEF(43456, "brcmfmac43456-sdio");
>>>>> ?BRCMF_FW_CLM_DEF(4354, "brcmfmac4354-sdio");
>>>>> @@ -649,7 +650,8 @@ static const struct brcmf_firmware_mapping
>>>>> brcmf_sdio_fwnames[] = {
>>>>> ???? BRCMF_FW_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339),
>>>>> ???? BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000001, 43430A0),
>>>>> ???? BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000002, 43430A1),
>>>>> -??? BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFFC, 43430B0),
>>>>> +??? BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000004, 43430C0),
>>>
>>> According to the revision mask your firmware seems to be for numerical
>>> revision 2 of this chip...
>>>
>>>>> +??? BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFF8, 43430B0),
>>>
>>> and for the b0 the chip revision is 3 (or higher). So the alphanumeric
>>> revision of your chip would be 'a2' instead of 'c0'.
>>
>> i changed this to a2 for the next version of this series. But before i
>> send them out, please doublecheck the kernel log 5.17-rc1 of my RPi Zero
>> 2 W. I confuses me that the bluetooth part tells about BCM43430B0:
>>
>> [??? 9.653199] Bluetooth: hci0: BCM: chip id 115
>> [??? 9.653749] Bluetooth: hci0: BCM: features 0x0e
>> [??? 9.655466] Bluetooth: hci0: BCM43430B0
>> [??? 9.655502] Bluetooth: hci0: BCM43430B0 (002.001.012) build 0000
>> [??? 9.659512] vc4-drm soc:gpu: bound 3f400000.hvs (ops
>> vc4_drm_unregister [vc4])
>> [??? 9.667047] Bluetooth: hci0: BCM43430B0 'brcm/BCM43430B0.hcd' Patch
>> [??? 9.668052] brcmfmac: brcmf_fw_alloc_request: using
>> brcm/brcmfmac43430a2-sdio for chip BCM43430/2
>> [??? 9.668567] brcmfmac mmc1:0001:1: Direct firmware load for
>> brcm/brcmfmac43430a2-sdio.raspberrypi,model-zero-2-w.bin failed with
>> error -2
>> [??? 9.673724] vc4-drm soc:gpu: bound 3f400000.hvs (ops
>> vc4_drm_unregister [vc4])
>> [??? 9.697996] brcmfmac mmc1:0001:1: Direct firmware load for
>> brcm/brcmfmac43430a2-sdio.raspberrypi,model-zero-2-w.txt failed with
>> error -2
>> [??? 9.816030] brcmfmac: brcmf_fw_alloc_request: using
>> brcm/brcmfmac43430a2-sdio for chip BCM43430/2
>> [??? 9.840128] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/2
>> wl0: Oct? 9 2020 14:44:32 version 9.88.4.65 (test) (f149b32@shgit)
>> (r679549) FWID 01-f40f3270
>> [??? 9.919182] random: crng init done
>> [??? 9.919200] random: 7 urandom warning(s) missed due to ratelimiting
>> [?? 10.105524] vc4-drm soc:gpu: bound 3f400000.hvs (ops
>> vc4_drm_unregister [vc4])
>> [?? 10.118011] vc4-drm soc:gpu: bound 3f902000.hdmi (ops
>> vc4_drm_unregister [vc4])
>> [?? 10.118190] vc4-drm soc:gpu: bound 3f806000.vec (ops
>> vc4_drm_unregister [vc4])
>> [?? 10.118364] vc4-drm soc:gpu: bound 3f004000.txp (ops
>> vc4_drm_unregister [vc4])
>> [?? 10.118503] vc4-drm soc:gpu: bound 3f206000.pixelvalve (ops
>> vc4_drm_unregister [vc4])
>> [?? 10.118625] vc4-drm soc:gpu: bound 3f207000.pixelvalve (ops
>> vc4_drm_unregister [vc4])
>> [?? 10.118747] vc4-drm soc:gpu: bound 3f807000.pixelvalve (ops
>> vc4_drm_unregister [vc4])
>> [?? 10.118847] vc4-drm soc:gpu: bound 3fc00000.v3d (ops
>> vc4_drm_unregister [vc4])
>> [?? 10.119331] checking generic (1e330000 8ca000) vs hw (0 ffffffff)
>> [?? 10.119339] fb0: switching to vc4 from simple
>> [?? 10.122443] Console: switching to colour dummy device 80x30
>> [?? 10.125147] [drm] Initialized vc4 0.0.0 20140616 for soc:gpu on
>> minor 0
>> [?? 10.203822] Console: switching to colour frame buffer device 240x75
>> [?? 10.241067] vc4-drm soc:gpu: [drm] fb0: vc4drmfb frame buffer device
>> [?? 10.414793] Bluetooth: hci0: BCM4343B0 37.4MHz wlbga_iLNA_iTR
>> [Baseline: 0092]
>> [?? 10.414822] Bluetooth: hci0: BCM43430B0 (002.001.012) build 0092
>>
>> Thanks
>
>
>