From: Frank Wunderlich <[email protected]>
I've noticed the mtk-sd binding needs a bit more work get into a more
clean state.
There are 2 properties missing that maybe need to be added later or
dropped from devicetrees:
drv-type (which is used in mt8183-kukui.dtsi and set to <2>)
and
r_smpl (used in mt7622-rfb1.dts and mt7622-bananapi-bpi-r64.dts, both
times set to <1>)
i don't know their function and boundaries and i do not find them in
driver. I guess they are added by accident, so i removing them in the
patches 5+6.
v2:
- add compatible based binding
v3:
- solve "not" statement in binding and reorder if statements,drop mt8183
- added patches removing invalid properties (not in driver)
v4:
- squashed part 1 (compatible) and 3 (SoC specific clock config)
- new mt7986 clock bindings based on info from mtk
- re-add mt8183 reg boundary
v5:
- add fixes-tags to Patches 4+5 and reviewed-by to 6
- drop quotes from mt7986 clock-names from patch 2
Frank Wunderlich (3):
arm64: dts: mediatek: mt2712e: swap last 2 clocks to match binding
arm64: dts: mt8183: drop drv-type from mmc-node
arm64: dts: mt7622: drop r_smpl property from mmc node
Nícolas F. R. A. Prado (1):
dt-bindings: mmc: mtk-sd: Set clocks based on compatible
Sam Shih (2):
dt-bindings: mmc: Add support for Mediatek MT7986
mmc: mediatek: add support for MT7986 SoC
.../devicetree/bindings/mmc/mtk-sd.yaml | 149 ++++++++++++++----
arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 6 +-
.../dts/mediatek/mt7622-bananapi-bpi-r64.dts | 1 -
arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 1 -
.../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 -
drivers/mmc/host/mtk-sd.c | 14 ++
6 files changed, 136 insertions(+), 36 deletions(-)
--
2.34.1
From: Sam Shih <[email protected]>
Adding mt7986 own characteristics and of_device_id to have support
of MT7986 SoC.
Signed-off-by: Sam Shih <[email protected]>
Signed-off-by: Frank Wunderlich <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
---
v5:
- add reviewed-tag
---
drivers/mmc/host/mtk-sd.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index df941438aef5..3f7f3a1e0df8 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -552,6 +552,19 @@ static const struct mtk_mmc_compatible mt7622_compat = {
.support_64g = false,
};
+static const struct mtk_mmc_compatible mt7986_compat = {
+ .clk_div_bits = 12,
+ .recheck_sdio_irq = true,
+ .hs400_tune = false,
+ .pad_tune_reg = MSDC_PAD_TUNE0,
+ .async_fifo = true,
+ .data_tune = true,
+ .busy_check = true,
+ .stop_clk_fix = true,
+ .enhance_rx = true,
+ .support_64g = true,
+};
+
static const struct mtk_mmc_compatible mt8135_compat = {
.clk_div_bits = 8,
.recheck_sdio_irq = true,
@@ -609,6 +622,7 @@ static const struct of_device_id msdc_of_ids[] = {
{ .compatible = "mediatek,mt6795-mmc", .data = &mt6795_compat},
{ .compatible = "mediatek,mt7620-mmc", .data = &mt7620_compat},
{ .compatible = "mediatek,mt7622-mmc", .data = &mt7622_compat},
+ { .compatible = "mediatek,mt7986-mmc", .data = &mt7986_compat},
{ .compatible = "mediatek,mt8135-mmc", .data = &mt8135_compat},
{ .compatible = "mediatek,mt8173-mmc", .data = &mt8173_compat},
{ .compatible = "mediatek,mt8183-mmc", .data = &mt8183_compat},
--
2.34.1
From: Sam Shih <[email protected]>
This commit adds dt-binding documentation of mmc for Mediatek MT7986 SoC
Platform.
Add SoC specific section for defining clock configuration.
Signed-off-by: Sam Shih <[email protected]>
Signed-off-by: Frank Wunderlich <[email protected]>
---
v3:
- drop assigned-clocks/assigned-clock-parents
- fix clock description
v4:
- update binding for mt7986 (new mtk version)
- squashed part 1 (compatible) and 3 (SoC specific clock config)
and so dropped Ack from Rob for 1rst Part
v5:
- drop quotes around clock names
---
.../devicetree/bindings/mmc/mtk-sd.yaml | 26 +++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
index 0cedeb12892d..6f8ecb4788eb 100644
--- a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
+++ b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
@@ -20,6 +20,7 @@ properties:
- mediatek,mt6795-mmc
- mediatek,mt7620-mmc
- mediatek,mt7622-mmc
+ - mediatek,mt7986-mmc
- mediatek,mt8135-mmc
- mediatek,mt8173-mmc
- mediatek,mt8183-mmc
@@ -237,6 +238,31 @@ allOf:
reg:
minItems: 2
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - mediatek,mt7986-mmc
+ then:
+ properties:
+ clocks:
+ minItems: 3
+ items:
+ - description: source clock
+ - description: HCLK which used for host
+ - description: independent source clock gate
+ - description: bus clock used for internal register access (required for MSDC0/3).
+ - description: msdc subsys clock gate
+ clock-names:
+ minItems: 3
+ items:
+ - const: source
+ - const: hclk
+ - const: source_cg
+ - const: bus_clk
+ - const: sys_cg
+
- if:
properties:
compatible:
--
2.34.1
From: Frank Wunderlich <[email protected]>
This property is not defined in binding and driver.
Fixes: cd894e274b74 ("arm64: dts: mt8183: Add krane-sku176 board")
Signed-off-by: Frank Wunderlich <[email protected]>
---
v5:
- add fixes-tag
---
arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
index b4b86bb1f1a7..0c9b18c16c89 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
@@ -378,7 +378,6 @@ &mmc1 {
mmc-pwrseq = <&wifi_pwrseq>;
bus-width = <4>;
max-frequency = <200000000>;
- drv-type = <2>;
cap-sd-highspeed;
sd-uhs-sdr50;
sd-uhs-sdr104;
--
2.34.1
From: Nícolas F. R. A. Prado <[email protected]>
The binding was describing a single clock list for all platforms, but
that's not really suitable:
Most platforms using at least 2 clocks (source, hclk), some of them
a third "source_cg". Mt2712 requires an extra 'bus_clk' on some of
its controllers, while mt8192 requires 8 clocks.
Move the clock definitions inside if blocks that match on the
compatibles.
I used Patch from Nícolas F. R. A. Prado and modified it to not using
"not" statement.
Fixes: 59a23395d8aa ("dt-bindings: mmc: Add support for MT8192 SoC")
Signed-off-by: Nícolas F. R. A. Prado <[email protected]>
Signed-off-by: Frank Wunderlich <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
---
v2:
- add this patch
v3:
- add blank lines and change "not" to matchlist
- reorder entries - make generic first then order alphanumeric
- rewrite commit description
- drop soc-specific mt8183 - constraints were also set for it above
v4:
- re-add mt8183 reg-minitems
---
.../devicetree/bindings/mmc/mtk-sd.yaml | 123 +++++++++++++-----
1 file changed, 93 insertions(+), 30 deletions(-)
diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
index d8e1e2e9adf2..0cedeb12892d 100644
--- a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
+++ b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
@@ -10,9 +10,6 @@ maintainers:
- Chaotian Jing <[email protected]>
- Wenbin Mei <[email protected]>
-allOf:
- - $ref: mmc-controller.yaml#
-
properties:
compatible:
oneOf:
@@ -48,27 +45,11 @@ properties:
description:
Should contain phandle for the clock feeding the MMC controller.
minItems: 2
- items:
- - description: source clock (required).
- - description: HCLK which used for host (required).
- - description: independent source clock gate (required for MT2712).
- - description: bus clock used for internal register access (required for MT2712 MSDC0/3).
- - description: msdc subsys clock gate (required for MT8192).
- - description: peripheral bus clock gate (required for MT8192).
- - description: AXI bus clock gate (required for MT8192).
- - description: AHB bus clock gate (required for MT8192).
+ maxItems: 7
clock-names:
minItems: 2
- items:
- - const: source
- - const: hclk
- - const: source_cg
- - const: bus_clk
- - const: sys_cg
- - const: pclk_cg
- - const: axi_cg
- - const: ahb_cg
+ maxItems: 7
interrupts:
description:
@@ -190,15 +171,97 @@ required:
- vmmc-supply
- vqmmc-supply
-if:
- properties:
- compatible:
- contains:
- const: mediatek,mt8183-mmc
-then:
- properties:
- reg:
- minItems: 2
+allOf:
+ - $ref: mmc-controller.yaml#
+ - if:
+ properties:
+ compatible:
+ enum:
+ - mediatek,mt2701-mmc
+ - mediatek,mt6779-mmc
+ - mediatek,mt6795-mmc
+ - mediatek,mt7620-mmc
+ - mediatek,mt7622-mmc
+ - mediatek,mt7623-mmc
+ - mediatek,mt8135-mmc
+ - mediatek,mt8173-mmc
+ - mediatek,mt8183-mmc
+ - mediatek,mt8186-mmc
+ - mediatek,mt8188-mmc
+ - mediatek,mt8195-mmc
+ - mediatek,mt8516-mmc
+ then:
+ properties:
+ clocks:
+ minItems: 2
+ items:
+ - description: source clock
+ - description: HCLK which used for host
+ - description: independent source clock gate
+ clock-names:
+ minItems: 2
+ items:
+ - const: source
+ - const: hclk
+ - const: source_cg
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: mediatek,mt2712-mmc
+ then:
+ properties:
+ clocks:
+ minItems: 3
+ items:
+ - description: source clock
+ - description: HCLK which used for host
+ - description: independent source clock gate
+ - description: bus clock used for internal register access (required for MSDC0/3).
+ clock-names:
+ minItems: 3
+ items:
+ - const: source
+ - const: hclk
+ - const: source_cg
+ - const: bus_clk
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: mediatek,mt8183-mmc
+ then:
+ properties:
+ reg:
+ minItems: 2
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: mediatek,mt8192-mmc
+ then:
+ properties:
+ clocks:
+ items:
+ - description: source clock
+ - description: HCLK which used for host
+ - description: independent source clock gate
+ - description: msdc subsys clock gate
+ - description: peripheral bus clock gate
+ - description: AXI bus clock gate
+ - description: AHB bus clock gate
+ clock-names:
+ items:
+ - const: source
+ - const: hclk
+ - const: source_cg
+ - const: sys_cg
+ - const: pclk_cg
+ - const: axi_cg
+ - const: ahb_cg
unevaluatedProperties: false
--
2.34.1
On 25/10/2022 09:29, Frank Wunderlich wrote:
> From: Sam Shih <[email protected]>
>
> This commit adds dt-binding documentation of mmc for Mediatek MT7986 SoC
> Platform.
> Add SoC specific section for defining clock configuration.
>
> Signed-off-by: Sam Shih <[email protected]>
> Signed-off-by: Frank Wunderlich <[email protected]>
> ---
> v3:
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Best regards,
Krzysztof
On Tue, 25 Oct 2022 at 15:29, Frank Wunderlich <[email protected]> wrote:
>
> From: Frank Wunderlich <[email protected]>
>
> I've noticed the mtk-sd binding needs a bit more work get into a more
> clean state.
>
> There are 2 properties missing that maybe need to be added later or
> dropped from devicetrees:
> drv-type (which is used in mt8183-kukui.dtsi and set to <2>)
> and
> r_smpl (used in mt7622-rfb1.dts and mt7622-bananapi-bpi-r64.dts, both
> times set to <1>)
>
> i don't know their function and boundaries and i do not find them in
> driver. I guess they are added by accident, so i removing them in the
> patches 5+6.
>
> v2:
> - add compatible based binding
> v3:
> - solve "not" statement in binding and reorder if statements,drop mt8183
> - added patches removing invalid properties (not in driver)
> v4:
> - squashed part 1 (compatible) and 3 (SoC specific clock config)
> - new mt7986 clock bindings based on info from mtk
> - re-add mt8183 reg boundary
> v5:
> - add fixes-tags to Patches 4+5 and reviewed-by to 6
> - drop quotes from mt7986 clock-names from patch 2
>
> Frank Wunderlich (3):
> arm64: dts: mediatek: mt2712e: swap last 2 clocks to match binding
> arm64: dts: mt8183: drop drv-type from mmc-node
> arm64: dts: mt7622: drop r_smpl property from mmc node
>
> Nícolas F. R. A. Prado (1):
> dt-bindings: mmc: mtk-sd: Set clocks based on compatible
>
> Sam Shih (2):
> dt-bindings: mmc: Add support for Mediatek MT7986
> mmc: mediatek: add support for MT7986 SoC
>
> .../devicetree/bindings/mmc/mtk-sd.yaml | 149 ++++++++++++++----
> arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 6 +-
> .../dts/mediatek/mt7622-bananapi-bpi-r64.dts | 1 -
> arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 1 -
> .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 -
> drivers/mmc/host/mtk-sd.c | 14 ++
> 6 files changed, 136 insertions(+), 36 deletions(-)
I have dropped the earlier two patches I have applied for MT7986 and
applied patch1, 2 and 6 from this series instead, thanks!
Kind regards
Uffe
Il 25/10/22 15:29, Frank Wunderlich ha scritto:
> From: Frank Wunderlich <[email protected]>
>
> This property is not defined in binding and driver.
>
> Fixes: cd894e274b74 ("arm64: dts: mt8183: Add krane-sku176 board")
> Signed-off-by: Frank Wunderlich <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Il 25/10/22 15:29, Frank Wunderlich ha scritto:
> From: Nícolas F. R. A. Prado <[email protected]>
>
> The binding was describing a single clock list for all platforms, but
> that's not really suitable:
>
> Most platforms using at least 2 clocks (source, hclk), some of them
> a third "source_cg". Mt2712 requires an extra 'bus_clk' on some of
> its controllers, while mt8192 requires 8 clocks.
>
> Move the clock definitions inside if blocks that match on the
> compatibles.
>
> I used Patch from Nícolas F. R. A. Prado and modified it to not using
> "not" statement.
>
> Fixes: 59a23395d8aa ("dt-bindings: mmc: Add support for MT8192 SoC")
> Signed-off-by: Nícolas F. R. A. Prado <[email protected]>
> Signed-off-by: Frank Wunderlich <[email protected]>
> Reviewed-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Il 25/10/22 15:29, Frank Wunderlich ha scritto:
> From: Sam Shih <[email protected]>
>
> This commit adds dt-binding documentation of mmc for Mediatek MT7986 SoC
> Platform.
> Add SoC specific section for defining clock configuration.
>
> Signed-off-by: Sam Shih <[email protected]>
> Signed-off-by: Frank Wunderlich <[email protected]>
> Reviewed-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
On 26/10/2022 13:25, Ulf Hansson wrote:
> On Tue, 25 Oct 2022 at 15:29, Frank Wunderlich <[email protected]> wrote:
>>
>> From: Frank Wunderlich <[email protected]>
>>
>> I've noticed the mtk-sd binding needs a bit more work get into a more
>> clean state.
>>
>> There are 2 properties missing that maybe need to be added later or
>> dropped from devicetrees:
>> drv-type (which is used in mt8183-kukui.dtsi and set to <2>)
>> and
>> r_smpl (used in mt7622-rfb1.dts and mt7622-bananapi-bpi-r64.dts, both
>> times set to <1>)
>>
>> i don't know their function and boundaries and i do not find them in
>> driver. I guess they are added by accident, so i removing them in the
>> patches 5+6.
>>
>> v2:
>> - add compatible based binding
>> v3:
>> - solve "not" statement in binding and reorder if statements,drop mt8183
>> - added patches removing invalid properties (not in driver)
>> v4:
>> - squashed part 1 (compatible) and 3 (SoC specific clock config)
>> - new mt7986 clock bindings based on info from mtk
>> - re-add mt8183 reg boundary
>> v5:
>> - add fixes-tags to Patches 4+5 and reviewed-by to 6
>> - drop quotes from mt7986 clock-names from patch 2
>>
>> Frank Wunderlich (3):
>> arm64: dts: mediatek: mt2712e: swap last 2 clocks to match binding
>> arm64: dts: mt8183: drop drv-type from mmc-node
>> arm64: dts: mt7622: drop r_smpl property from mmc node
>>
>> Nícolas F. R. A. Prado (1):
>> dt-bindings: mmc: mtk-sd: Set clocks based on compatible
>>
>> Sam Shih (2):
>> dt-bindings: mmc: Add support for Mediatek MT7986
>> mmc: mediatek: add support for MT7986 SoC
>>
>> .../devicetree/bindings/mmc/mtk-sd.yaml | 149 ++++++++++++++----
>> arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 6 +-
>> .../dts/mediatek/mt7622-bananapi-bpi-r64.dts | 1 -
>> arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 1 -
>> .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 -
>> drivers/mmc/host/mtk-sd.c | 14 ++
>> 6 files changed, 136 insertions(+), 36 deletions(-)
>
> I have dropped the earlier two patches I have applied for MT7986 and
> applied patch1, 2 and 6 from this series instead, thanks!
>
3, 4, 5 applied now thanks!