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

fixes for boot and (single-block, cmd17-only) Linux driver #820

Merged
merged 2 commits into from
Feb 15, 2021
Merged

fixes for boot and (single-block, cmd17-only) Linux driver #820

merged 2 commits into from
Feb 15, 2021

Conversation

gsomlo
Copy link
Collaborator

@gsomlo gsomlo commented Feb 15, 2021

With the current sdcard clocking, when building a rocket-litex system at exactly 50 MHz, when 12.5 or 25 MHz are requested, it is possible to obtain those frequencies by using an exact power-of-two divisor for the sdclock (4 and 2, respectively). However, when driven at the full 25 MHz during sdcardboot, data transfer from the sdcard hangs. The first patch adds an additional halving of the sdclock frequency to ensure the sdclock frequency is never too fast for sdcardboot.

The second patch allows the current single-block-at-a-time (cmd17-only) Linux driver to avoid running into command timeouts when e.g., dd-ing a large file to /dev/null from the mounted sdcard. This doesn't help enable multi-block (cmd18) transfers without timeouts, but I will open a separate issue to keep track of those debugging efforts.

This allows the Linux driver in single-block mode (cmd17-only) to
operate solidly, without running into timeouts from LiteSDCard FSMs.

FIXME: multi-block (cmd18) transfers still time out, so revisit this
after some additional debugging.
When the system/bus clock frequency is an exact power-of-2 multiple of
the desired sdcard frequency, we can drive the latter at the "maximum"
speed via the "perfect" divider. That sometimes turns out too fast, so
in order to be conservative, we double the divider, thus halving the
resulting sdclock.
Copy link
Owner

@enjoy-digital enjoy-digital left a comment

Choose a reason for hiding this comment

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

Thanks @gsomlo, this looks fine and will indeed help stabilizing the Linux driver.

@enjoy-digital enjoy-digital merged commit 5291a64 into enjoy-digital:master Feb 15, 2021
@gsomlo gsomlo deleted the gls-sdcard-fixes branch February 15, 2021 16:12
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