enjoy-digital / litesdcard

Small footprint and configurable SDCard core
Other
107 stars 35 forks source link

Enable CRC check on cmd/data responses #15

Open enjoy-digital opened 4 years ago

enjoy-digital commented 4 years ago

CRC check on responses has been disabled as part of https://github.com/enjoy-digital/litesdcard/pull/7. We need to understand why this was needed and only disable it on the commands that are not returning a CRC.

paulusmack commented 3 years ago

Response types R2 and R3 don't contain a CRC, so commands 2, 9, 10 and app cmd 41 won't have a CRC in the response.

The Linux MMC layer uses the MMC_RSP_CRC bit in cmd->flags to indicate whether the response has a CRC, so the low-level driver doesn't need to know.

I'll have a look at adding a bit to the CMDCMD register to indicate whether the response CRC should be checked.