Skip to content

Litex/mmc improvement - #17

Closed
inochisa wants to merge 2 commits into
litex-hub:litex-rebasefrom
inochisa:litex/mmc-improvement
Closed

inochisa wants to merge 2 commits into
litex-hub:litex-rebasefrom
inochisa:litex/mmc-improvement

Conversation

@inochisa

Copy link
Copy Markdown

The litex_mmc driver assumes the card is already probed in the BIOS
and skip the phy initialization. This will cause the command fail
like the following when the old card is unplugged and then insert
a new card:

[   62.923593] litex-mmc f0004000.mmc: Command (cmd 8) error, status -110
[   62.949717] litex-mmc f0004000.mmc: Command (cmd 55) error, status -110
[   62.976606] litex-mmc f0004000.mmc: Command (cmd 55) error, status -110
[   63.002516] litex-mmc f0004000.mmc: Command (cmd 55) error, status -110
[   63.028442] litex-mmc f0004000.mmc: Command (cmd 55) error, status -110

Add required clock settings and initialization for the CMD 0, so it can
probe the new card.

Fixes: 92e0991 ("mmc: Add driver for LiteX's LiteSDCard interface")
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
@inochisa

Copy link
Copy Markdown
Author

Hi, @gsomlo. Could you take a look at this?

The current implementation requires a fixed 4-bits bus width, it
can not be satisfied by all the litex hardware generation. Remove
this restriction so the hardware with 1-bit bus width can be used.

Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
@inochisa
inochisa force-pushed the litex/mmc-improvement branch from 929adb0 to e3c3614 Compare May 19, 2026 04:42
@gsomlo

gsomlo commented May 19, 2026 via email

Copy link
Copy Markdown

@gsomlo gsomlo closed this May 19, 2026
@inochisa

Copy link
Copy Markdown
Author

Great to know, I opened this PR as a fast check to see if the problem should be solved. At last I will go through LKML. It is a good feedback for me to know the problem (Also for patch 2). I will try to figure the real problem is. Thanks.

@gsomlo

gsomlo commented May 19, 2026 via email

Copy link
Copy Markdown

@inochisa

Copy link
Copy Markdown
Author

Yeah, you are right. I will go through LKML for this.
I guess I have found the real reason for this part (I guess I handled the IDLE command in a wrong way). I will update a new patch for you in the LKML. :)

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.

2 participants