Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDIO Clock stopped in 'idle' mode #53

Open
MarcDorval opened this issue May 22, 2018 · 0 comments
Open

SDIO Clock stopped in 'idle' mode #53

MarcDorval opened this issue May 22, 2018 · 0 comments

Comments

@MarcDorval
Copy link

Hi Robert,

I'm facing an issue while trying to connect a WiFi chip to a Beaglebone black, using the mmc2 interface.

The issue occurs during the detection phase, right at the end of CMD0.

A typical SDIO part may not reply to CMD0 (as per the SDIO Physical Layer Simplified Specification), hence there mmc_clk is switched off 8 clock cycles after issuing CMD0's CRC7, when using the am335x on the BBB.
NB: Other SOCs (such as the Broadcom SoC used on Raspberry PI 2) keep the clock always on, and I don't have any issue using the latter, when using a Raspberry Pi.

The point is that my Wifi part is designed to reply to CMD0, so it starts replying but can only send the very first 3 bits (it takes 5 clock cycles to start the response), then the clock is turned off. The clock is turned on again later, while issuing CMD8, but there is a conflict there between the SoC trying to issue CMD8 and my part trying to complete its reply to CMD0.

My current workaround consists in hacking the kernel code (drivers/mmc/core/core.c:mmc_rescan_try_freq) to avoid calling mmc_go_idle for mmc2. This method works, but is not clean, since it requires rebuilding the kernel with very specific code.

I also experimented forcing bit CLKEXTFREE in the SD_CON register to 1. This works as well, but is still a kernel hack which I'd rather avoid.

I've been looking for the past days for a way to get a continuous clock in 'idle' mode, with no success so far.
It seems that there is something related to enabling IRQs using a GPIO (MMC2_DAT1 in my case) which could keep the clock active in idle, but I didn't find any detailed info about how to activate this in the device tree.

I believe I'm quite close to the solution, but still lacking some bits of information to get there.
Looks like I'm losing my way in the (device) tree...

Any help would be appreciated.

Best regards,
Marc Dorval

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant