mmc: hisilicon: Convert dw-mshc bindings and fix dtbs
Subsystems (3)
cover mmc: hisilicon: Convert dw-mshc bindings and fix dtbs
This series converts the Hisilicon dw-mshc text bindings to DT schema format and cleans up legacy node names in Hisilicon board files.
While testing the new YAML schema, dtbs_check flagged the hi3660, hi3670, and hi6220 SoC files for using the non-standard 'dwmmc' node name prefix. resulting in warnings.
Patch 1 Convert to DT schema
Patch 2 updates the Hisilicon dtsi files to use standard 'mmc' node name.
---
Note: this patch is part of the process for applying to GSoC device tree bindings conversion project #
https://github.com/LinuxFoundationGSoC/ProjectIdeas/wiki/GSoC-2026-Device-Tree-Bindings
- The file is enabled by arm64 defconfig (CONFIG_MMC_DW_K3=y)
- It is used in following
/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
-included by /arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts
/arch/arm64/boot/dts/hisilicon/hi3670.dtsi
-included by /arch/arm64/boot/dts/hisilicon/hi3670-hikey970.dtsBhargav Joshi (2):
dt-bindings: mmc: hisilicon,hi3660-dw-mshc: Convert to DT schema
arm64: dts: hisilicon: Rename dwmmc nodes to mmc
.../mmc/hisilicon,hi3660-dw-mshc.yaml | 111 ++++++++++++++++++ .../devicetree/bindings/mmc/k3-dw-mshc.txt | 73 ------------ arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 4 +- arch/arm64/boot/dts/hisilicon/hi3670.dtsi | 4 +- arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 6 +- 5 files changed, 118 insertions(+), 80 deletions(-) create mode 100644 Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml delete mode 100644 Documentation/devicetree/bindings/mmc/k3-dw-mshc.txt
Signature · 1 line
2.53.0
PATCH 1/2 dt-bindings: mmc: hisilicon,hi3660-dw-mshc: Convert to DT schema
Convert the Hisilicon DesignWare Mobile Storage Host Controller (dw-mshc) bindings from text format to DT schema.
As part of this conversion, the binding file is renamed from k3-dw-mshc.txt to hisilicon,hi3660-dw-mshc.yaml to align with compatible string naming conventions.
Examples have been updated to pass schema validation.
--- .../mmc/hisilicon,hi3660-dw-mshc.yaml | 111 ++++++++++++++++++ .../devicetree/bindings/mmc/k3-dw-mshc.txt | 73 ------------ 2 files changed, 111 insertions(+), 73 deletions(-) create mode 100644 Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml delete mode 100644 Documentation/devicetree/bindings/mmc/k3-dw-mshc.txt
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml new file +111 -0
@@ -0,0 +1,111 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mmc/hisilicon,hi3660-dw-mshc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Hisilicon specific extensions to the Synopsys Designware Mobile Storage Host Controller + +maintainers: + - Zhangfei Gao <[email protected]> + +description: + The Synopsys designware mobile storage host controller is used to interface + a SoC with storage medium such as eMMC or SD/MMC cards. This file documents + differences between the core Synopsys dw mshc controller properties described + by synopsys-dw-mshc.txt and the properties used by the Hisilicon specific + extensions to the Synopsys Designware Mobile Storage Host Controller. + +allOf: + - $ref: /schemas/mmc/synopsys-dw-mshc-common.yaml# + +properties: + compatible: + oneOf: + - const: hisilicon,hi3660-dw-mshc + - items: + - const: hisilicon,hi3670-dw-mshc + - const: hisilicon,hi3660-dw-mshc + - const: hisilicon,hi4511-dw-mshc + - const: hisilicon,hi6220-dw-mshc + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: card interface unit clock + - description: bus interface unit clock + + clock-names: + items: + - const: ciu + - const: biu + + hisilicon,peripheral-syscon: + $ref: /schemas/types.yaml#/definitions/phandle + description: phandle of syscon used to control peripheral. + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/clock/hi3620-clock.h> + + mmc@fcd03000 { + compatible = "hisilicon,hi4511-dw-mshc"; + reg = <0xfcd03000 0x1000>; + interrupts = <0 16 4>; + #address-cells = <1>; + #size-cells = <0>; + clocks = <&mmc_clock HI3620_SD_CIUCLK>, <&clock HI3620_DDRC_PER_CLK>; + clock-names = "ciu", "biu"; + vmmc-supply = <&ldo12>; + fifo-depth = <0x100>; + pinctrl-names = "default"; + pinctrl-0 = <&sd_pmx_pins &sd_cfg_func1 &sd_cfg_func2>; + bus-width = <4>; + disable-wp; + cd-gpios = <&gpio10 3 0>; + cap-mmc-highspeed; + cap-sd-highspeed; + }; + + - | + #include <dt-bindings/clock/hi6220-clock.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + + mmc@f723e000 { + compatible = "hisilicon,hi6220-dw-mshc"; + bus-width = <0x4>; + disable-wp; + cap-sd-highspeed; + sd-uhs-sdr12; + sd-uhs-sdr25; + card-detect-delay = <200>; + hisilicon,peripheral-syscon = <&ao_ctrl>; + reg = <0x0 0xf723e000 0x0 0x1000>; + interrupts = <0x0 0x49 0x4>; + clocks = <&clock_sys HI6220_MMC1_CIUCLK>, + <&clock_sys HI6220_MMC1_CLK>; + clock-names = "ciu", "biu"; + cd-gpios = <&gpio1 0 1>; + pinctrl-names = "default", "idle"; + pinctrl-0 = <&sd_pmx_func &sd_clk_cfg_func &sd_cfg_func>; + pinctrl-1 = <&sd_pmx_idle &sd_clk_cfg_idle &sd_cfg_idle>; + vqmmc-supply = <&ldo7>; + vmmc-supply = <&ldo10>; + }; + };
Documentation/devicetree/bindings/mmc/k3-dw-mshc.txt deleted +0 -73
73 lines not on this page · raw message
Signature · 1 line
2.53.0
Re: [PATCH 1/2] dt-bindings: mmc: hisilicon,hi3660-dw-mshc: Convert to DT schema
Quoted 6 lines · Bhargav Joshi
Convert the Hisilicon DesignWare Mobile Storage Host Controller (dw-mshc) bindings from text format to DT schema.
As part of this conversion, the binding file is renamed from k3-dw-mshc.txt to hisilicon,hi3660-dw-mshc.yaml to align with compatible string naming conventions.
Old Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt binding was saying clocks are biu+ciu, you have here reversed, so this needs explanation in commit msg why (to match existing in-kernel DTS).
Quoted 32 lines
Examples have been updated to pass schema validation.
Signed-off-by Bhargav Joshi <[email protected]>--- .../mmc/hisilicon,hi3660-dw-mshc.yaml | 111 ++++++++++++++++++ .../devicetree/bindings/mmc/k3-dw-mshc.txt | 73 ------------ 2 files changed, 111 insertions(+), 73 deletions(-) create mode 100644 Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml delete mode 100644 Documentation/devicetree/bindings/mmc/k3-dw-mshc.txtDocumentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml new file +15
-0@@ -0,0 +1,111 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mmc/hisilicon,hi3660-dw-mshc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Hisilicon specific extensions to the Synopsys Designware Mobile Storage Host Controller + +maintainers: + - Zhangfei Gao <[email protected]> + +description: + The Synopsys designware mobile storage host controller is used to interface + a SoC with storage medium such as eMMC or SD/MMC cards. This file documents + differences between the core Synopsys dw mshc controller properties described
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml line 25
Quoted 10 lines
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml new file +10
-0+ by synopsys-dw-mshc.txt and the properties used by the Hisilicon specific + extensions to the Synopsys Designware Mobile Storage Host Controller. + +allOf: + - $ref: /schemas/mmc/synopsys-dw-mshc-common.yaml# + +properties: + compatible: + oneOf: + - const: hisilicon,hi3660-dw-mshc
This and last two entries should be one enum here.
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml line 30
Quoted 5 lines
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml new file +5
-0+ - items: + - const: hisilicon,hi3670-dw-mshc + - const: hisilicon,hi3660-dw-mshc + - const: hisilicon,hi4511-dw-mshc + - const: hisilicon,hi6220-dw-mshc
Blank line
Quoted 27 lines
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml new file +27
-0+ reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: card interface unit clock + - description: bus interface unit clock + + clock-names: + items: + - const: ciu + - const: biu + + hisilicon,peripheral-syscon: + $ref: /schemas/types.yaml#/definitions/phandle + description: phandle of syscon used to control peripheral. + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names +
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml line 67
Quoted 10 lines
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml new file +10
-0+unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/clock/hi3620-clock.h> + + mmc@fcd03000 { + compatible = "hisilicon,hi4511-dw-mshc"; + reg = <0xfcd03000 0x1000>; + interrupts = <0 16 4>;
Use proper flags (GIC, trigger level).
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml line 78
Quoted 11 lines
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml new file +11
-0+ #address-cells = <1>; + #size-cells = <0>; + clocks = <&mmc_clock HI3620_SD_CIUCLK>, <&clock HI3620_DDRC_PER_CLK>; + clock-names = "ciu", "biu"; + vmmc-supply = <&ldo12>; + fifo-depth = <0x100>; + pinctrl-names = "default"; + pinctrl-0 = <&sd_pmx_pins &sd_cfg_func1 &sd_cfg_func2>; + bus-width = <4>; + disable-wp; + cd-gpios = <&gpio10 3 0>;
Same here
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml line 91
Quoted 13 lines
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml new file +13
-0+ cap-mmc-highspeed; + cap-sd-highspeed; + }; + + - | + #include <dt-bindings/clock/hi6220-clock.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + + mmc@f723e000 { + compatible = "hisilicon,hi6220-dw-mshc";
"reg" goes here
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml line 92
Quoted 1 line
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml new file +1
-0+ bus-width = <0x4>;
That's not hex
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml line 100
Quoted 8 lines
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml new file +8
-0+ disable-wp; + cap-sd-highspeed; + sd-uhs-sdr12; + sd-uhs-sdr25; + card-detect-delay = <200>; + hisilicon,peripheral-syscon = <&ao_ctrl>; + reg = <0x0 0xf723e000 0x0 0x1000>; + interrupts = <0x0 0x49 0x4>;
These are not supposed to be hex...
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml line 110
Quoted 10 lines
Documentation/devicetree/bindings/mmc/hisilicon,hi3660-dw-mshc.yaml new file +10
-0+ clocks = <&clock_sys HI6220_MMC1_CIUCLK>, + <&clock_sys HI6220_MMC1_CLK>; + clock-names = "ciu", "biu"; + cd-gpios = <&gpio1 0 1>; + pinctrl-names = "default", "idle"; + pinctrl-0 = <&sd_pmx_func &sd_clk_cfg_func &sd_cfg_func>; + pinctrl-1 = <&sd_pmx_idle &sd_clk_cfg_idle &sd_cfg_idle>; + vqmmc-supply = <&ldo7>; + vmmc-supply = <&ldo10>; + };
Best regards,
Krzysztof
PATCH 2/2 arm64: dts: hisilicon: Rename dwmmc nodes to mmc
In reply to Bhargav JoshiThe core mmc devicetree schema expects mmc controller nodes to be named using '^mmc(@.*)?$' pattern.
The legacy Hisilicon SoC files (hi3660, hi3670, and hi6220) previously used the 'dwmmc' prefix for their nodes. This caused warnings during dtbs_check.
Rename the 'dwmmc' nodes to 'mmc' to comply with the standard schema and dtbs_check warnings. The legacy phandle labels are kept intact.
--- arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 4 ++-- arch/arm64/boot/dts/hisilicon/hi3670.dtsi | 4 ++-- arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-)
arch/arm64/boot/dts/hisilicon/hi3660.dtsi +2 -2
@@ -1057,7 +1057,7 @@ ufs: ufs@ff3b0000 { }; /* SD */ - dwmmc1: dwmmc1@ff37f000 { + dwmmc1: mmc@ff37f000 { compatible = "hisilicon,hi3660-dw-mshc"; reg = <0x0 0xff37f000 0x0 0x1000>; #address-cells = <1>;
@@ -1075,7 +1075,7 @@ dwmmc1: dwmmc1@ff37f000 { }; /* SDIO */ - dwmmc2: dwmmc2@ff3ff000 { + dwmmc2: mmc@ff3ff000 { compatible = "hisilicon,hi3660-dw-mshc"; reg = <0x0 0xff3ff000 0x0 0x1000>; #address-cells = <0x1>;
arch/arm64/boot/dts/hisilicon/hi3670.dtsi +2 -2
@@ -679,7 +679,7 @@ ufs: ufs@ff3c0000 { }; /* SD */ - dwmmc1: dwmmc1@ff37f000 { + dwmmc1: mmc@ff37f000 { compatible = "hisilicon,hi3670-dw-mshc", "hisilicon,hi3660-dw-mshc"; reg = <0x0 0xff37f000 0x0 0x1000>;
@@ -698,7 +698,7 @@ dwmmc1: dwmmc1@ff37f000 { }; /* SDIO */ - dwmmc2: dwmmc2@fc183000 { + dwmmc2: mmc@fc183000 { compatible = "hisilicon,hi3670-dw-mshc", "hisilicon,hi3660-dw-mshc"; reg = <0x0 0xfc183000 0x0 0x1000>;
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +3 -3
@@ -799,7 +799,7 @@ mailbox: mailbox@f7510000 { #mbox-cells = <3>; }; - dwmmc_0: dwmmc0@f723d000 { + dwmmc_0: mmc@f723d000 { compatible = "hisilicon,hi6220-dw-mshc"; reg = <0x0 0xf723d000 0x0 0x1000>; interrupts = <0x0 0x48 0x4>;
@@ -812,7 +812,7 @@ dwmmc_0: dwmmc0@f723d000 { &emmc_cfg_func &emmc_rst_cfg_func>; }; - dwmmc_1: dwmmc1@f723e000 { + dwmmc_1: mmc@f723e000 { compatible = "hisilicon,hi6220-dw-mshc"; hisilicon,peripheral-syscon = <&ao_ctrl>; reg = <0x0 0xf723e000 0x0 0x1000>;
@@ -828,7 +828,7 @@ dwmmc_1: dwmmc1@f723e000 { pinctrl-1 = <&sd_pmx_idle &sd_clk_cfg_idle &sd_cfg_idle>; }; - dwmmc_2: dwmmc2@f723f000 { + dwmmc_2: mmc@f723f000 { compatible = "hisilicon,hi6220-dw-mshc"; reg = <0x0 0xf723f000 0x0 0x1000>; interrupts = <0x0 0x4a 0x4>;
Signature · 1 line
2.53.0
Re: [PATCH 2/2] arm64: dts: hisilicon: Rename dwmmc nodes to mmc
Quoted 10 lines · Bhargav Joshi
The core mmc devicetree schema expects mmc controller nodes to be named using '^mmc(@.*)?$' pattern.
The legacy Hisilicon SoC files (hi3660, hi3670, and hi6220) previously used the 'dwmmc' prefix for their nodes. This caused warnings during
dtbs_check.Rename the 'dwmmc' nodes to 'mmc' to comply with the standard schema and
dtbs_checkwarnings. The legacy phandle labels are kept intact.
Quoted 6 lines
Signed-off-by Bhargav Joshi <[email protected]>--- arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 4 ++-- arch/arm64/boot/dts/hisilicon/hi3670.dtsi | 4 ++-- arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-)
Best regards,
Krzysztof
Quoted 8 lines · Bhargav Joshi
This series converts the Hisilicon dw-mshc text bindings to DT schema format and cleans up legacy node names in Hisilicon board files.
While testing the new YAML schema,
dtbs_checkflagged the hi3660, hi3670, and hi6220 SoC files for using the non-standard 'dwmmc' node name prefix. resulting in warnings.
Quoted 5 lines
Patch 1 Convert to DT schema
Patch 2 updates the Hisilicon dtsi files to use standard 'mmc' node name.Signed-off-by Bhargav Joshi <[email protected]>
Thanks Bhargav