* [PATCH v2 1/2] dt-bindings: mmc: spacemit,sdhci: add support for K3 SoC
2026-01-22 9:37 [PATCH v2 0/2] mmc: spacemit: Add support for K3 SoC Yixun Lan
@ 2026-01-22 9:37 ` Yixun Lan
2026-01-22 9:37 ` [PATCH v2 2/2] mmc: sdhci-of-k1: spacemit: Add " Yixun Lan
2026-01-22 18:03 ` [PATCH v2 0/2] mmc: " Ulf Hansson
2 siblings, 0 replies; 4+ messages in thread
From: Yixun Lan @ 2026-01-22 9:37 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Adrian Hunter
Cc: Yixun Lan, linux-mmc, devicetree, linux-riscv, spacemit, linux-kernel
The SDHCI controller found on SpacemiT K3 SoC share the same IP with
K1 generation, while fixed the broken 64BIT DMA issue. Introduce a
compatible string to enable support for it.
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Yixun Lan <dlan@kernel.org>
---
Documentation/devicetree/bindings/mmc/spacemit,sdhci.yaml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/mmc/spacemit,sdhci.yaml b/Documentation/devicetree/bindings/mmc/spacemit,sdhci.yaml
index de4e9efeb666..9a055d963a7f 100644
--- a/Documentation/devicetree/bindings/mmc/spacemit,sdhci.yaml
+++ b/Documentation/devicetree/bindings/mmc/spacemit,sdhci.yaml
@@ -14,7 +14,9 @@ allOf:
properties:
compatible:
- const: spacemit,k1-sdhci
+ enum:
+ - spacemit,k1-sdhci
+ - spacemit,k3-sdhci
reg:
maxItems: 1
--
2.52.0
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v2 2/2] mmc: sdhci-of-k1: spacemit: Add support for K3 SoC
2026-01-22 9:37 [PATCH v2 0/2] mmc: spacemit: Add support for K3 SoC Yixun Lan
2026-01-22 9:37 ` [PATCH v2 1/2] dt-bindings: mmc: spacemit,sdhci: add " Yixun Lan
@ 2026-01-22 9:37 ` Yixun Lan
2026-01-22 18:03 ` [PATCH v2 0/2] mmc: " Ulf Hansson
2 siblings, 0 replies; 4+ messages in thread
From: Yixun Lan @ 2026-01-22 9:37 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Adrian Hunter
Cc: Yixun Lan, linux-mmc, devicetree, linux-riscv, spacemit, linux-kernel
The SDHCI controller found on SpacemiT K3 SoC share the same IP with K1
generation and introduce a compatible data to denote the change that broken
64BIT DMA issue has been fixed.
Signed-off-by: Yixun Lan <dlan@kernel.org>
---
drivers/mmc/host/sdhci-of-k1.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci-of-k1.c b/drivers/mmc/host/sdhci-of-k1.c
index a160e1d5d9bd..455656f9842d 100644
--- a/drivers/mmc/host/sdhci-of-k1.c
+++ b/drivers/mmc/host/sdhci-of-k1.c
@@ -259,8 +259,20 @@ static const struct sdhci_pltfm_data spacemit_sdhci_k1_pdata = {
SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
};
+static const struct sdhci_pltfm_data spacemit_sdhci_k3_pdata = {
+ .ops = &spacemit_sdhci_ops,
+ .quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
+ SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC |
+ SDHCI_QUIRK_32BIT_ADMA_SIZE |
+ SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN |
+ SDHCI_QUIRK_BROKEN_CARD_DETECTION |
+ SDHCI_QUIRK_BROKEN_TIMEOUT_VAL,
+ .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
+};
+
static const struct of_device_id spacemit_sdhci_of_match[] = {
- { .compatible = "spacemit,k1-sdhci" },
+ { .compatible = "spacemit,k1-sdhci", .data = &spacemit_sdhci_k1_pdata },
+ { .compatible = "spacemit,k3-sdhci", .data = &spacemit_sdhci_k3_pdata },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, spacemit_sdhci_of_match);
@@ -271,10 +283,13 @@ static int spacemit_sdhci_probe(struct platform_device *pdev)
struct spacemit_sdhci_host *sdhst;
struct sdhci_pltfm_host *pltfm_host;
struct sdhci_host *host;
+ const struct sdhci_pltfm_data *data;
struct mmc_host_ops *mops;
int ret;
- host = sdhci_pltfm_init(pdev, &spacemit_sdhci_k1_pdata, sizeof(*sdhst));
+ data = of_device_get_match_data(&pdev->dev);
+
+ host = sdhci_pltfm_init(pdev, data, sizeof(*sdhst));
if (IS_ERR(host))
return PTR_ERR(host);
--
2.52.0
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2 0/2] mmc: spacemit: Add support for K3 SoC
2026-01-22 9:37 [PATCH v2 0/2] mmc: spacemit: Add support for K3 SoC Yixun Lan
2026-01-22 9:37 ` [PATCH v2 1/2] dt-bindings: mmc: spacemit,sdhci: add " Yixun Lan
2026-01-22 9:37 ` [PATCH v2 2/2] mmc: sdhci-of-k1: spacemit: Add " Yixun Lan
@ 2026-01-22 18:03 ` Ulf Hansson
2 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2026-01-22 18:03 UTC (permalink / raw)
To: Yixun Lan
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter,
linux-mmc, devicetree, linux-riscv, spacemit, linux-kernel
On Thu, 22 Jan 2026 at 10:38, Yixun Lan <dlan@kernel.org> wrote:
>
> Enable SDHCI controller support on new SpacemiT K3 SoC, while as before
> only the third controller and the eMMC device has been tested which using
> vendor K3 evb board. This board has not acquired support in mainline
> kernel, so I've omitted the DT part patches for now.
>
> The new SDHCI controller almost reuse the same IP as old K1 generation,
> while fixed the broken 64BIT DMA issue.
>
> Hi Ulf,
> Any chance to queue this for v6.20? I know it's a little bit late,
> but the patch itself is quite simple and we've tested on evb board.
>
> Signed-off-by: Yixun Lan <dlan@kernel.org>
> ---
> Changes in v2:
> - collect Rob's Ack
> - drop uncessary blank line
> - drop return check from of_device_get_match_data
> - Link to v1: https://lore.kernel.org/r/20260121-07-k3-mmc-v1-0-ff77c07bfdf6@kernel.org
>
> ---
> Yixun Lan (2):
> dt-bindings: mmc: spacemit,sdhci: add support for K3 SoC
> mmc: sdhci-of-k1: spacemit: Add support for K3 SoC
>
> .../devicetree/bindings/mmc/spacemit,sdhci.yaml | 4 +++-
> drivers/mmc/host/sdhci-of-k1.c | 19 +++++++++++++++++--
> 2 files changed, 20 insertions(+), 3 deletions(-)
> ---
> base-commit: 6cefff068d030786d63fa50970d6581c354630b2
> change-id: 20260112-07-k3-mmc-6ca01267e834
>
> Best regards,
> --
> Yixun Lan <dlan@kernel.org>
>
The series applied for next, thanks!
Kind regards
Uffe
^ permalink raw reply [flat|nested] 4+ messages in thread