[PATCH v2 0/3] Add SDHCI support for Canaan K230 SoC
From: Jiayu Du
Date: Thu Feb 26 2026 - 07:00:13 EST
This series is based on the k230 usbphy series[1].
This patch series adds SDHCI support for the Canaan K230 SoC,
which uses Synopsys DWCMSHC SDHCI controllers, include MMC0 and MMC1.
The hardware designs of these two controllers are different.
The MMC0 supports eMMC, while MMC1 only supports SDIO. Detailed
information can be found in the vendor's manual[2].
>From the vendor's K230 manual:
- MMC0 supports eMMC5.0 and SDIO3.0, usually for eMMC chips.
- MMC1 only does SDIO3.0 in 4/1-bit mode up to SDR104, and the manual
clearly says it can't handle eMMC because of pin count and limits.
Therefore, there are two separate compatibles and the driver treats them
differently.
Link: https://lore.kernel.org/all/20260121145526.14672-1-jiayu.riscv@xxxxxxxxxxxxxxxx/ [1]
Link: https://github.com/kendryte/k230_docs/blob/main/en/00_hardware/K230_Hardware_Design_Guide.md#mmc-circuit [2]
Changes in v2:
- Change the clock minItems to 5.
- Add comments to explain the reason for setting SDHCI_PROG_CLOCK_MODE.
- Write the power selection logic in the phy init cleaner.
- Replace manual delay loop with read_poll_timeout.
- Drop unnecessarily braces where a single statement will do.
- Add the match_data pointer to dwcmshc_pltfm_data.
- Add dwcmshc_k230_match_data struct to separate eMMC/SDIO config data
- Split K230 into individual emmc/sdio platform data instances instead of
sharing one.
- Remove redundant have_phy member in k230_priv.
- Replace of_find_compatible_node with of_parse_phandle to get USB PHY
from DT phandle.
- Link to v1: https://lore.kernel.org/all/20260204082908.27501-1-jiayu.riscv@xxxxxxxxxxxxxxxx/
Jiayu Du (3):
dt-bindings: mmc: Add sdhci support for Canaan k230
mmc: sdhci-dwcmshc: Add Canaan K230 DWCMSHC controller support
riscv: dts: canaan: Add mmc nodes for K230
.../bindings/mmc/snps,dwcmshc-sdhci.yaml | 29 ++
.../boot/dts/canaan/k230-canmv-dshanpi.dts | 56 ++++
.../dts/canaan/k230-canmv-module-dshanpi.dtsi | 7 +
arch/riscv/boot/dts/canaan/k230.dtsi | 28 ++
drivers/mmc/host/sdhci-of-dwcmshc.c | 288 ++++++++++++++++++
5 files changed, 408 insertions(+)
--
2.53.0