enjoy-digital / litesdcard

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

Add pin to detect sdcard presence in card reader slot. #11

Closed mateusz-holenko closed 4 years ago

mateusz-holenko commented 4 years ago

This adds a new CSR exposing a bit indicating if the card is present. If there is no card detection pin available in the HW it's assume that the card is inserted.

enjoy-digital commented 4 years ago

Thanks this is merged but has been revisited a bit with https://github.com/enjoy-digital/litesdcard/commit/532eccbcceb9f81dc7b08c8a0fe224822c7f1c74. It is assuming a cd pin defined like this: https://github.com/enjoy-digital/litex/commit/2e59dc329d57f5cbacc69eae6020f1099103a956.

mateusz-holenko commented 4 years ago

Thanks!

Moving the declaration of card_detect to phy.py might have changed the order in which CSRs are genreated so we'll have to verify if the Linux driver we PRed in https://github.com/litex-hub/linux-on-litex-vexriscv/pull/133 still works.

enjoy-digital commented 4 years ago

Yes the software will indeed need to be adapted, sorry for breaking it, but card detection is something that belongs to the PHY.