On 10/9/2018 8:10 PM, Christoph Müllner wrote:
Hi Arend,
recently I got an SDIO module, which includes a BCM4359.
I tried to get it up and running via the SD card interface
on a RK3399 SoC and succeeded in doing so with
bcmdhd.1.579.77.41.x and a vendor kernel (based on Linux 4.4).
All that was necessary was configure BCMDHD to run with
in-band IRQs and use a GPIO as gpio_wl_reg_on.
Since I can run a mainline kernel as well, I gave it a try and
tried brcmfmac on Linux 4.19-rc7. As the BCM4359 is not in
the list of supported SDIO devices, but is supported USB device,
I've created a patch (attached), which adds the support for that device.
Okay. However, I should say that there is no BCM4359 USB device.
Regardless the patch looks okay.
Additionally I've patched my DTS to include the WL_REG_ON
pin as part of mmc-pwrseq-simple's reset-gpios and added
a bcm4329-fmac node in the mmc node.
During bootup I see messages from brcmfmac, which indicate
that the BCM4359 has been found, but loading the nvram file
continuously fails:
[ 5.993741] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4359-sdio for chip BCM4359/9
[...]
[ 7.987167] brcmfmac: brcmf_sdiod_ramrw: membytes transfer failed
[ 8.008715] brcmfmac: brcmf_sdio_verifymemory: error -84 on reading 2048 membytes at 0x0025f1f0
[ 8.021182] brcmfmac: brcmf_sdio_download_firmware: dongle nvram file download failed
That -84 means EILSEQ, which is the error value, which represents
a CRC error during SDIO data exchange (returned by the function dw_mci_data_complete()
in the MMC driver).
Whenever I see -84 my suspicion are about power-supply for the chip.
However, it may also be the mmc host driver not adhering to so-called
"card busy" indication, which is in the SDIO spec.
To address this, I've reduced the clock speed (in several steps) to 400 kHz
(and verified the clock signal on an oscilloscope), but the issue persists.
I've also tried to use Linux 4.14.74, where I see the same issue.
I can confirm that the MMC interface works in general (I can use an SD card
to host my rootfs).
SD and SDIO are not the same thing. More importantly you have it working
with bcmdhd on a vendor kernel. So start from there.
FWIW I'm using the same exact same firmware and nvram file for the DHD driver
and the brcmfmac.
Noted.
Do you have any ideas how to debug this issue?
Would focus on getting logs from bcmdhd.
Regards,
Arend
Thanks,
Christoph