drivers: sdhc: litex: add support for litesdcard#93816
drivers: sdhc: litex: add support for litesdcard#93816maass-hamburg wants to merge 2 commits intozephyrproject-rtos:mainfrom
Conversation
baef1fc to
aa17acd
Compare
|
7e45bc7 to
66018ac
Compare
66018ac to
63df095
Compare
64cab63 to
0f7b26b
Compare
0f7b26b to
9fb9d0f
Compare
|
rebased because #97444 got merged, now between the other peripherals |
f930dc0 to
9a42908
Compare
| if (ret == 0) { | ||
| if ((cmd->opcode == SD_APP_SEND_SCR) && | ||
| (cmd->response[0] & SD_R1_APP_CMD)) { | ||
| sdhc_litex_check_cmd23_support(dev, data); |
There was a problem hiding this comment.
You should also be able to determine CMD23 support by looking at the timing the host selects, if UHS timing is used you can assume CMD23 is possible.
There was a problem hiding this comment.
litesdcard doesn't supports uhs (it doesn't support voltage switching), therefore this is the best way for now. Supoort for adding externel level translators (like https://www.ti.com/product/de-de/LSF0108/part-details/LSF0108PWR) might be added later.
| static const struct sdhc_litex_config sdhc_litex_config_##n = { \ | ||
| .irq_config_func = sdhc_litex_irq_config##n, \ | ||
| .bus_width = (enum sdhc_bus_width)DT_INST_PROP(n, bus_width), \ | ||
| .phy_card_detect_addr = DT_INST_REG_ADDR_BY_NAME(n, phy_card_detect), \ |
There was a problem hiding this comment.
Do all these register offsets differ between each version of the IP? Or could we encode one base address?
There was a problem hiding this comment.
That's how we do it with all litex peripherals. The order and the position of the registers is not fixed and not considered stable. It can always change. Btw it is open source https://github.com/enjoy-digital/litesdcard and changes can happen anytime. F.e. when a new register is added, the addresses of the other registers can change. We don't want to have to change the driver for that and handle versions for that. Instead the user just has to update the entries in their dts accordingly.
| sdhc0: sdhc@e000e800 { | ||
| compatible = "litex,litesdcard-sdhc"; | ||
| interrupt-parent = <&intc0>; | ||
| reg = <0xe000e800 0x4>, |
There was a problem hiding this comment.
Wondering if we can use one base address here. Or are all these register offsets configurable in the RTL?
There was a problem hiding this comment.
no see other answer
9a42908 to
a781230
Compare
|
rebased due to merge conflicts |
|
@danieldegrasse PTAL |
a781230 to
c6d9921
Compare
|
rebased due to a conflict |
|
c6d9921 to
20f99bf
Compare
20f99bf to
dd80e03
Compare
ed8b625 to
0a9bc5e
Compare
|
rebased due to sdhc api changes, also cleaned up |
|
@danieldegrasse please re-review |
0a9bc5e to
7afa7a2
Compare
add litex litesdcard driver. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
add litesdcard host controller. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
7afa7a2 to
0d8b8ae
Compare
|
|
Changed compatible to match the one in Linux, which is Also now uses events for interrupts |
|
@tgorochowik @kgugala please take a look too, needs the second approve |



add support for litesdcard