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

hw/drivers/mmc: Fix Multiple Block Read CMD18 #3036

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

kasjer
Copy link
Contributor

@kasjer kasjer commented Jul 12, 2023

This PR:

  • fixes CMD18 multiple block read where read control token and CRC were handled correctly only if single block was read
  • adds code that switches to higher speed after initialization (was marked as TODO:)

For multiply block read control token and CRC is send
for each block not just the first one.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
@kasjer kasjer force-pushed the kasjer/mmc-fixes branch 2 times, most recently from d7ed322 to 94ea8e9 Compare July 12, 2023 06:25
mmc->ss_pin = ss_pin;
mmc->spi_cfg = spi_cfg;
mmc->settings = &mmc_settings;
mmc->mmc_spi_cfg = *(struct mmc_spi_cfg *)spi_cfg;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: this cast is no longer needed (as spi_cfg is not void * anymore)

Baudrate for mmc was hardcoded to 125kHz to work with NRF5x.
mmc_init had spi_cfg parameter that was of type void * and was not used.

Now this parameter is of type mmc_spi_cfg that specifies both initial
baudrate and higher speed baudrate and also clock phase which turns out
that can be other then MODE0.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
@kasjer kasjer merged commit 4ba7829 into apache:master Jul 14, 2023
9 checks passed
@kasjer kasjer deleted the kasjer/mmc-fixes branch July 14, 2023 08:38
@kasjer kasjer mentioned this pull request Sep 21, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants