* [PATCH 1/3] dt-bindings: mmc: mtk-sd: Add support for MT8189 SoC
2025-12-03 11:45 [PATCH 0/3] Add SD/MMC Card driver support for Mediatek MT8189 SoC Louis-Alexis Eyraud
@ 2025-12-03 11:45 ` Louis-Alexis Eyraud
2025-12-05 9:04 ` Krzysztof Kozlowski
2026-03-18 23:00 ` David Lechner
2025-12-03 11:45 ` [PATCH 2/3] mmc: mtk-sd: add support for SPM resource release control Louis-Alexis Eyraud
` (2 subsequent siblings)
3 siblings, 2 replies; 7+ messages in thread
From: Louis-Alexis Eyraud @ 2025-12-03 11:45 UTC (permalink / raw)
To: Chaotian Jing, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
Wenbin Mei
Cc: kernel, linux-mmc, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek, Louis-Alexis Eyraud
Add a new compatible for MMC IP in MT8189 SoC.
Even though this is partially compatible with the one found in MT8196
SoC, the MT8189 SoC register layout has some slight differences and
additional features.
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
Documentation/devicetree/bindings/mmc/mtk-sd.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
index 6dd26ad314916a3e40cf55ff69a7d93ed63dbdd4..eb3755bdfdf7e001602c3eb870898275085df3e6 100644
--- a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
+++ b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
@@ -25,6 +25,7 @@ properties:
- mediatek,mt8135-mmc
- mediatek,mt8173-mmc
- mediatek,mt8183-mmc
+ - mediatek,mt8189-mmc
- mediatek,mt8196-mmc
- mediatek,mt8516-mmc
- items:
@@ -192,6 +193,7 @@ allOf:
- mediatek,mt8183-mmc
- mediatek,mt8186-mmc
- mediatek,mt8188-mmc
+ - mediatek,mt8189-mmc
- mediatek,mt8195-mmc
- mediatek,mt8196-mmc
- mediatek,mt8516-mmc
@@ -240,6 +242,7 @@ allOf:
- mediatek,mt7986-mmc
- mediatek,mt7988-mmc
- mediatek,mt8183-mmc
+ - mediatek,mt8189-mmc
- mediatek,mt8196-mmc
then:
properties:
--
2.52.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 1/3] dt-bindings: mmc: mtk-sd: Add support for MT8189 SoC
2025-12-03 11:45 ` [PATCH 1/3] dt-bindings: mmc: mtk-sd: Add support for " Louis-Alexis Eyraud
@ 2025-12-05 9:04 ` Krzysztof Kozlowski
2026-03-18 23:00 ` David Lechner
1 sibling, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-05 9:04 UTC (permalink / raw)
To: Louis-Alexis Eyraud
Cc: Chaotian Jing, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
Wenbin Mei, kernel, linux-mmc, devicetree, linux-kernel,
linux-arm-kernel, linux-mediatek
On Wed, Dec 03, 2025 at 12:45:34PM +0100, Louis-Alexis Eyraud wrote:
> Add a new compatible for MMC IP in MT8189 SoC.
> Even though this is partially compatible with the one found in MT8196
> SoC, the MT8189 SoC register layout has some slight differences and
> additional features.
>
> Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
> ---
> Documentation/devicetree/bindings/mmc/mtk-sd.yaml | 3 +++
> 1 file changed, 3 insertions(+)
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] dt-bindings: mmc: mtk-sd: Add support for MT8189 SoC
2025-12-03 11:45 ` [PATCH 1/3] dt-bindings: mmc: mtk-sd: Add support for " Louis-Alexis Eyraud
2025-12-05 9:04 ` Krzysztof Kozlowski
@ 2026-03-18 23:00 ` David Lechner
1 sibling, 0 replies; 7+ messages in thread
From: David Lechner @ 2026-03-18 23:00 UTC (permalink / raw)
To: Louis-Alexis Eyraud, Chaotian Jing, Ulf Hansson, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
AngeloGioacchino Del Regno, Wenbin Mei
Cc: kernel, linux-mmc, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek
On 12/3/25 5:45 AM, Louis-Alexis Eyraud wrote:
> Add a new compatible for MMC IP in MT8189 SoC.
> Even though this is partially compatible with the one found in MT8196
> SoC, the MT8189 SoC register layout has some slight differences and
> additional features.
>
> Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
> ---
> Documentation/devicetree/bindings/mmc/mtk-sd.yaml | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
> index 6dd26ad314916a3e40cf55ff69a7d93ed63dbdd4..eb3755bdfdf7e001602c3eb870898275085df3e6 100644
> --- a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
> +++ b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
> @@ -25,6 +25,7 @@ properties:
> - mediatek,mt8135-mmc
> - mediatek,mt8173-mmc
> - mediatek,mt8183-mmc
> + - mediatek,mt8189-mmc
I think this can be in the group with fallback to mediatek,mt8183-mmc.
I was able to make it work on U-Boot just using the existing match
for "mediatek,mt8183-mmc" there.
> - mediatek,mt8196-mmc
> - mediatek,mt8516-mmc
> - items:
> @@ -192,6 +193,7 @@ allOf:
> - mediatek,mt8183-mmc
> - mediatek,mt8186-mmc
> - mediatek,mt8188-mmc
> + - mediatek,mt8189-mmc
> - mediatek,mt8195-mmc
> - mediatek,mt8196-mmc
> - mediatek,mt8516-mmc
> @@ -240,6 +242,7 @@ allOf:
> - mediatek,mt7986-mmc
> - mediatek,mt7988-mmc
> - mediatek,mt8183-mmc
> + - mediatek,mt8189-mmc
> - mediatek,mt8196-mmc
> then:
> properties:
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] mmc: mtk-sd: add support for SPM resource release control
2025-12-03 11:45 [PATCH 0/3] Add SD/MMC Card driver support for Mediatek MT8189 SoC Louis-Alexis Eyraud
2025-12-03 11:45 ` [PATCH 1/3] dt-bindings: mmc: mtk-sd: Add support for " Louis-Alexis Eyraud
@ 2025-12-03 11:45 ` Louis-Alexis Eyraud
2025-12-03 11:45 ` [PATCH 3/3] mmc: mtk-sd: add support for MT8189 SoC Louis-Alexis Eyraud
2025-12-15 15:43 ` [PATCH 0/3] Add SD/MMC Card driver support for Mediatek " Ulf Hansson
3 siblings, 0 replies; 7+ messages in thread
From: Louis-Alexis Eyraud @ 2025-12-03 11:45 UTC (permalink / raw)
To: Chaotian Jing, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
Wenbin Mei
Cc: kernel, linux-mmc, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek, Louis-Alexis Eyraud
The MT8189 SoC has in the status register an additional bit field to
release all System Power management (SPM) resource requests.
In preparation of MT8189 SoC support, add its use in suspend callback
and a support flag in the platform data.
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
drivers/mmc/host/mtk-sd.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index daed659f63f6872423edd755478f0ec57e7742b4..4ce596d616409646613748086476c58d8b7b8de9 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -203,9 +203,10 @@
#define SDC_CFG_DTOC GENMASK(31, 24) /* RW */
/* SDC_STS mask */
-#define SDC_STS_SDCBUSY BIT(0) /* RW */
-#define SDC_STS_CMDBUSY BIT(1) /* RW */
-#define SDC_STS_SWR_COMPL BIT(31) /* RW */
+#define SDC_STS_SDCBUSY BIT(0) /* RW */
+#define SDC_STS_CMDBUSY BIT(1) /* RW */
+#define SDC_STS_SPM_RESOURCE_RELEASE BIT(3) /* RW */
+#define SDC_STS_SWR_COMPL BIT(31) /* RW */
/* SDC_ADV_CFG0 mask */
#define SDC_DAT1_IRQ_TRIGGER BIT(19) /* RW */
@@ -448,6 +449,7 @@ struct mtk_mmc_compatible {
bool use_internal_cd;
bool support_new_tx;
bool support_new_rx;
+ bool support_spm_res_release;
};
struct msdc_tune_para {
@@ -3296,6 +3298,10 @@ static int msdc_runtime_suspend(struct device *dev)
__msdc_enable_sdio_irq(host, 0);
}
+
+ if (host->dev_comp->support_spm_res_release)
+ sdr_set_bits(host->base + SDC_STS, SDC_STS_SPM_RESOURCE_RELEASE);
+
msdc_gate_clock(host);
return 0;
}
--
2.52.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 3/3] mmc: mtk-sd: add support for MT8189 SoC
2025-12-03 11:45 [PATCH 0/3] Add SD/MMC Card driver support for Mediatek MT8189 SoC Louis-Alexis Eyraud
2025-12-03 11:45 ` [PATCH 1/3] dt-bindings: mmc: mtk-sd: Add support for " Louis-Alexis Eyraud
2025-12-03 11:45 ` [PATCH 2/3] mmc: mtk-sd: add support for SPM resource release control Louis-Alexis Eyraud
@ 2025-12-03 11:45 ` Louis-Alexis Eyraud
2025-12-15 15:43 ` [PATCH 0/3] Add SD/MMC Card driver support for Mediatek " Ulf Hansson
3 siblings, 0 replies; 7+ messages in thread
From: Louis-Alexis Eyraud @ 2025-12-03 11:45 UTC (permalink / raw)
To: Chaotian Jing, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
Wenbin Mei
Cc: kernel, linux-mmc, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek, Louis-Alexis Eyraud
Even though MMC IP in MT8189 SoC is partially compatible with the one
found in MT8196 SoC, its register layout has some slight differences
and additional features such as the system power management release
resource control support.
Thus, add new compatible and platform data to support this SoC.
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
drivers/mmc/host/mtk-sd.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index 4ce596d616409646613748086476c58d8b7b8de9..302ac8529c4f093a541db2d37dcc8709c3775557 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -675,6 +675,25 @@ static const struct mtk_mmc_compatible mt8516_compat = {
.stop_dly_sel = 3,
};
+static const struct mtk_mmc_compatible mt8189_compat = {
+ .clk_div_bits = 12,
+ .recheck_sdio_irq = false,
+ .hs400_tune = false,
+ .needs_top_base = true,
+ .pad_tune_reg = MSDC_PAD_TUNE0,
+ .async_fifo = true,
+ .data_tune = true,
+ .busy_check = true,
+ .stop_clk_fix = true,
+ .stop_dly_sel = 1,
+ .pop_en_cnt = 2,
+ .enhance_rx = true,
+ .support_64g = true,
+ .support_new_tx = true,
+ .support_new_rx = true,
+ .support_spm_res_release = true,
+};
+
static const struct mtk_mmc_compatible mt8196_compat = {
.clk_div_bits = 12,
.recheck_sdio_irq = false,
@@ -705,6 +724,7 @@ static const struct of_device_id msdc_of_ids[] = {
{ .compatible = "mediatek,mt8135-mmc", .data = &mt8135_compat},
{ .compatible = "mediatek,mt8173-mmc", .data = &mt8173_compat},
{ .compatible = "mediatek,mt8183-mmc", .data = &mt8183_compat},
+ { .compatible = "mediatek,mt8189-mmc", .data = &mt8189_compat},
{ .compatible = "mediatek,mt8196-mmc", .data = &mt8196_compat},
{ .compatible = "mediatek,mt8516-mmc", .data = &mt8516_compat},
--
2.52.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 0/3] Add SD/MMC Card driver support for Mediatek MT8189 SoC
2025-12-03 11:45 [PATCH 0/3] Add SD/MMC Card driver support for Mediatek MT8189 SoC Louis-Alexis Eyraud
` (2 preceding siblings ...)
2025-12-03 11:45 ` [PATCH 3/3] mmc: mtk-sd: add support for MT8189 SoC Louis-Alexis Eyraud
@ 2025-12-15 15:43 ` Ulf Hansson
3 siblings, 0 replies; 7+ messages in thread
From: Ulf Hansson @ 2025-12-15 15:43 UTC (permalink / raw)
To: Louis-Alexis Eyraud
Cc: Chaotian Jing, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Matthias Brugger, AngeloGioacchino Del Regno, Wenbin Mei, kernel,
linux-mmc, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek
On Wed, 3 Dec 2025 at 12:45, Louis-Alexis Eyraud
<louisalexis.eyraud@collabora.com> wrote:
>
> This patch series adds in the Mediatek SD/MMC Card host driver (mtk-sd)
> the support of Mediatek MT8189 SoC and its variants (MT8371 and
> MT8391).
>
> It has been tested with a kernel based on next-20251203 tag on the
> Mediatek Genio 720-EVK board, based on MT8391 SoC, using both onboard
> eMMC storage and a micro-SD card.
>
> Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
> ---
> Louis-Alexis Eyraud (3):
> dt-bindings: mmc: mtk-sd: Add support for MT8189 SoC
> mmc: mtk-sd: add support for SPM resource release control
> mmc: mtk-sd: add support for MT8189 SoC
>
> Documentation/devicetree/bindings/mmc/mtk-sd.yaml | 3 +++
> drivers/mmc/host/mtk-sd.c | 32 ++++++++++++++++++++---
> 2 files changed, 32 insertions(+), 3 deletions(-)
> ---
> base-commit: e47d97576181b31291cf58e77d737d21def0e160
> change-id: 20251128-mt8189-add-mmc-support-ff6df8f89e41
>
> Best regards,
> --
> Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
>
The series applied for next, thanks!
Kind regards
Uffe
^ permalink raw reply [flat|nested] 7+ messages in thread