StarFive's SDIO/eMMC driver support
Subsystems (7)
William Qiu
maintainerv4 cover StarFive's SDIO/eMMC driver support
Hi,
This patchset adds initial rudimentary support for the StarFive designware mobile storage host controller driver. And this driver will be used in StarFive's VisionFive 2 board. The main purpose of adding this driver is to accommodate the ultra-high speed mode of eMMC.
The last patch should be applied after the patchset [1]:
[1] https://lore.kernel.org/all/[email protected]/
Changes v3->v4:
- Added documentation to describe StarFive System Controller Registers.
- Added aon_syscon and stg_syscon node.
- Fixed some checkpatch errors/warnings.
Changes v2->v3:
- Wraped commit message according to Linux coding style.
- Rephrased the description of the patches.
- Changed the description of syscon regsiter.
- Dropped redundant properties.
Changes v1->v2:
- Renamed the dt-binding 'starfive,jh7110-sdio.yaml' to 'starfive,jh7110-mmc.yaml'.
- Changed the type of 'starfive,syscon' and modify its description.
- Deleted unused head files like '#include <linux/gpio.h>'.
- Added comment for the 'rise_point' and 'fall_point'.
- Changed the API 'num_caps' to 'common_caps'.
- Changed the node name 'sys_syscon' to 'syscon'.
- Changed the node name 'sdio' to 'mmc'.
The patch series is based on v6.1.
William Qiu (4):
dt-bindings: mmc: Add StarFive MMC module
mmc: starfive: Add sdio/emmc driver support
riscv: dts: starfive: Add mmc node
dt-bindings: syscon: Add StarFive syscon doc
.../bindings/mmc/starfive,jh7110-mmc.yaml | 77 ++++++++ .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++ MAINTAINERS | 11 ++ .../jh7110-starfive-visionfive-2.dtsi | 23 +++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 47 +++++ drivers/mmc/host/Kconfig | 10 + drivers/mmc/host/Makefile | 1 + drivers/mmc/host/dw_mmc-starfive.c | 186 ++++++++++++++++++ 8 files changed, 406 insertions(+) create mode 100644 Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml create mode 100644 drivers/mmc/host/dw_mmc-starfive.c
--
2.34.1
William Qiu
maintainerPATCH v4 1/4 dt-bindings: mmc: Add StarFive MMC module
Add documentation to describe StarFive designware mobile storage host controller driver.
--- .../bindings/mmc/starfive,jh7110-mmc.yaml | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml
Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml new file +77 -0
@@ -0,0 +1,77 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mmc/starfive,jh7110-mmc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive Designware Mobile Storage Host Controller + +description: + StarFive uses the Synopsys designware mobile storage host controller + to interface a SoC with storage medium such as eMMC or SD/MMC cards. + +allOf: + - $ref: synopsys-dw-mshc-common.yaml# + +maintainers: + - William Qiu <[email protected]> + +properties: + compatible: + const: starfive,jh7110-mmc + + reg: + maxItems: 1 + + clocks: + items: + - description: biu clock + - description: ciu clock + + clock-names: + items: + - const: biu + - const: ciu + + interrupts: + maxItems: 1 + + starfive,sysreg: + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to System Register Controller syscon node + - description: offset of SYS_SYSCONSAIF__SYSCFG register for MMC controller + - description: shift of SYS_SYSCONSAIF__SYSCFG register for MMC controller + - description: mask of SYS_SYSCONSAIF__SYSCFG register for MMC controller + description: + Should be four parameters, the phandle to System Register Controller + syscon node and the offset/shift/mask of SYS_SYSCONSAIF__SYSCFG register + for MMC controller. + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - starfive,sysreg + +unevaluatedProperties: false + +examples: + - | + mmc@16010000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x16010000 0x10000>; + clocks = <&syscrg 91>, + <&syscrg 93>; + clock-names = "biu","ciu"; + resets = <&syscrg 64>; + reset-names = "reset"; + interrupts = <74>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x14 0x1a 0x7c000000>; + };
Signature · 1 line
2.34.1
Re: [PATCH v4 1/4] dt-bindings: mmc: Add StarFive MMC module
Hello William,
Are you sure changing driver is better than changing yaml bindings? All
previous version sent was syscon and sysreg seems not consistent with
other codes.
Best regards,
Shengyu
Quoted 93 lines
Add documentation to describe StarFive designware mobile storage host controller driver.
Signed-off-by William Qiu <[email protected]>Reviewed-by Krzysztof Kozlowski <[email protected]>--- .../bindings/mmc/starfive,jh7110-mmc.yaml | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+)create mode 100644
Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yamlDocumentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml new file +77
-0@@ -0,0 +1,77 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mmc/starfive,jh7110-mmc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive Designware Mobile Storage Host Controller + +description: + StarFive uses the Synopsys designware mobile storage host controller + to interface a SoC with storage medium such as eMMC or SD/MMC cards. + +allOf: + - $ref: synopsys-dw-mshc-common.yaml# + +maintainers: + - William Qiu <[email protected]> + +properties: + compatible: + const: starfive,jh7110-mmc + + reg: + maxItems: 1 + + clocks: + items: + - description: biu clock + - description: ciu clock + + clock-names: + items: + - const: biu + - const: ciu + + interrupts: + maxItems: 1 + + starfive,sysreg: + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to System Register Controller syscon node + - description: offset of SYS_SYSCONSAIF__SYSCFG register for MMC controller + - description: shift of SYS_SYSCONSAIF__SYSCFG register for MMC controller + - description: mask of SYS_SYSCONSAIF__SYSCFG register for MMC controller + description: + Should be four parameters, the phandle to System Register Controller + syscon node and the offset/shift/mask of SYS_SYSCONSAIF__SYSCFG register + for MMC controller. + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - starfive,sysreg + +unevaluatedProperties: false + +examples: + - | + mmc@16010000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x16010000 0x10000>; + clocks = <&syscrg 91>, + <&syscrg 93>; + clock-names = "biu","ciu"; + resets = <&syscrg 64>; + reset-names = "reset"; + interrupts = <74>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x14 0x1a 0x7c000000>; + };
William Qiu
maintainerRe: [PATCH v4 1/4] dt-bindings: mmc: Add StarFive MMC module
Quoted 4 lines · Shengyu Qu
Hello William,
Are you sure changing driver is better than changing yaml bindings? All
Quoted 8 lines
previous version sent was syscon and sysreg seems not consistent with
other codes.
Best regards,
Shengyu
Hi Shengyu,
After discussing with colleagues, we decided to restore the lable name to sys_syscon, and sysreg was just a unique name for the functionality of MMC, which will be used in all future versions.
Thanks for taking time reviewing this patch series.
Best Regards
William
Quoted 93 lines
Quoted 93 lines
Add documentation to describe StarFive designware mobile storage host controller driver.
Signed-off-by William Qiu <[email protected]>Reviewed-by Krzysztof Kozlowski <[email protected]>---
.../bindings/mmc/starfive,jh7110-mmc.yaml | 77 +++++++++++++++++++1 file changed, 77 insertions(+)create mode 100644
Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yamlDocumentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml new file +77
-0@@ -0,0 +1,77 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mmc/starfive,jh7110-mmc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive Designware Mobile Storage Host Controller + +description: + StarFive uses the Synopsys designware mobile storage host controller + to interface a SoC with storage medium such as eMMC or SD/MMC cards. + +allOf: + - $ref: synopsys-dw-mshc-common.yaml# + +maintainers: + - William Qiu <[email protected]> + +properties: + compatible: + const: starfive,jh7110-mmc + + reg: + maxItems: 1 + + clocks: + items: + - description: biu clock + - description: ciu clock + + clock-names: + items: + - const: biu + - const: ciu + + interrupts: + maxItems: 1 + + starfive,sysreg: + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to System Register Controller syscon node + - description: offset of SYS_SYSCONSAIF__SYSCFG register for MMC controller + - description: shift of SYS_SYSCONSAIF__SYSCFG register for MMC controller + - description: mask of SYS_SYSCONSAIF__SYSCFG register for MMC controller + description: + Should be four parameters, the phandle to System Register Controller + syscon node and the offset/shift/mask of SYS_SYSCONSAIF__SYSCFG register + for MMC controller. + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - starfive,sysreg + +unevaluatedProperties: false + +examples: + - | + mmc@16010000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x16010000 0x10000>; + clocks = <&syscrg 91>, + <&syscrg 93>; + clock-names = "biu","ciu"; + resets = <&syscrg 64>; + reset-names = "reset"; + interrupts = <74>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x14 0x1a 0x7c000000>; + };
Re: [PATCH v4 1/4] dt-bindings: mmc: Add StarFive MMC module
Hello William,
Thanks for your reply. So there's v5 series? Btw, please fix maintainer information:
https://patchwork.kernel.org/project/linux-riscv/patch/[email protected]/
Best regards,
Shengyu
Quoted 118 lines · Shengyu Qu
Quoted 4 lines
Hello William,
Are you sure changing driver is better than changing yaml bindings? All
Quoted 8 lines
previous version sent was syscon and sysreg seems not consistent with
other codes.
Best regards,
Shengyu
Hi Shengyu,
After discussing with colleagues, we decided to restore the lable name to
sys_syscon, and sysreg was just a unique name for the functionality of MMC, which will be used in all future versions.Thanks for taking time reviewing this patch series.
Best Regards
WilliamQuoted 93 lines
Quoted 93 lines
Add documentation to describe StarFive designware mobile storage host controller driver.
Signed-off-by William Qiu <[email protected]>Reviewed-by Krzysztof Kozlowski <[email protected]>--- .../bindings/mmc/starfive,jh7110-mmc.yaml | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+)create mode 100644
Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yamlDocumentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml new file +77
-0@@ -0,0 +1,77 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mmc/starfive,jh7110-mmc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive Designware Mobile Storage Host Controller + +description: + StarFive uses the Synopsys designware mobile storage host controller + to interface a SoC with storage medium such as eMMC or SD/MMC cards. + +allOf: + - $ref: synopsys-dw-mshc-common.yaml# + +maintainers: + - William Qiu <[email protected]> + +properties: + compatible: + const: starfive,jh7110-mmc + + reg: + maxItems: 1 + + clocks: + items: + - description: biu clock + - description: ciu clock + + clock-names: + items: + - const: biu + - const: ciu + + interrupts: + maxItems: 1 + + starfive,sysreg: + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to System Register Controller syscon node + - description: offset of SYS_SYSCONSAIF__SYSCFG register for MMC controller + - description: shift of SYS_SYSCONSAIF__SYSCFG register for MMC controller + - description: mask of SYS_SYSCONSAIF__SYSCFG register for MMC controller + description: + Should be four parameters, the phandle to System Register Controller + syscon node and the offset/shift/mask of SYS_SYSCONSAIF__SYSCFG register + for MMC controller. + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - starfive,sysreg + +unevaluatedProperties: false + +examples: + - | + mmc@16010000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x16010000 0x10000>; + clocks = <&syscrg 91>, + <&syscrg 93>; + clock-names = "biu","ciu"; + resets = <&syscrg 64>; + reset-names = "reset"; + interrupts = <74>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x14 0x1a 0x7c000000>; + };
A message that is not in the archive (sent off-list or not yet received): [email protected]
William Qiu
maintainerRe: [PATCH v4 1/4] dt-bindings: mmc: Add StarFive MMC module
Quoted 10 lines · Shengyu Qu
Hello William,
Thanks for your reply. So there's v5 series? Btw, please fix maintainer information:
https://patchwork.kernel.org/project/linux-riscv/patch/[email protected]/
Best regards,
Shengyu
Hi Shengyu,
Here is v4 series, and I fixed the maintainer information in this series which Uffe would merge in his next branch.
Thanks for taking time to review this patch series.
Best Regards
William
Quoted 118 lines
Quoted 118 lines · Shengyu Qu
Quoted 4 lines
Hello William,
Are you sure changing driver is better than changing yaml bindings? All
Quoted 8 lines
previous version sent was syscon and sysreg seems not consistent with
other codes.
Best regards,
Shengyu
Hi Shengyu,
After discussing with colleagues, we decided to restore the lable name to
sys_syscon, and sysreg was just a unique name for the functionality of MMC, which will be used in all future versions.Thanks for taking time reviewing this patch series.
Best Regards
WilliamQuoted 93 lines
Quoted 93 lines
Add documentation to describe StarFive designware mobile storage host controller driver.
Signed-off-by William Qiu <[email protected]>Reviewed-by Krzysztof Kozlowski <[email protected]>---
.../bindings/mmc/starfive,jh7110-mmc.yaml | 77 +++++++++++++++++++1 file changed, 77 insertions(+)create mode 100644
Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yamlDocumentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml new file +77
-0@@ -0,0 +1,77 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mmc/starfive,jh7110-mmc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive Designware Mobile Storage Host Controller + +description: + StarFive uses the Synopsys designware mobile storage host controller + to interface a SoC with storage medium such as eMMC or SD/MMC cards. + +allOf: + - $ref: synopsys-dw-mshc-common.yaml# + +maintainers: + - William Qiu <[email protected]> + +properties: + compatible: + const: starfive,jh7110-mmc + + reg: + maxItems: 1 + + clocks: + items: + - description: biu clock + - description: ciu clock + + clock-names: + items: + - const: biu + - const: ciu + + interrupts: + maxItems: 1 + + starfive,sysreg: + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to System Register Controller syscon node + - description: offset of SYS_SYSCONSAIF__SYSCFG register for MMC controller + - description: shift of SYS_SYSCONSAIF__SYSCFG register for MMC controller + - description: mask of SYS_SYSCONSAIF__SYSCFG register for MMC controller + description: + Should be four parameters, the phandle to System Register Controller + syscon node and the offset/shift/mask of SYS_SYSCONSAIF__SYSCFG register + for MMC controller. + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - starfive,sysreg + +unevaluatedProperties: false + +examples: + - | + mmc@16010000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x16010000 0x10000>; + clocks = <&syscrg 91>, + <&syscrg 93>; + clock-names = "biu","ciu"; + resets = <&syscrg 64>; + reset-names = "reset"; + interrupts = <74>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x14 0x1a 0x7c000000>; + };
Re: [PATCH v4 1/4] dt-bindings: mmc: Add StarFive MMC module
In reply to Shengyu QuQuoted 3 lines · Shengyu Qu
Hello William,
Are you sure changing driver is better than changing yaml bindings? All
What do you mean - changing driver? This is new driver, new code, isn't it?
Best regards,
Krzysztof
Re: [PATCH v4 1/4] dt-bindings: mmc: Add StarFive MMC module
Quoted 6 lines · Krzysztof Kozlowski
Quoted 3 lines · Shengyu Qu
Hello William,
Are you sure changing driver is better than changing yaml bindings? All
What do you mean - changing driver? This is new driver, new code, isn't it?
Changing w.r.t. the v3 that was applied I suppose.
The v3 was dropped and patches 1 & 2 here have been applied instead, so this request from Shengyu is moot now anyway.
Cheers,
Conor.
Re: [PATCH v4 1/4] dt-bindings: mmc: Add StarFive MMC module
Quoted 12 lines · Krzysztof Kozlowski
Quoted 5 lines · Shengyu Qu
Quoted 3 lines
Hello William,
Are you sure changing driver is better than changing yaml bindings? All
What do you mean - changing driver? This is new driver, new code, isn't it?
Changing w.r.t. the v3 that was applied I suppose.
The v3 was dropped and patches 1 & 2 here have been applied instead, so this request from Shengyu is moot now anyway.Cheers,
Conor.
That's my mistake. I misunderstood current situation :(
Best regards,
Shengyu
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH v4 1/4] dt-bindings: mmc: Add StarFive MMC module
Sorry, forgot what I said. I didn't see Krzysztof's reply on V3 serires.
Best regards,
Shengyu
Quoted 111 lines
Hello William,
Are you sure changing driver is better than changing yaml bindings? All
previous version sent was syscon and sysreg seems not consistent with
other codes.
Best regards,
Shengyu
Quoted 99 lines
Add documentation to describe StarFive designware mobile storage host controller driver.
Signed-off-by William Qiu <[email protected]>Reviewed-by Krzysztof Kozlowski <[email protected]>---
.../bindings/mmc/starfive,jh7110-mmc.yaml | 77 +++++++++++++++++++1 file changed, 77 insertions(+)create mode 100644
Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yamlDocumentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml new file +43
-0@@ -0,0 +1,77 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mmc/starfive,jh7110-mmc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive Designware Mobile Storage Host Controller + +description: + StarFive uses the Synopsys designware mobile storage host controller + to interface a SoC with storage medium such as eMMC or SD/MMC cards. + +allOf: + - $ref: synopsys-dw-mshc-common.yaml# + +maintainers: + - William Qiu <[email protected]> + +properties: + compatible: + const: starfive,jh7110-mmc + + reg: + maxItems: 1 + + clocks: + items: + - description: biu clock + - description: ciu clock + + clock-names: + items: + - const: biu + - const: ciu + + interrupts: + maxItems: 1 + + starfive,sysreg: + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to System Register Controllersyscon node
+ - description: offset ofSYS_SYSCONSAIF__SYSCFGregister for MMC controller
+ - description: shift ofSYS_SYSCONSAIF__SYSCFGregister for MMC controller
+ - description: mask ofSYS_SYSCONSAIF__SYSCFGregister for MMC controller
+ description:
+ Should be four parameters, the phandle to System Register Controller
+ syscon node and the offset/shift/mask ofSYS_SYSCONSAIF__SYSCFGregister
+ for MMC controller.Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml new file +27
-0+ +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - starfive,sysreg + +unevaluatedProperties: false + +examples: + - | + mmc@16010000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x16010000 0x10000>; + clocks = <&syscrg 91>, + <&syscrg 93>; + clock-names = "biu","ciu"; + resets = <&syscrg 64>; + reset-names = "reset"; + interrupts = <74>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x14 0x1a 0x7c000000>; + };
William Qiu
maintainerPATCH v4 2/4 mmc: starfive: Add sdio/emmc driver support
In reply to William QiuAdd sdio/emmc driver support for StarFive JH7110 soc.
--- MAINTAINERS | 6 + drivers/mmc/host/Kconfig | 10 ++ drivers/mmc/host/Makefile | 1 + drivers/mmc/host/dw_mmc-starfive.c | 186 +++++++++++++++++++++++++++++ 4 files changed, 203 insertions(+) create mode 100644 drivers/mmc/host/dw_mmc-starfive.c
MAINTAINERS +6 -0
@@ -19640,6 +19640,12 @@ F: Documentation/devicetree/bindings/clock/starfive,jh71*.yaml F: drivers/clk/starfive/clk-starfive-jh71* F: include/dt-bindings/clock/starfive?jh71*.h +STARFIVE JH7110 MMC/SD/SDIO DRIVER +M: William Qiu <[email protected]> +S: Supported +F: Documentation/devicetree/bindings/mmc/starfive* +F: drivers/mmc/host/dw_mmc-starfive.c + STARFIVE JH71X0 PINCTRL DRIVERS M: Emil Renner Berthing <[email protected]> M: Jianlong Huang <[email protected]>
drivers/mmc/host/Kconfig +10 -0
@@ -871,6 +871,16 @@ config MMC_DW_ROCKCHIP Synopsys DesignWare Memory Card Interface driver. Select this option for platforms based on RK3066, RK3188 and RK3288 SoC's. +config MMC_DW_STARFIVE + tristate "StarFive specific extensions for Synopsys DW Memory Card Interface" + depends on SOC_STARFIVE + depends on MMC_DW + select MMC_DW_PLTFM + help + This selects support for StarFive JH7110 SoC specific extensions to the + Synopsys DesignWare Memory Card Interface driver. Select this option + for platforms based on StarFive JH7110 SoC. + config MMC_SH_MMCIF tristate "SuperH Internal MMCIF support" depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
drivers/mmc/host/Makefile +1 -0
@@ -56,6 +56,7 @@ obj-$(CONFIG_MMC_DW_HI3798CV200) += dw_mmc-hi3798cv200.o obj-$(CONFIG_MMC_DW_K3) += dw_mmc-k3.o obj-$(CONFIG_MMC_DW_PCI) += dw_mmc-pci.o obj-$(CONFIG_MMC_DW_ROCKCHIP) += dw_mmc-rockchip.o +obj-$(CONFIG_MMC_DW_STARFIVE) += dw_mmc-starfive.o obj-$(CONFIG_MMC_SH_MMCIF) += sh_mmcif.o obj-$(CONFIG_MMC_JZ4740) += jz4740_mmc.o obj-$(CONFIG_MMC_VUB300) += vub300.o
drivers/mmc/host/dw_mmc-starfive.c new file +186 -0
186 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH v4 2/4] mmc: starfive: Add sdio/emmc driver support
Hello William,
I'm digging into downstream mmc driver these days and found a problem
that current version mainline driver doesn't has a voltage switch function for
it. Downstream older version has one but was deleted in this commit [1].
It was deleted since vf2's SD slot doesn't have 1.8V input but commiter forgot
that vf2's eMMC slot has a proper 1.8V input.
So could you add voltage switch function for mainline? I've met a eMMC speed
problem possibly due to it.
Best regards,
Shengyu
[1] https://github.com/starfive-tech/linux/commit/8037d59091d276e74be38e5fafaaebe36eaa77e1
Quoted 254 lines · William Qiu
Add sdio/emmc driver support for StarFive JH7110 soc.
Tested-by Conor Dooley <[email protected]>Signed-off-by William Qiu <[email protected]>--- MAINTAINERS | 6 + drivers/mmc/host/Kconfig | 10 ++ drivers/mmc/host/Makefile | 1 + drivers/mmc/host/dw_mmc-starfive.c | 186 +++++++++++++++++++++++++++++ 4 files changed, 203 insertions(+)create mode 100644
drivers/mmc/host/dw_mmc-starfive.cMAINTAINERS +6
-0@@ -19640,6 +19640,12 @@ F: Documentation/devicetree/bindings/clock/starfive,jh71*.yaml F: drivers/clk/starfive/clk-starfive-jh71* F: include/dt-bindings/clock/starfive?jh71*.h +STARFIVE JH7110 MMC/SD/SDIO DRIVER +M: William Qiu <[email protected]> +S: Supported +F: Documentation/devicetree/bindings/mmc/starfive* +F: drivers/mmc/host/dw_mmc-starfive.c + STARFIVE JH71X0 PINCTRL DRIVERS M: Emil Renner Berthing <[email protected]> M: Jianlong Huang <[email protected]>drivers/mmc/host/Kconfig +10
-0@@ -871,6 +871,16 @@ config MMC_DW_ROCKCHIP Synopsys DesignWare Memory Card Interface driver. Select this option for platforms based on RK3066, RK3188 and RK3288 SoC's. +config MMC_DW_STARFIVE + tristate "StarFive specific extensions for Synopsys DW Memory Card Interface" + depends on SOC_STARFIVE + depends on MMC_DW + select MMC_DW_PLTFM + help + This selects support for StarFive JH7110 SoC specific extensions to the + Synopsys DesignWare Memory Card Interface driver. Select this option + for platforms based on StarFive JH7110 SoC. + config MMC_SH_MMCIF tristate "SuperH Internal MMCIF support" depends on SUPERH || ARCH_RENESAS || COMPILE_TESTdrivers/mmc/host/Makefile +1
-0@@ -56,6 +56,7 @@ obj-$(CONFIG_MMC_DW_HI3798CV200) += dw_mmc-hi3798cv200.o obj-$(CONFIG_MMC_DW_K3) += dw_mmc-k3.o obj-$(CONFIG_MMC_DW_PCI) += dw_mmc-pci.o obj-$(CONFIG_MMC_DW_ROCKCHIP) += dw_mmc-rockchip.o +obj-$(CONFIG_MMC_DW_STARFIVE) += dw_mmc-starfive.o obj-$(CONFIG_MMC_SH_MMCIF) += sh_mmcif.o obj-$(CONFIG_MMC_JZ4740) += jz4740_mmc.o obj-$(CONFIG_MMC_VUB300) += vub300.odrivers/mmc/host/dw_mmc-starfive.c new file +186
-0@@ -0,0 +1,186 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* StarFive Designware Mobile Storage Host Controller Driver +* +* Copyright (c) 2022 StarFive Technology Co., Ltd. +*/ + +#include <linux/clk.h> +#include <linux/delay.h> +#include <linux/mfd/syscon.h> +#include <linux/mmc/host.h> +#include <linux/module.h> +#include <linux/of_address.h> +#include <linux/platform_device.h> +#include <linux/regmap.h> + +#include "dw_mmc.h" +#include "dw_mmc-pltfm.h" + +#define ALL_INT_CLR 0x1ffff +#define MAX_DELAY_CHAIN 32 + +struct starfive_priv { +struct device *dev; +struct regmap *reg_syscon; +u32 syscon_offset; +u32 syscon_shift; +u32 syscon_mask; +}; + +static void dw_mci_starfive_set_ios (struct dw_mci *host,struct mmc_ios *ios) +{ +int ret; +unsigned int clock; + +if (ios->timing ==MMC_TIMING_MMC_DDR52 || ios->timing ==MMC_TIMING_UHS_DDR50 ) { + clock = (ios->clock >50000000 && ios->clock <=52000000 ) ?100000000 : ios->clock; + ret =clk_set_rate (host->ciu_clk, clock); +if (ret) +dev_dbg (host->dev,"Use an external frequency divider %uHz\n" , ios->clock); + host->bus_hz =clk_get_rate (host->ciu_clk); + }else { +dev_dbg (host->dev,"Using the internal divider\n" ); + } +} + +static int dw_mci_starfive_execute_tuning (struct dw_mci_slot *slot, +u32 opcode) +{ +static const int grade =MAX_DELAY_CHAIN ; +struct dw_mci *host = slot->host; +struct starfive_priv *priv = host->priv; +int rise_point =-1 , fall_point =-1 ; +int err, prev_err; +int i; +bool found =0 ; +u32 regval; + +/* +* Use grade as the max delay chain, and use the rise_point and +* fall_point to ensure the best sampling point of a data input +* signals. +*/ +for (i =0 ; i < grade; i++) { + regval = i << priv->syscon_shift; + err =regmap_update_bits (priv->reg_syscon, priv->syscon_offset, + priv->syscon_mask, regval); +if (err) +return err; +mci_writel (host,RINTSTS ,ALL_INT_CLR ); + + err =mmc_send_tuning (slot->mmc, opcode,NULL ); +if (!err) + found =1 ; + +if (i >0 ) { +if (err && !prev_err) + fall_point = i -1 ; +if (!err && prev_err) + rise_point = i; + } + +if (rise_point !=-1 && fall_point !=-1 ) + goto tuning_out; + + prev_err = err; + err =0 ; + } + +tuning_out: +if (found) { +if (rise_point ==-1 ) + rise_point =0 ; +if (fall_point ==-1 ) + fall_point = grade -1 ; +if (fall_point < rise_point) { +if ((rise_point + fall_point) > + (grade -1 )) + i = fall_point /2 ; +else + i = (rise_point + grade -1 ) /2 ; + }else { + i = (rise_point + fall_point) /2 ; + } + + regval = i << priv->syscon_shift; + err =regmap_update_bits (priv->reg_syscon, priv->syscon_offset, + priv->syscon_mask, regval); +if (err) +return err; +mci_writel (host,RINTSTS ,ALL_INT_CLR ); + +dev_info (host->dev,"Found valid delay chain! use it [delay=%d]\n" , i); + }else { +dev_err (host->dev,"No valid delay chain! use default\n" ); + err = -EINVAL ; + } + +mci_writel (host,RINTSTS ,ALL_INT_CLR ); +return err; +} + +static int dw_mci_starfive_parse_dt (struct dw_mci *host) +{ +struct of_phandle_args args; +struct starfive_priv *priv; +int ret; + + priv =devm_kzalloc (host->dev,sizeof (*priv),GFP_KERNEL ); +if (!priv) +return -ENOMEM ; + + ret =of_parse_phandle_with_fixed_args (host->dev->of_node, +"starfive,sysreg" ,3 ,0 , &args); +if (ret) { +dev_err (host->dev,"Failed to parse starfive,sysreg\n" ); +return -EINVAL ; + } + + priv->reg_syscon =syscon_node_to_regmap (args.np); +of_node_put (args.np); +if (IS_ERR (priv->reg_syscon)) +return PTR_ERR (priv->reg_syscon); + + priv->syscon_offset = args.args[0 ]; + priv->syscon_shift = args.args[1 ]; + priv->syscon_mask = args.args[2 ]; + + host->priv = priv; + +return 0 ; +} + +static const struct dw_mci_drv_data starfive_data = { + .common_caps =MMC_CAP_CMD23 , + .set_ios = dw_mci_starfive_set_ios, + .parse_dt = dw_mci_starfive_parse_dt, + .execute_tuning = dw_mci_starfive_execute_tuning, +}; + +static const struct of_device_id dw_mci_starfive_match[] = { + { .compatible ="starfive,jh7110-mmc" , + .data = &starfive_data }, + {}, +}; +MODULE_DEVICE_TABLE (of, dw_mci_starfive_match); + +static int dw_mci_starfive_probe (struct platform_device *pdev) +{ +return dw_mci_pltfm_register (pdev, &starfive_data); +} + +static struct platform_driver dw_mci_starfive_driver = { + .probe = dw_mci_starfive_probe, + .remove = dw_mci_pltfm_remove, + .driver = { + .name ="dwmmc_starfive" , + .probe_type =PROBE_PREFER_ASYNCHRONOUS , + .of_match_table = dw_mci_starfive_match, + }, +}; +module_platform_driver (dw_mci_starfive_driver); + +MODULE_DESCRIPTION ("StarFive JH7110 Specific DW-MSHC Driver Extension" ); +MODULE_LICENSE ("GPL" ); +MODULE_ALIAS ("platform:dwmmc_starfive" );
Re: [PATCH v4 2/4] mmc: starfive: Add sdio/emmc driver support
Hello William,
Sorry for making noise about this, but seems deleted voltage swtich function
doesn't help about this. But there's still a problem about eMMC speed. Currently
only about 20MB/s maximum reading speed could be reached when using eMMC
on VF2, any idea about this?
Best regards,
Shengyu
Quoted 286 lines · Shengyu Qu
Hello William,
I'm digging into downstream mmc driver these days and found a problem
that current version mainline driver doesn't has a voltage switch function for
it. Downstream older version has one but was deleted in this commit [1].
It was deleted since vf2's SD slot doesn't have 1.8V input but commiter forgot
that vf2's eMMC slot has a proper 1.8V input.
So could you add voltage switch function for mainline? I've met a eMMC speed
problem possibly due to it.
Best regards,
Shengyu
[1] https://github.com/starfive-tech/linux/commit/8037d59091d276e74be38e5fafaaebe36eaa77e1
Quoted 263 lines · William Qiu
Add sdio/emmc driver support for StarFive JH7110 soc.
Tested-by Conor Dooley <[email protected]>Signed-off-by William Qiu <[email protected]>---
MAINTAINERS | 6 + drivers/mmc/host/Kconfig | 10 ++ drivers/mmc/host/Makefile | 1 +drivers/mmc/host/dw_mmc-starfive.c| 186 +++++++++++++++++++++++++++++4 files changed, 203 insertions(+)create mode 100644
drivers/mmc/host/dw_mmc-starfive.cMAINTAINERS +0
-0@@ -19640,6 +19640,12 @@ F:
Documentation/devicetree/bindings/clock/starfive,jh71*.yamlF:drivers/clk/starfive/clk-starfive-jh71*
F: include/dt-bindings/clock/starfive?jh71*.h +STARFIVE JH7110 MMC/SD/SDIO DRIVERMAINTAINERS +5
-0+M: William Qiu <[email protected]> +S: Supported +F: Documentation/devicetree/bindings/mmc/starfive* +F: drivers/mmc/host/dw_mmc-starfive.c +STARFIVE JH71X0 PINCTRL DRIVERS
M: Emil Renner Berthing <[email protected]> M: Jianlong Huang <[email protected]>drivers/mmc/host/Kconfig +0
-0@@ -871,6 +871,16 @@ config MMC_DW_ROCKCHIPSynopsys DesignWare Memory Card Interface driver. Select this option for platforms based on RK3066, RK3188 and RK3288 SoC's. +config
MMC_DW_STARFIVE
+ tristate "StarFive specific extensions for Synopsys DW Memory Card Interface"
+ depends onSOC_STARFIVE
+ depends onMMC_DW
+ selectMMC_DW_PLTFM
+ help
+ This selects support for StarFive JH7110 SoC specific extensions to the
+ Synopsys DesignWare Memory Card Interface driver. Select this option
+ for platforms based on StarFive JH7110 SoC.
+
configMMC_SH_MMCIF
tristate "SuperH Internal MMCIF support"
depends on SUPERH ||ARCH_RENESAS||COMPILE_TESTdrivers/mmc/host/Makefile +0
-0@@ -56,6 +56,7 @@ obj-$(CONFIG_MMC_DW_HI3798CV200) +=dw_mmc-hi3798cv200.o
obj-$(CONFIG_MMC_DW_K3) += dw_mmc-k3.o obj-$(CONFIG_MMC_DW_PCI) += dw_mmc-pci.o obj-$(CONFIG_MMC_DW_ROCKCHIP) += dw_mmc-rockchip.o +obj-$(CONFIG_MMC_DW_STARFIVE) += dw_mmc-starfive.o obj-$(CONFIG_MMC_SH_MMCIF) += sh_mmcif.o obj-$(CONFIG_MMC_JZ4740) += jz4740_mmc.o obj-$(CONFIG_MMC_VUB300) += vub300.odrivers/mmc/host/dw_mmc-starfive.c new file +31
-0@@ -0,0 +1,186 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* StarFive Designware Mobile Storage Host Controller Driver +* +* Copyright (c) 2022 StarFive Technology Co., Ltd. +*/ + +#include <linux/clk.h> +#include <linux/delay.h> +#include <linux/mfd/syscon.h> +#include <linux/mmc/host.h> +#include <linux/module.h> +#include <linux/of_address.h> +#include <linux/platform_device.h> +#include <linux/regmap.h> + +#include "dw_mmc.h" +#include "dw_mmc-pltfm.h" + +#define ALL_INT_CLR 0x1ffff +#define MAX_DELAY_CHAIN 32 + +struct starfive_priv { + struct device *dev; + struct regmap *reg_syscon; + u32 syscon_offset; + u32 syscon_shift; + u32 syscon_mask; +}; + +static void dw_mci_starfive_set_ios(struct dw_mci *host, struct
mmc_ios*ios)drivers/mmc/host/dw_mmc-starfive.c new file +5
-0+{ + int ret; + unsigned int clock; + + if (ios->timing == MMC_TIMING_MMC_DDR52 || ios->timing ==
MMC_TIMING_UHS_DDR50) {
+ clock = (ios->clock> 50000000 &&ios->clock<= 52000000) ? 100000000 :ios->clock;
+ ret =clk_set_rate(host->ciu_clk, clock);
+ if (ret)
+dev_dbg(host->dev, "Use an external frequency divider %uHz\n", ios->clock);
+host->bus_hz=clk_get_rate(host->ciu_clk);
+ } else {
+dev_dbg(host->dev, "Using the internal divider\n"); + }drivers/mmc/host/dw_mmc-starfive.c new file +69
-0+} + +static int dw_mci_starfive_execute_tuning (struct dw_mci_slot *slot, + u32 opcode) +{ + static const int grade = MAX_DELAY_CHAIN; + struct dw_mci *host = slot->host; + struct starfive_priv *priv = host->priv; + int rise_point = -1, fall_point = -1; + int err, prev_err; + int i; + bool found = 0; + u32 regval; + + /* + * Use grade as the max delay chain, and use the rise_point and + * fall_point to ensure the best sampling point of a data input + * signals. + */ + for (i = 0; i < grade; i++) { + regval = i << priv->syscon_shift; + err = regmap_update_bits(priv->reg_syscon, priv->syscon_offset, + priv->syscon_mask, regval); + if (err) + return err; + mci_writel(host, RINTSTS, ALL_INT_CLR); + + err = mmc_send_tuning(slot->mmc, opcode, NULL); + if (!err) + found = 1; + + if (i > 0) { + if (err && !prev_err) + fall_point = i - 1; + if (!err && prev_err) + rise_point = i; + } + + if (rise_point != -1 && fall_point != -1) + goto tuning_out; + + prev_err = err; + err = 0; + } + +tuning_out: + if (found) { + if (rise_point == -1) + rise_point = 0; + if (fall_point == -1) + fall_point = grade - 1; + if (fall_point < rise_point) { + if ((rise_point + fall_point) > + (grade - 1)) + i = fall_point / 2; + else + i = (rise_point + grade - 1) / 2; + } else { + i = (rise_point + fall_point) / 2; + } + + regval = i << priv->syscon_shift; + err = regmap_update_bits(priv->reg_syscon, priv->syscon_offset, + priv->syscon_mask, regval); + if (err) + return err; + mci_writel(host, RINTSTS, ALL_INT_CLR); + + dev_info(host->dev, "Found valid delay chain! use it[delay=%d]\n", i);
+ } else {
+dev_err(host->dev, "No valid delay chain! use default\n"); + err =-EINVAL;
+ }drivers/mmc/host/dw_mmc-starfive.c new file +67
-0+ + mci_writel(host, RINTSTS, ALL_INT_CLR); + return err; +} + +static int dw_mci_starfive_parse_dt (struct dw_mci *host) +{ + struct of_phandle_args args; + struct starfive_priv *priv; + int ret; + + priv = devm_kzalloc(host->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + ret = of_parse_phandle_with_fixed_args(host->dev->of_node, + "starfive,sysreg", 3, 0, &args); + if (ret) { + dev_err(host->dev, "Failed to parse starfive,sysreg\n"); + return -EINVAL; + } + + priv->reg_syscon = syscon_node_to_regmap(args.np); + of_node_put(args.np); + if (IS_ERR(priv->reg_syscon)) + return PTR_ERR(priv->reg_syscon); + + priv->syscon_offset = args.args[0]; + priv->syscon_shift = args.args[1]; + priv->syscon_mask = args.args[2]; + + host->priv = priv; + + return 0; +} + +static const struct dw_mci_drv_data starfive_data = { + .common_caps = MMC_CAP_CMD23, + .set_ios = dw_mci_starfive_set_ios, + .parse_dt = dw_mci_starfive_parse_dt, + .execute_tuning = dw_mci_starfive_execute_tuning, +}; + +static const struct of_device_id dw_mci_starfive_match[] = { + { .compatible = "starfive,jh7110-mmc", + .data = &starfive_data }, + {}, +}; +MODULE_DEVICE_TABLE (of, dw_mci_starfive_match); + +static int dw_mci_starfive_probe (struct platform_device *pdev) +{ + return dw_mci_pltfm_register(pdev, &starfive_data); +} + +static struct platform_driver dw_mci_starfive_driver = { + .probe = dw_mci_starfive_probe, + .remove = dw_mci_pltfm_remove, + .driver = { + .name = "dwmmc_starfive", + .probe_type = PROBE_PREFER_ASYNCHRONOUS, + .of_match_table = dw_mci_starfive_match, + }, +}; +module_platform_driver (dw_mci_starfive_driver); + +MODULE_DESCRIPTION("StarFive JH7110 Specific DW-MSHC DriverExtension");
drivers/mmc/host/dw_mmc-starfive.c new file +2
-0+MODULE_LICENSE ("GPL" ); +MODULE_ALIAS ("platform:dwmmc_starfive" );
William Qiu
maintainerRe: [PATCH v4 2/4] mmc: starfive: Add sdio/emmc driver support
Quoted 8 lines · Shengyu Qu
Hello William,
Sorry for making noise about this, but seems deleted voltage swtich function
doesn't help about this. But there's still a problem about eMMC speed. Currently
only about 20MB/s maximum reading speed could be reached when using eMMC
Quoted 27 lines
on VF2, any idea about this?
Best regards,
Shengyu
Quoted 20 lines · Shengyu Qu
Hello William,
I'm digging into downstream mmc driver these days and found a problem
that current version mainline driver doesn't has a voltage switch function for
it. Downstream older version has one but was deleted in this commit [1].
It was deleted since vf2's SD slot doesn't have 1.8V input but commiter forgot
that vf2's eMMC slot has a proper 1.8V input.
So could you add voltage switch function for mainline? I've met a eMMC speed
problem possibly due to it.
Best regards,
Shengyu
Hi Shengyu,
Sorry for the late reply.
First of all, I will consider adding voltage switch function, but the implementation method is to configure the pmic register configuration in dts, and the implementation interface will use the voltage switch function in dw_mmc.c.
As for speed, the main reason for the low rate is the clock of JH7110 and the associated IO driving strength, in this limit, the maximum reading speed I tested was about 50Mb/s.
I will try to reproduce your problem and try to solve it. Thanks for suggestions.
Best regards,
William
Quoted 255 lines
Quoted 255 lines
[1] https://github.com/starfive-tech/linux/commit/8037d59091d276e74be38e5fafaaebe36eaa77e1
Quoted 252 lines · William Qiu
Add sdio/emmc driver support for StarFive JH7110 soc.
Tested-by Conor Dooley <[email protected]>Signed-off-by William Qiu <[email protected]>---
MAINTAINERS | 6 + drivers/mmc/host/Kconfig | 10 ++ drivers/mmc/host/Makefile | 1 +drivers/mmc/host/dw_mmc-starfive.c| 186 +++++++++++++++++++++++++++++4 files changed, 203 insertions(+)create mode 100644
drivers/mmc/host/dw_mmc-starfive.cMAINTAINERS +0
-0@@ -19640,6 +19640,12 @@ F: Documentation/devicetree/bindings/clock/starfive,jh71*.yamlF:
drivers/clk/starfive/clk-starfive-jh71*F: include/dt-bindings/clock/starfive?jh71*.h +STARFIVE JH7110 MMC/SD/SDIO DRIVERMAINTAINERS +5
-0+M: William Qiu <[email protected]> +S: Supported +F: Documentation/devicetree/bindings/mmc/starfive* +F: drivers/mmc/host/dw_mmc-starfive.c +STARFIVE JH71X0 PINCTRL DRIVERS
M: Emil Renner Berthing <[email protected]> M: Jianlong Huang <[email protected]>drivers/mmc/host/Kconfig +0
-0@@ -871,6 +871,16 @@ config MMC_DW_ROCKCHIPSynopsys DesignWare Memory Card Interface driver. Select this option for platforms based on RK3066, RK3188 and RK3288 SoC's. +config
MMC_DW_STARFIVE
+ tristate "StarFive specific extensions for Synopsys DW Memory Card Interface" + depends onSOC_STARFIVE
+ depends onMMC_DW
+ selectMMC_DW_PLTFM
+ help
+ This selects support for StarFive JH7110 SoC specific extensions to the + Synopsys DesignWare Memory Card Interface driver. Select this option + for platforms based on StarFive JH7110 SoC.
+
configMMC_SH_MMCIF
tristate "SuperH Internal MMCIF support"
depends on SUPERH ||ARCH_RENESAS||COMPILE_TESTdrivers/mmc/host/Makefile +0
-0@@ -56,6 +56,7 @@ obj-$(CONFIG_MMC_DW_HI3798CV200) += dw_mmc-hi3798cv200.oobj-$(CONFIG_MMC_DW_K3) += dw_mmc-k3.o obj-$(CONFIG_MMC_DW_PCI) += dw_mmc-pci.o obj-$(CONFIG_MMC_DW_ROCKCHIP) += dw_mmc-rockchip.o +obj-$(CONFIG_MMC_DW_STARFIVE) += dw_mmc-starfive.o obj-$(CONFIG_MMC_SH_MMCIF) += sh_mmcif.o obj-$(CONFIG_MMC_JZ4740) += jz4740_mmc.o obj-$(CONFIG_MMC_VUB300) += vub300.o
drivers/mmc/host/dw_mmc-starfive.c new file +186
-0@@ -0,0 +1,186 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* StarFive Designware Mobile Storage Host Controller Driver +* +* Copyright (c) 2022 StarFive Technology Co., Ltd. +*/ + +#include <linux/clk.h> +#include <linux/delay.h> +#include <linux/mfd/syscon.h> +#include <linux/mmc/host.h> +#include <linux/module.h> +#include <linux/of_address.h> +#include <linux/platform_device.h> +#include <linux/regmap.h> + +#include "dw_mmc.h" +#include "dw_mmc-pltfm.h" + +#define ALL_INT_CLR 0x1ffff +#define MAX_DELAY_CHAIN 32 + +struct starfive_priv { + struct device *dev; + struct regmap *reg_syscon; + u32 syscon_offset; + u32 syscon_shift; + u32 syscon_mask; +}; + +static void dw_mci_starfive_set_ios (struct dw_mci *host,struct mmc_ios *ios) +{ + int ret; + unsigned int clock; + + if (ios->timing == MMC_TIMING_MMC_DDR52 || ios->timing == MMC_TIMING_UHS_DDR50) { + clock = (ios->clock > 50000000 && ios->clock <= 52000000) ? 100000000 : ios->clock; + ret = clk_set_rate(host->ciu_clk, clock); + if (ret) + dev_dbg(host->dev, "Use an external frequency divider %uHz\n", ios->clock); + host->bus_hz = clk_get_rate(host->ciu_clk); + } else { + dev_dbg(host->dev, "Using the internal divider\n"); + } +} + +static int dw_mci_starfive_execute_tuning (struct dw_mci_slot *slot, + u32 opcode) +{ + static const int grade = MAX_DELAY_CHAIN; + struct dw_mci *host = slot->host; + struct starfive_priv *priv = host->priv; + int rise_point = -1, fall_point = -1; + int err, prev_err; + int i; + bool found = 0; + u32 regval; + + /* + * Use grade as the max delay chain, and use the rise_point and + * fall_point to ensure the best sampling point of a data input + * signals. + */ + for (i = 0; i < grade; i++) { + regval = i << priv->syscon_shift; + err = regmap_update_bits(priv->reg_syscon, priv->syscon_offset, + priv->syscon_mask, regval); + if (err) + return err; + mci_writel(host, RINTSTS, ALL_INT_CLR); + + err = mmc_send_tuning(slot->mmc, opcode, NULL); + if (!err) + found = 1; + + if (i > 0) { + if (err && !prev_err) + fall_point = i - 1; + if (!err && prev_err) + rise_point = i; + } + + if (rise_point != -1 && fall_point != -1) + goto tuning_out; + + prev_err = err; + err = 0; + } + +tuning_out: + if (found) { + if (rise_point == -1) + rise_point = 0; + if (fall_point == -1) + fall_point = grade - 1; + if (fall_point < rise_point) { + if ((rise_point + fall_point) > + (grade - 1)) + i = fall_point / 2; + else + i = (rise_point + grade - 1) / 2; + } else { + i = (rise_point + fall_point) / 2; + } + + regval = i << priv->syscon_shift; + err = regmap_update_bits(priv->reg_syscon, priv->syscon_offset, + priv->syscon_mask, regval); + if (err) + return err; + mci_writel(host, RINTSTS, ALL_INT_CLR); + + dev_info(host->dev, "Found valid delay chain! use it [delay=%d]\n", i); + } else { + dev_err(host->dev, "No valid delay chain! use default\n"); + err = -EINVAL; + } + + mci_writel(host, RINTSTS, ALL_INT_CLR); + return err; +} + +static int dw_mci_starfive_parse_dt (struct dw_mci *host) +{ + struct of_phandle_args args; + struct starfive_priv *priv; + int ret; + + priv = devm_kzalloc(host->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + ret = of_parse_phandle_with_fixed_args(host->dev->of_node, + "starfive,sysreg", 3, 0, &args); + if (ret) { + dev_err(host->dev, "Failed to parse starfive,sysreg\n"); + return -EINVAL; + } + + priv->reg_syscon = syscon_node_to_regmap(args.np); + of_node_put(args.np); + if (IS_ERR(priv->reg_syscon)) + return PTR_ERR(priv->reg_syscon); + + priv->syscon_offset = args.args[0]; + priv->syscon_shift = args.args[1]; + priv->syscon_mask = args.args[2]; + + host->priv = priv; + + return 0; +} + +static const struct dw_mci_drv_data starfive_data = { + .common_caps = MMC_CAP_CMD23, + .set_ios = dw_mci_starfive_set_ios, + .parse_dt = dw_mci_starfive_parse_dt, + .execute_tuning = dw_mci_starfive_execute_tuning, +}; + +static const struct of_device_id dw_mci_starfive_match[] = { + { .compatible = "starfive,jh7110-mmc", + .data = &starfive_data }, + {}, +}; +MODULE_DEVICE_TABLE (of, dw_mci_starfive_match); + +static int dw_mci_starfive_probe (struct platform_device *pdev) +{ + return dw_mci_pltfm_register(pdev, &starfive_data); +} + +static struct platform_driver dw_mci_starfive_driver = { + .probe = dw_mci_starfive_probe, + .remove = dw_mci_pltfm_remove, + .driver = { + .name = "dwmmc_starfive", + .probe_type = PROBE_PREFER_ASYNCHRONOUS, + .of_match_table = dw_mci_starfive_match, + }, +}; +module_platform_driver (dw_mci_starfive_driver); + +MODULE_DESCRIPTION ("StarFive JH7110 Specific DW-MSHC Driver Extension" ); +MODULE_LICENSE ("GPL" ); +MODULE_ALIAS ("platform:dwmmc_starfive" );
Re: [PATCH v4 2/4] mmc: starfive: Add sdio/emmc driver support
Hello William,
Quoted 45 lines · Shengyu Qu
Quoted 8 lines
Hello William,
Sorry for making noise about this, but seems deleted voltage swtich function
doesn't help about this. But there's still a problem about eMMC speed. Currently
only about 20MB/s maximum reading speed could be reached when using eMMC
Quoted 27 lines
on VF2, any idea about this?
Best regards,
Shengyu
Quoted 20 lines · Shengyu Qu
Hello William,
I'm digging into downstream mmc driver these days and found a problem
that current version mainline driver doesn't has a voltage switch function for
it. Downstream older version has one but was deleted in this commit [1].
It was deleted since vf2's SD slot doesn't have 1.8V input but commiter forgot
that vf2's eMMC slot has a proper 1.8V input.
So could you add voltage switch function for mainline? I've met a eMMC speed
problem possibly due to it.
Best regards,
Shengyu
Hi Shengyu,
Sorry for the late reply.
First of all, I will consider adding voltage switch function, but the implementation method is to configure the pmic register configuration in dts, and the implementation interface will use the voltage switch function in
dw_mmc.c.
Quoted 8 lines
As for speed, the main reason for the low rate is the clock of JH7110 and the associated IO driving strength, in this limit, the maximum reading speed I tested was about 50Mb/s.
I will try to reproduce your problem and try to solve it. Thanks for suggestions.
Best regards,
William
I found out the reason and fixed that. dmwci driver needs vqmmc supply configured in device tree and a successful voltage change to actually enable 1.8v mode, even 1.8 supply actually already physically exists. So to solve this problem, I wrote AXP15060 driver and device tree bindings basing on -upstream branch and gets over 75MB/s read speed. The driver series is already under review here:
Best regards,
Shengyu
William Qiu
maintainerRe: [PATCH v4 2/4] mmc: starfive: Add sdio/emmc driver support
Quoted 62 lines · Shengyu Qu
Hello William,
Quoted 45 lines · Shengyu Qu
Quoted 8 lines
Hello William,
Sorry for making noise about this, but seems deleted voltage swtich function
doesn't help about this. But there's still a problem about eMMC speed. Currently
only about 20MB/s maximum reading speed could be reached when using eMMC
Quoted 27 lines
on VF2, any idea about this?
Best regards,
Shengyu
Quoted 20 lines · Shengyu Qu
Hello William,
I'm digging into downstream mmc driver these days and found a problem
that current version mainline driver doesn't has a voltage switch function for
it. Downstream older version has one but was deleted in this commit [1].
It was deleted since vf2's SD slot doesn't have 1.8V input but commiter forgot
that vf2's eMMC slot has a proper 1.8V input.
So could you add voltage switch function for mainline? I've met a eMMC speed
problem possibly due to it.
Best regards,
Shengyu
Hi Shengyu,
Sorry for the late reply.
First of all, I will consider adding voltage switch function, but the implementation method is to configure the pmic register configuration in dts, and the implementation interface will use the voltage switch function in
dw_mmc.c.Quoted 8 lines
As for speed, the main reason for the low rate is the clock of JH7110 and the associated IO driving strength, in this limit, the maximum reading speed I tested was about 50Mb/s.
I will try to reproduce your problem and try to solve it. Thanks for suggestions.
Best regards,
WilliamI found out the reason and fixed that. dmwci driver needs vqmmc supply configured in device tree and a successful voltage change to actually enable 1.8v mode, even 1.8 supply actually already physically exists. So to solve this problem, I wrote AXP15060 driver and device tree bindings basing on -upstream branch and gets over 75MB/s read speed. The driver series is already under review here:
Quoted 4 lines
Best regards,
Shengyu
Hi Shengyu,
Thanks for the patch series. I will try it on my branch.
Best regards,
William
William Qiu
maintainerPATCH v4 3/4 riscv: dts: starfive: Add mmc node
In reply to William QiuAdd the mmc node for the StarFive JH7110 SoC.
Set mmco node to emmc and set mmc1 node to sd.
--- .../jh7110-starfive-visionfive-2.dtsi | 23 +++++++++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 47 +++++++++++++++++++ 2 files changed, 70 insertions(+)
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +23 -0
@@ -42,6 +42,29 @@ &rtc_osc { clock-frequency = <32768>; }; +&mmc0 { + max-frequency = <100000000>; + bus-width = <8>; + cap-mmc-highspeed; + mmc-ddr-1_8v; + mmc-hs200-1_8v; + non-removable; + cap-mmc-hw-reset; + post-power-on-delay-ms = <200>; + status = "okay"; +}; + +&mmc1 { + max-frequency = <100000000>; + bus-width = <4>; + no-sdio; + no-mmc; + broken-cd; + cap-sd-highspeed; + post-power-on-delay-ms = <200>; + status = "okay"; +}; + &gmac0_rmii_refin { clock-frequency = <50000000>; };
arch/riscv/boot/dts/starfive/jh7110.dtsi +47 -0
70 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH v4 3/4] riscv: dts: starfive: Add mmc node
Quoted 110 lines · William Qiu
Add the mmc node for the StarFive JH7110 SoC.
Set mmco node to emmc and set mmc1 node to sd.Signed-off-by William Qiu <[email protected]>--- .../jh7110-starfive-visionfive-2.dtsi | 23 +++++++++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 47 +++++++++++++++++++ 2 files changed, 70 insertions(+)arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +23
-0@@ -42,6 +42,29 @@ &rtc_osc { clock-frequency = <32768>; }; +&mmc0 { + max-frequency = <100000000>; + bus-width = <8>; + cap-mmc-highspeed; + mmc-ddr-1_8v; + mmc-hs200-1_8v; + non-removable; + cap-mmc-hw-reset; + post-power-on-delay-ms = <200>; + status = "okay"; +}; + +&mmc1 { + max-frequency = <100000000>; + bus-width = <4>; + no-sdio; + no-mmc; + broken-cd; + cap-sd-highspeed; + post-power-on-delay-ms = <200>; + status = "okay"; +}; + &gmac0_rmii_refin { clock-frequency = <50000000>; };arch/riscv/boot/dts/starfive/jh7110.dtsi +37
-0@@ -314,6 +314,11 @@ uart2: serial@10020000 { status = "disabled"; }; + stg_syscon: syscon@10240000 { + compatible = "starfive,jh7110-stg-syscon", "syscon"; + reg = <0x0 0x10240000 0x0 0x1000>; + }; + uart3: serial@12000000 { compatible = "snps,dw-apb-uart"; reg = <0x0 0x12000000 0x0 0x10000>;@@ -370,6 +375,11 @@ syscrg: clock-controller@13020000 { #reset-cells = <1>; }; + sys_syscon: syscon@13030000 { + compatible = "starfive,jh7110-sys-syscon", "syscon"; + reg = <0x0 0x13030000 0x0 0x1000>; + }; + gpio: gpio@13040000 { compatible = "starfive,jh7110-sys-pinctrl"; reg = <0x0 0x13040000 0x0 0x10000>;@@ -397,6 +407,11 @@ aoncrg: clock-controller@17000000 { #reset-cells = <1>; }; + aon_syscon: syscon@17010000 { + compatible = "starfive,jh7110-aon-syscon", "syscon"; + reg = <0x0 0x17010000 0x0 0x1000>; + }; + gpioa: gpio@17020000 { compatible = "starfive,jh7110-aon-pinctrl"; reg = <0x0 0x17020000 0x0 0x10000>;@@ -407,5 +422,37 @@ gpioa: gpio@17020000 { gpio-controller; #gpio-cells = <2>; }; + + mmc0: mmc@16010000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x0 0x16010000 0x0 0x10000>; + clocks = <&syscrg JH7110_SYSCLK_SDIO0_AHB>, + <&syscrg JH7110_SYSCLK_SDIO0_SDCARD>; + clock-names = "biu","ciu"; + resets = <&syscrg JH7110_SYSRST_SDIO0_AHB>; + reset-names = "reset"; + interrupts = <74>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x14 0x1a 0x7c000000>; + status = "disabled"; + }; + + mmc1: mmc@16020000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x0 0x16020000 0x0 0x10000>; + clocks = <&syscrg JH7110_SYSCLK_SDIO1_AHB>, + <&syscrg JH7110_SYSCLK_SDIO1_SDCARD>;
arch/riscv/boot/dts/starfive/jh7110.dtsi gpioa: gpio@17020000 { · line 456
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +10
-0+ clock-names = "biu","ciu"; + resets = <&syscrg JH7110_SYSRST_SDIO1_AHB>; + reset-names = "reset"; + interrupts = <75>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x9c 0x1 0x3e>; + status = "disabled"; + };
Hi William,
These nodes still don't seem to be sorted by address, eg. by the number after the @
Also please move the dt-binding patch before this one, so dtb_check won't fail no matter where git bisect happens to land.
/Emil
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-1}; }; --2.34.1
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Re: [PATCH v4 3/4] riscv: dts: starfive: Add mmc node
Quoted 34 lines · Emil Renner Berthing
Quoted 32 lines · William Qiu
Add the mmc node for the StarFive JH7110 SoC.
Set mmco node to emmc and set mmc1 node to sd.Signed-off-by William Qiu <[email protected]>--- .../jh7110-starfive-visionfive-2.dtsi | 23 +++++++++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 47 +++++++++++++++++++ 2 files changed, 70 insertions(+)arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +14
-0@@ -42,6 +42,29 @@ &rtc_osc { clock-frequency = <32768>; }; +&mmc0 { + max-frequency = <100000000>; + bus-width = <8>; + cap-mmc-highspeed; + mmc-ddr-1_8v; + mmc-hs200-1_8v; + non-removable; + cap-mmc-hw-reset; + post-power-on-delay-ms = <200>; + status = "okay"; +}; + +&mmc1 { + max-frequency = <100000000>;
Quoted 8 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi &rtc_osc { · line 66
Quoted 8 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +8
-0+ bus-width = <4>; + no-sdio; + no-mmc; + broken-cd; + cap-sd-highspeed; + post-power-on-delay-ms = <200>; + status = "okay"; +};
These nodes are also still oddly placed in the middle of the external clocks. Again please keep the external clocks at the top and then order the nodes alphabetically to have some sort of system.
Quoted 99 lines
Quoted 69 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +0
-0&gmac0_rmii_refin { clock-frequency = <50000000>; };arch/riscv/boot/dts/starfive/jh7110.dtsi +37
-0@@ -314,6 +314,11 @@ uart2: serial@10020000 { status = "disabled"; }; + stg_syscon: syscon@10240000 { + compatible = "starfive,jh7110-stg-syscon", "syscon"; + reg = <0x0 0x10240000 0x0 0x1000>; + }; + uart3: serial@12000000 { compatible = "snps,dw-apb-uart"; reg = <0x0 0x12000000 0x0 0x10000>;@@ -370,6 +375,11 @@ syscrg: clock-controller@13020000 { #reset-cells = <1>; }; + sys_syscon: syscon@13030000 { + compatible = "starfive,jh7110-sys-syscon", "syscon"; + reg = <0x0 0x13030000 0x0 0x1000>; + }; + gpio: gpio@13040000 { compatible = "starfive,jh7110-sys-pinctrl"; reg = <0x0 0x13040000 0x0 0x10000>;@@ -397,6 +407,11 @@ aoncrg: clock-controller@17000000 { #reset-cells = <1>; }; + aon_syscon: syscon@17010000 { + compatible = "starfive,jh7110-aon-syscon", "syscon"; + reg = <0x0 0x17010000 0x0 0x1000>; + }; + gpioa: gpio@17020000 { compatible = "starfive,jh7110-aon-pinctrl"; reg = <0x0 0x17020000 0x0 0x10000>;@@ -407,5 +422,37 @@ gpioa: gpio@17020000 { gpio-controller; #gpio-cells = <2>; }; + + mmc0: mmc@16010000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x0 0x16010000 0x0 0x10000>; + clocks = <&syscrg JH7110_SYSCLK_SDIO0_AHB>, + <&syscrg JH7110_SYSCLK_SDIO0_SDCARD>; + clock-names = "biu","ciu"; + resets = <&syscrg JH7110_SYSRST_SDIO0_AHB>; + reset-names = "reset"; + interrupts = <74>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x14 0x1a 0x7c000000>; + status = "disabled"; + }; + + mmc1: mmc@16020000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x0 0x16020000 0x0 0x10000>; + clocks = <&syscrg JH7110_SYSCLK_SDIO1_AHB>, + <&syscrg JH7110_SYSCLK_SDIO1_SDCARD>;arch/riscv/boot/dts/starfive/jh7110.dtsi gpioa: gpio@17020000 { · line 456
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +10
-0+ clock-names = "biu","ciu"; + resets = <&syscrg JH7110_SYSRST_SDIO1_AHB>; + reset-names = "reset"; + interrupts = <75>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x9c 0x1 0x3e>; + status = "disabled"; + };Hi William,
These nodes still don't seem to be sorted by address, eg. by the number after the @
Also please move the dt-binding patch before this one, sodtb_checkwon't fail no matter where git bisect happens to land./Emil
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-1}; }; --2.34.1
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
William Qiu
maintainerRe: [PATCH v4 3/4] riscv: dts: starfive: Add mmc node
Quoted 40 lines · Emil Renner Berthing
Quoted 38 lines · Emil Renner Berthing
Quoted 36 lines · William Qiu
Add the mmc node for the StarFive JH7110 SoC.
Set mmco node to emmc and set mmc1 node to sd.Signed-off-by William Qiu <[email protected]>--- .../jh7110-starfive-visionfive-2.dtsi | 23 +++++++++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 47 +++++++++++++++++++ 2 files changed, 70 insertions(+)arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +18
-0@@ -42,6 +42,29 @@ &rtc_osc { clock-frequency = <32768>; }; +&mmc0 { + max-frequency = <100000000>; + bus-width = <8>; + cap-mmc-highspeed; + mmc-ddr-1_8v; + mmc-hs200-1_8v; + non-removable; + cap-mmc-hw-reset; + post-power-on-delay-ms = <200>; + status = "okay"; +}; + +&mmc1 { + max-frequency = <100000000>; + bus-width = <4>; + no-sdio; + no-mmc; + broken-cd;
Quoted 9 lines
Quoted 4 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi &rtc_osc { · line 66
Quoted 4 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +4
-0+ cap-sd-highspeed; + post-power-on-delay-ms = <200>; + status = "okay"; +};These nodes are also still oddly placed in the middle of the external clocks. Again please keep the external clocks at the top and then order the nodes alphabetically to have some sort of system.
Hi Emil,
I'll update it in next version.
Best Regards
William
Quoted 99 lines
Quoted 99 lines
Quoted 69 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +0
-0&gmac0_rmii_refin { clock-frequency = <50000000>; };arch/riscv/boot/dts/starfive/jh7110.dtsi +37
-0@@ -314,6 +314,11 @@ uart2: serial@10020000 { status = "disabled"; }; + stg_syscon: syscon@10240000 { + compatible = "starfive,jh7110-stg-syscon", "syscon"; + reg = <0x0 0x10240000 0x0 0x1000>; + }; + uart3: serial@12000000 { compatible = "snps,dw-apb-uart"; reg = <0x0 0x12000000 0x0 0x10000>;@@ -370,6 +375,11 @@ syscrg: clock-controller@13020000 { #reset-cells = <1>; }; + sys_syscon: syscon@13030000 { + compatible = "starfive,jh7110-sys-syscon", "syscon"; + reg = <0x0 0x13030000 0x0 0x1000>; + }; + gpio: gpio@13040000 { compatible = "starfive,jh7110-sys-pinctrl"; reg = <0x0 0x13040000 0x0 0x10000>;@@ -397,6 +407,11 @@ aoncrg: clock-controller@17000000 { #reset-cells = <1>; }; + aon_syscon: syscon@17010000 { + compatible = "starfive,jh7110-aon-syscon", "syscon"; + reg = <0x0 0x17010000 0x0 0x1000>; + }; + gpioa: gpio@17020000 { compatible = "starfive,jh7110-aon-pinctrl"; reg = <0x0 0x17020000 0x0 0x10000>;@@ -407,5 +422,37 @@ gpioa: gpio@17020000 { gpio-controller; #gpio-cells = <2>; }; + + mmc0: mmc@16010000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x0 0x16010000 0x0 0x10000>; + clocks = <&syscrg JH7110_SYSCLK_SDIO0_AHB>, + <&syscrg JH7110_SYSCLK_SDIO0_SDCARD>; + clock-names = "biu","ciu"; + resets = <&syscrg JH7110_SYSRST_SDIO0_AHB>; + reset-names = "reset"; + interrupts = <74>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x14 0x1a 0x7c000000>; + status = "disabled"; + }; + + mmc1: mmc@16020000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x0 0x16020000 0x0 0x10000>; + clocks = <&syscrg JH7110_SYSCLK_SDIO1_AHB>, + <&syscrg JH7110_SYSCLK_SDIO1_SDCARD>;arch/riscv/boot/dts/starfive/jh7110.dtsi gpioa: gpio@17020000 { · line 456
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +10
-0+ clock-names = "biu","ciu"; + resets = <&syscrg JH7110_SYSRST_SDIO1_AHB>; + reset-names = "reset"; + interrupts = <75>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x9c 0x1 0x3e>; + status = "disabled"; + };Hi William,
These nodes still don't seem to be sorted by address, eg. by the number after the @
Also please move the dt-binding patch before this one, sodtb_checkwon't fail no matter where git bisect happens to land./Emil
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-1}; }; --2.34.1
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Re: [PATCH v4 3/4] riscv: dts: starfive: Add mmc node
Quoted 52 lines · William Qiu
Quoted 40 lines · Emil Renner Berthing
Quoted 38 lines · Emil Renner Berthing
Quoted 36 lines · William Qiu
Add the mmc node for the StarFive JH7110 SoC.
Set mmco node to emmc and set mmc1 node to sd.Signed-off-by William Qiu <[email protected]>--- .../jh7110-starfive-visionfive-2.dtsi | 23 +++++++++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 47 +++++++++++++++++++ 2 files changed, 70 insertions(+)arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +18
-0@@ -42,6 +42,29 @@ &rtc_osc { clock-frequency = <32768>; }; +&mmc0 { + max-frequency = <100000000>; + bus-width = <8>; + cap-mmc-highspeed; + mmc-ddr-1_8v; + mmc-hs200-1_8v; + non-removable; + cap-mmc-hw-reset; + post-power-on-delay-ms = <200>; + status = "okay"; +}; + +&mmc1 { + max-frequency = <100000000>; + bus-width = <4>; + no-sdio; + no-mmc; + broken-cd;Quoted 9 lines
Quoted 4 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi &rtc_osc { · line 66
Quoted 4 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +4
-0+ cap-sd-highspeed; + post-power-on-delay-ms = <200>; + status = "okay"; +};These nodes are also still oddly placed in the middle of the external clocks. Again please keep the external clocks at the top and then order the nodes alphabetically to have some sort of system.
Quoted 3 lines
Hi Emil,
I'll update it in next version.
Hi William,
It seems the mmc nodes are still missing from the upstream device tree. The sysreg nodes have been added in Conors riscv-dt-for-next[1] branch, so I don't see any missing dependencies. Could you please update and send a new version of this?
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/log/?h=riscv-dt-for-next
/Emil
Quoted 102 lines
Best Regards
WilliamQuoted 99 lines
Quoted 99 lines
Quoted 69 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +0
-0&gmac0_rmii_refin { clock-frequency = <50000000>; };arch/riscv/boot/dts/starfive/jh7110.dtsi +37
-0@@ -314,6 +314,11 @@ uart2: serial@10020000 { status = "disabled"; }; + stg_syscon: syscon@10240000 { + compatible = "starfive,jh7110-stg-syscon", "syscon"; + reg = <0x0 0x10240000 0x0 0x1000>; + }; + uart3: serial@12000000 { compatible = "snps,dw-apb-uart"; reg = <0x0 0x12000000 0x0 0x10000>;@@ -370,6 +375,11 @@ syscrg: clock-controller@13020000 { #reset-cells = <1>; }; + sys_syscon: syscon@13030000 { + compatible = "starfive,jh7110-sys-syscon", "syscon"; + reg = <0x0 0x13030000 0x0 0x1000>; + }; + gpio: gpio@13040000 { compatible = "starfive,jh7110-sys-pinctrl"; reg = <0x0 0x13040000 0x0 0x10000>;@@ -397,6 +407,11 @@ aoncrg: clock-controller@17000000 { #reset-cells = <1>; }; + aon_syscon: syscon@17010000 { + compatible = "starfive,jh7110-aon-syscon", "syscon"; + reg = <0x0 0x17010000 0x0 0x1000>; + }; + gpioa: gpio@17020000 { compatible = "starfive,jh7110-aon-pinctrl"; reg = <0x0 0x17020000 0x0 0x10000>;@@ -407,5 +422,37 @@ gpioa: gpio@17020000 { gpio-controller; #gpio-cells = <2>; }; + + mmc0: mmc@16010000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x0 0x16010000 0x0 0x10000>; + clocks = <&syscrg JH7110_SYSCLK_SDIO0_AHB>, + <&syscrg JH7110_SYSCLK_SDIO0_SDCARD>; + clock-names = "biu","ciu"; + resets = <&syscrg JH7110_SYSRST_SDIO0_AHB>; + reset-names = "reset"; + interrupts = <74>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x14 0x1a 0x7c000000>; + status = "disabled"; + }; + + mmc1: mmc@16020000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x0 0x16020000 0x0 0x10000>; + clocks = <&syscrg JH7110_SYSCLK_SDIO1_AHB>, + <&syscrg JH7110_SYSCLK_SDIO1_SDCARD>;arch/riscv/boot/dts/starfive/jh7110.dtsi gpioa: gpio@17020000 { · line 456
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +10
-0+ clock-names = "biu","ciu"; + resets = <&syscrg JH7110_SYSRST_SDIO1_AHB>; + reset-names = "reset"; + interrupts = <75>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x9c 0x1 0x3e>; + status = "disabled"; + };Hi William,
These nodes still don't seem to be sorted by address, eg. by the number after the @
Also please move the dt-binding patch before this one, sodtb_checkwon't fail no matter where git bisect happens to land./Emil
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-1}; }; --2.34.1
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
William Qiu
maintainerRe: [PATCH v4 3/4] riscv: dts: starfive: Add mmc node
Quoted 59 lines · Emil Renner Berthing
Quoted 52 lines · William Qiu
Quoted 40 lines · Emil Renner Berthing
Quoted 38 lines · Emil Renner Berthing
Quoted 36 lines · William Qiu
Add the mmc node for the StarFive JH7110 SoC.
Set mmco node to emmc and set mmc1 node to sd.Signed-off-by William Qiu <[email protected]>--- .../jh7110-starfive-visionfive-2.dtsi | 23 +++++++++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 47 +++++++++++++++++++ 2 files changed, 70 insertions(+)arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +18
-0@@ -42,6 +42,29 @@ &rtc_osc { clock-frequency = <32768>; }; +&mmc0 { + max-frequency = <100000000>; + bus-width = <8>; + cap-mmc-highspeed; + mmc-ddr-1_8v; + mmc-hs200-1_8v; + non-removable; + cap-mmc-hw-reset; + post-power-on-delay-ms = <200>; + status = "okay"; +}; + +&mmc1 { + max-frequency = <100000000>; + bus-width = <4>; + no-sdio; + no-mmc; + broken-cd;Quoted 9 lines
Quoted 4 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi &rtc_osc { · line 66
Quoted 4 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +4
-0+ cap-sd-highspeed; + post-power-on-delay-ms = <200>; + status = "okay"; +};These nodes are also still oddly placed in the middle of the external clocks. Again please keep the external clocks at the top and then order the nodes alphabetically to have some sort of system.
Quoted 3 lines
Hi Emil,
I'll update it in next version.
Hi William,
Quoted 9 lines
It seems the mmc nodes are still missing from the upstream device tree. The sysreg nodes have been added in Conors riscv-dt-for-next[1] branch, so I don't see any missing dependencies. Could you please update and send a new version of this?
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/log/?h=riscv-dt-for-next
/Emil
Hi Emil,
I will start to do the upstream work of this part from this week. Since the mmc driver has some modifications, I will send a separate patch series.
Best Regards,
William
Quoted 102 lines
Quoted 102 lines
Best Regards
WilliamQuoted 99 lines
Quoted 99 lines
Quoted 69 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +0
-0&gmac0_rmii_refin { clock-frequency = <50000000>; };arch/riscv/boot/dts/starfive/jh7110.dtsi +37
-0@@ -314,6 +314,11 @@ uart2: serial@10020000 { status = "disabled"; }; + stg_syscon: syscon@10240000 { + compatible = "starfive,jh7110-stg-syscon", "syscon"; + reg = <0x0 0x10240000 0x0 0x1000>; + }; + uart3: serial@12000000 { compatible = "snps,dw-apb-uart"; reg = <0x0 0x12000000 0x0 0x10000>;@@ -370,6 +375,11 @@ syscrg: clock-controller@13020000 { #reset-cells = <1>; }; + sys_syscon: syscon@13030000 { + compatible = "starfive,jh7110-sys-syscon", "syscon"; + reg = <0x0 0x13030000 0x0 0x1000>; + }; + gpio: gpio@13040000 { compatible = "starfive,jh7110-sys-pinctrl"; reg = <0x0 0x13040000 0x0 0x10000>;@@ -397,6 +407,11 @@ aoncrg: clock-controller@17000000 { #reset-cells = <1>; }; + aon_syscon: syscon@17010000 { + compatible = "starfive,jh7110-aon-syscon", "syscon"; + reg = <0x0 0x17010000 0x0 0x1000>; + }; + gpioa: gpio@17020000 { compatible = "starfive,jh7110-aon-pinctrl"; reg = <0x0 0x17020000 0x0 0x10000>;@@ -407,5 +422,37 @@ gpioa: gpio@17020000 { gpio-controller; #gpio-cells = <2>; }; + + mmc0: mmc@16010000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x0 0x16010000 0x0 0x10000>; + clocks = <&syscrg JH7110_SYSCLK_SDIO0_AHB>, + <&syscrg JH7110_SYSCLK_SDIO0_SDCARD>; + clock-names = "biu","ciu"; + resets = <&syscrg JH7110_SYSRST_SDIO0_AHB>; + reset-names = "reset"; + interrupts = <74>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x14 0x1a 0x7c000000>; + status = "disabled"; + }; + + mmc1: mmc@16020000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x0 0x16020000 0x0 0x10000>; + clocks = <&syscrg JH7110_SYSCLK_SDIO1_AHB>, + <&syscrg JH7110_SYSCLK_SDIO1_SDCARD>;arch/riscv/boot/dts/starfive/jh7110.dtsi gpioa: gpio@17020000 { · line 456
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +10
-0+ clock-names = "biu","ciu"; + resets = <&syscrg JH7110_SYSRST_SDIO1_AHB>; + reset-names = "reset"; + interrupts = <75>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x9c 0x1 0x3e>; + status = "disabled"; + };Hi William,
These nodes still don't seem to be sorted by address, eg. by the number after the @
Also please move the dt-binding patch before this one, sodtb_checkwon't fail no matter where git bisect happens to land./Emil
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-1}; }; --2.34.1
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
William Qiu
maintainerRe: [PATCH v4 3/4] riscv: dts: starfive: Add mmc node
In reply to Emil Renner BerthingQuoted 124 lines · Emil Renner Berthing
Quoted 110 lines · William Qiu
Add the mmc node for the StarFive JH7110 SoC.
Set mmco node to emmc and set mmc1 node to sd.Signed-off-by William Qiu <[email protected]>--- .../jh7110-starfive-visionfive-2.dtsi | 23 +++++++++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 47 +++++++++++++++++++ 2 files changed, 70 insertions(+)arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +23
-0@@ -42,6 +42,29 @@ &rtc_osc { clock-frequency = <32768>; }; +&mmc0 { + max-frequency = <100000000>; + bus-width = <8>; + cap-mmc-highspeed; + mmc-ddr-1_8v; + mmc-hs200-1_8v; + non-removable; + cap-mmc-hw-reset; + post-power-on-delay-ms = <200>; + status = "okay"; +}; + +&mmc1 { + max-frequency = <100000000>; + bus-width = <4>; + no-sdio; + no-mmc; + broken-cd; + cap-sd-highspeed; + post-power-on-delay-ms = <200>; + status = "okay"; +}; + &gmac0_rmii_refin { clock-frequency = <50000000>; };arch/riscv/boot/dts/starfive/jh7110.dtsi +37
-0@@ -314,6 +314,11 @@ uart2: serial@10020000 { status = "disabled"; }; + stg_syscon: syscon@10240000 { + compatible = "starfive,jh7110-stg-syscon", "syscon"; + reg = <0x0 0x10240000 0x0 0x1000>; + }; + uart3: serial@12000000 { compatible = "snps,dw-apb-uart"; reg = <0x0 0x12000000 0x0 0x10000>;@@ -370,6 +375,11 @@ syscrg: clock-controller@13020000 { #reset-cells = <1>; }; + sys_syscon: syscon@13030000 { + compatible = "starfive,jh7110-sys-syscon", "syscon"; + reg = <0x0 0x13030000 0x0 0x1000>; + }; + gpio: gpio@13040000 { compatible = "starfive,jh7110-sys-pinctrl"; reg = <0x0 0x13040000 0x0 0x10000>;@@ -397,6 +407,11 @@ aoncrg: clock-controller@17000000 { #reset-cells = <1>; }; + aon_syscon: syscon@17010000 { + compatible = "starfive,jh7110-aon-syscon", "syscon"; + reg = <0x0 0x17010000 0x0 0x1000>; + }; + gpioa: gpio@17020000 { compatible = "starfive,jh7110-aon-pinctrl"; reg = <0x0 0x17020000 0x0 0x10000>;@@ -407,5 +422,37 @@ gpioa: gpio@17020000 { gpio-controller; #gpio-cells = <2>; }; + + mmc0: mmc@16010000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x0 0x16010000 0x0 0x10000>; + clocks = <&syscrg JH7110_SYSCLK_SDIO0_AHB>, + <&syscrg JH7110_SYSCLK_SDIO0_SDCARD>; + clock-names = "biu","ciu"; + resets = <&syscrg JH7110_SYSRST_SDIO0_AHB>; + reset-names = "reset"; + interrupts = <74>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x14 0x1a 0x7c000000>; + status = "disabled"; + }; + + mmc1: mmc@16020000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x0 0x16020000 0x0 0x10000>; + clocks = <&syscrg JH7110_SYSCLK_SDIO1_AHB>, + <&syscrg JH7110_SYSCLK_SDIO1_SDCARD>;arch/riscv/boot/dts/starfive/jh7110.dtsi gpioa: gpio@17020000 { · line 456
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +10
-0+ clock-names = "biu","ciu"; + resets = <&syscrg JH7110_SYSRST_SDIO1_AHB>; + reset-names = "reset"; + interrupts = <75>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,sysreg = <&sys_syscon 0x9c 0x1 0x3e>; + status = "disabled"; + };Hi William,
Quoted 7 lines
These nodes still don't seem to be sorted by address, eg. by the number after the @
Also please move the dt-binding patch before this one, sodtb_checkwon't fail no matter where git bisect happens to land./Emil
Hi Emil,
I'll update it in next version.
Best Regards
William
Quoted 10 lines
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-1}; }; --2.34.1
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
William Qiu
maintainerPATCH v4 4/4 dt-bindings: syscon: Add StarFive syscon doc
In reply to William QiuAdd documentation to describe StarFive System Controller Registers.
--- .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 56 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +51 -0
@@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/starfive/jh7110-syscon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 SoC system controller + +maintainers: + - William Qiu <[email protected]> + +description: | + The StarFive JH7110 SoC system controller provides register information such + as offset, mask and shift to configure related modules such as MMC and PCIe. + +properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-syscon + - const: syscon + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + syscon@10240000 { + compatible = "starfive,jh7110-stg-syscon", "syscon"; + reg = <0x10240000 0x1000>; + }; + + syscon@13030000 { + compatible = "starfive,jh7110-sys-syscon", "syscon"; + reg = <0x13030000 0x1000>; + }; + + syscon@17010000 { + compatible = "starfive,jh7110-aon-syscon", "syscon"; + reg = <0x17010000 0x1000>; + }; + +...
MAINTAINERS +5 -0
@@ -19665,6 +19665,11 @@ F: Documentation/devicetree/bindings/reset/starfive,jh7100-reset.yaml F: drivers/reset/starfive/reset-starfive-jh71* F: include/dt-bindings/reset/starfive?jh71*.h +STARFIVE JH7110 SYSCON +M: William Qiu <[email protected]> +S: Supported +F: Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml + STATIC BRANCH/CALL M: Peter Zijlstra <[email protected]> M: Josh Poimboeuf <[email protected]>
Signature · 1 line
2.34.1
Re: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
Quoted 4 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>---
Thank you for your patch. There is something to discuss/improve.
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 7 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +7
-0+properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-syscon
Maybe keep them ordered alphabetically?
Quoted 7 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +7
-0+ - const: syscon + + reg: + maxItems: 1 + +required: + - compatible
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 39
Quoted 10 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +10
-0+ - reg + +additionalProperties: false + +examples: + - | + syscon@10240000 { + compatible = "starfive,jh7110-stg-syscon", "syscon"; + reg = <0x10240000 0x1000>; + };
Keep only one example. All others are the same.
Best regards,
Krzysztof
Conor Dooley
Reviewed-byRe: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
Quoted 29 lines · Krzysztof Kozlowski
Quoted 4 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>---
Thank you for your patch. There is something to discuss/improve.
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 7 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +7
-0+properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-sysconMaybe keep them ordered alphabetically?
Quoted 11 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +11
-0+ - const: syscon + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false +
Quoted 8 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 39
Quoted 6 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +6
-0+examples: + - | + syscon@10240000 { + compatible = "starfive,jh7110-stg-syscon", "syscon"; + reg = <0x10240000 0x1000>; + };Keep only one example. All others are the same.
With these fixed:
@Krzysztof, I assume the location of the binding is okay with you since you didn't object to it & I suppose this one is up to me to apply if so.
Cheers,
Conor.
Re: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
Quoted 39 lines · Conor Dooley
Quoted 29 lines · Krzysztof Kozlowski
Quoted 4 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>---
Thank you for your patch. There is something to discuss/improve.
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 7 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +7
-0+properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-sysconMaybe keep them ordered alphabetically?
Quoted 11 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +11
-0+ - const: syscon + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false +Quoted 8 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 39
Quoted 6 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +6
-0+examples: + - | + syscon@10240000 { + compatible = "starfive,jh7110-stg-syscon", "syscon"; + reg = <0x10240000 0x1000>; + };Keep only one example. All others are the same.
Quoted 5 lines
With these fixed:
Reviewed-by Conor Dooley <[email protected]>@Krzysztof, I assume the location of the binding is okay with you since you didn't object to it & I suppose this one is up to me to apply if so.
Yeah, generic sysreg devices go to soc. If their primary functions were different (e.g. clock controller which also is syscon), then they should go to respective directories, but it's not the case here, I think.
Best regards,
Krzysztof
Re: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
Hey William,
Quoted 9 lines · Krzysztof Kozlowski
Quoted 8 lines · Conor Dooley
Quoted 7 lines · Krzysztof Kozlowski
Quoted 4 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>---
Thank you for your patch. There is something to discuss/improve.
Could you please submit a v5 of this, with the bits below fixed, whenever Hal sends their next version of the base dts series? There's no maintainers coverage for a soc/starfive subdirectory of dt-bindings yet, so please CC [email protected] & [email protected] on the patch.
Thanks,
Conor.
Quoted 37 lines
Quoted 31 lines
Quoted 22 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 8 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +7
-0+properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-sysconMaybe keep them ordered alphabetically?
Quoted 11 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +11
-0+ - const: syscon + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false +Quoted 8 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 39
Quoted 6 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +6
-0+examples: + - | + syscon@10240000 { + compatible = "starfive,jh7110-stg-syscon", "syscon"; + reg = <0x10240000 0x1000>; + };Keep only one example. All others are the same.
Quoted 5 lines
With these fixed:
Reviewed-by Conor Dooley <[email protected]>@Krzysztof, I assume the location of the binding is okay with you since you didn't object to it & I suppose this one is up to me to apply if so.
Quoted 8 lines
Yeah, generic sysreg devices go to soc. If their primary functions were different (e.g. clock controller which also is syscon), then they should go to respective directories, but it's not the case here, I think.
Best regards,
Krzysztof
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
William Qiu
maintainerRe: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
Quoted 13 lines · Conor Dooley
Hey William,
Quoted 9 lines · Krzysztof Kozlowski
Quoted 8 lines · Conor Dooley
Quoted 7 lines · Krzysztof Kozlowski
Quoted 4 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>---
Thank you for your patch. There is something to discuss/improve.
Quoted 9 lines
Could you please submit a v5 of this, with the bits below fixed, whenever Hal sends their next version of the base dts series? There's no maintainers coverage for a soc/starfive subdirectory of dt-bindings yet, so please CC [email protected] & [email protected] on the patch.
Thanks,
Conor.
I'll do it today.
Best regards
William
Quoted 45 lines
Quoted 45 lines
Quoted 31 lines
Quoted 22 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 8 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +7
-0+properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-sysconMaybe keep them ordered alphabetically?
Quoted 11 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +11
-0+ - const: syscon + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false +Quoted 8 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 39
Quoted 6 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +6
-0+examples: + - | + syscon@10240000 { + compatible = "starfive,jh7110-stg-syscon", "syscon"; + reg = <0x10240000 0x1000>; + };Keep only one example. All others are the same.
Quoted 5 lines
With these fixed:
Reviewed-by Conor Dooley <[email protected]>@Krzysztof, I assume the location of the binding is okay with you since you didn't object to it & I suppose this one is up to me to apply if so.
Yeah, generic sysreg devices go to soc. If their primary functions were different (e.g. clock controller which also is syscon), then they should go to respective directories, but it's not the case here, I think.
Best regards,
Krzysztof
William Qiu
maintainerRe: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
In reply to Krzysztof KozlowskiQuoted 16 lines · Krzysztof Kozlowski
Quoted 4 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>---
Thank you for your patch. There is something to discuss/improve.
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 7 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +7
-0+properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-syscon
Quoted 2 lines
Maybe keep them ordered alphabetically?
I'm sorting by register address, or I can keep them ordered alphabetically,which is better?
Quoted 11 lines
Quoted 11 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +11
-0+ - const: syscon + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false +
Quoted 9 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 39
Quoted 6 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +6
-0+examples: + - | + syscon@10240000 { + compatible = "starfive,jh7110-stg-syscon", "syscon"; + reg = <0x10240000 0x1000>; + };Keep only one example. All others are the same.
Will update in next version.
Thanks for taking times to review this patch series.
Best regards
William
Quoted 4 lines
Best regards,
Krzysztof
Re: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
Quoted 19 lines · William Qiu
Quoted 16 lines · Krzysztof Kozlowski
Quoted 4 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>---
Thank you for your patch. There is something to discuss/improve.
Quoted 7 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +7
-0+properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-syscon
Quoted 5 lines
Quoted 2 lines
Maybe keep them ordered alphabetically?
I'm sorting by register address, or I can keep them ordered alphabetically,which is better?
We don't know register address here, so I propose alphabetically.
Best regards,
Krzysztof
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Rob Herring
maintainerRe: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
In reply to William QiuQuoted 27 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>--- .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 56 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yamlDocumentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +12
-0@@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/starfive/jh7110-syscon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 SoC system controller + +maintainers: + - William Qiu <[email protected]> + +description: |
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 10 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +10
-0+ The StarFive JH7110 SoC system controller provides register information such + as offset, mask and shift to configure related modules such as MMC and PCIe. + +properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-syscon
Is 'syscon' really part of what the blocks are called? Is just 'stg', 'sys' and 'aon' not unique enough?
Rob
William Qiu
maintainerRe: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
Quoted 42 lines · Rob Herring
Quoted 27 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>--- .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 56 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yamlDocumentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +12
-0@@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/starfive/jh7110-syscon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 SoC system controller + +maintainers: + - William Qiu <[email protected]> + +description: |Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 10 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +10
-0+ The StarFive JH7110 SoC system controller provides register information such + as offset, mask and shift to configure related modules such as MMC and PCIe. + +properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-sysconIs 'syscon' really part of what the blocks are called? Is just 'stg', 'sys' and 'aon' not unique enough?
Quoted 1 line
Rob
Hi Rob,
In StarFive SoC, we do have syscrg/aoncrg/stgcrg, which is uesd to be the clock controller, so 'syscon' is added to avoid confusion.
Best regards
William
Rob Herring
maintainerRe: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
Quoted 45 lines · William Qiu
Quoted 42 lines · Rob Herring
Quoted 27 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>--- .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 56 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yamlDocumentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +12
-0@@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/starfive/jh7110-syscon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 SoC system controller + +maintainers: + - William Qiu <[email protected]> + +description: |Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 10 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +10
-0+ The StarFive JH7110 SoC system controller provides register information such + as offset, mask and shift to configure related modules such as MMC and PCIe. + +properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-sysconIs 'syscon' really part of what the blocks are called? Is just 'stg', 'sys' and 'aon' not unique enough?
Quoted 5 lines
Quoted 1 line
Rob
Hi Rob,
In StarFive SoC, we do have syscrg/aoncrg/stgcrg, which is uesd to be the clock controller, so 'syscon' is added to avoid confusion.
You've only added to my confusion. 'syscrg' and 'sys-syscon' are 2 different h/w blocks and unrelated to each other? Or 'syscrg' is the clock portion of 'sys-syscon'? In that case, 'syscrg' should be a child of 'sys-syscon' or possibly just all one node. Please provide details on the entire h/w block so we can provide better input on the bindings.
Rob
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
William Qiu
maintainerRe: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
Quoted 52 lines · Rob Herring
Quoted 45 lines · William Qiu
Quoted 42 lines · Rob Herring
Quoted 27 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>--- .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 56 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yamlDocumentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +12
-0@@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/starfive/jh7110-syscon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 SoC system controller + +maintainers: + - William Qiu <[email protected]> + +description: |Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 10 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +10
-0+ The StarFive JH7110 SoC system controller provides register information such + as offset, mask and shift to configure related modules such as MMC and PCIe. + +properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-sysconIs 'syscon' really part of what the blocks are called? Is just 'stg', 'sys' and 'aon' not unique enough?
Quoted 5 lines
Quoted 1 line
Rob
Hi Rob,
In StarFive SoC, we do have syscrg/aoncrg/stgcrg, which is uesd to be the clock controller, so 'syscon' is added to avoid confusion.
Quoted 7 lines
You've only added to my confusion. 'syscrg' and 'sys-syscon' are 2 different h/w blocks and unrelated to each other? Or 'syscrg' is the clock portion of 'sys-syscon'? In that case, 'syscrg' should be a child of 'sys-syscon' or possibly just all one node. Please provide details on the entire h/w block so we can provide better input on the bindings.
Rob
Hi Rob,
It's my description that's problematic.'syscon' here refers to the hardware module inside our JH7110, which is different from the syscon interface in linux. The syscon I added now uses the syscon interface of linux to read and write the syscon register in our JH7110. So we decided to name it that way.
Best regards
William
Re: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
Quoted 61 lines · William Qiu
Quoted 58 lines · Rob Herring
Quoted 45 lines · William Qiu
Quoted 42 lines · Rob Herring
Quoted 27 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>--- .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 56 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yamlDocumentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +12
-0@@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/starfive/jh7110-syscon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 SoC system controller + +maintainers: + - William Qiu <[email protected]> + +description: |Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 10 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +10
-0+ The StarFive JH7110 SoC system controller provides register information such + as offset, mask and shift to configure related modules such as MMC and PCIe. + +properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-sysconIs 'syscon' really part of what the blocks are called? Is just 'stg', 'sys' and 'aon' not unique enough?
Quoted 5 lines
Quoted 1 line
Rob
Hi Rob,
In StarFive SoC, we do have syscrg/aoncrg/stgcrg, which is uesd to be the clock controller, so 'syscon' is added to avoid confusion.
You've only added to my confusion. 'syscrg' and 'sys-syscon' are 2 different h/w blocks and unrelated to each other? Or 'syscrg' is the clock portion of 'sys-syscon'? In that case, 'syscrg' should be a child of 'sys-syscon' or possibly just all one node. Please provide details on the entire h/w block so we can provide better input on the bindings.
Quoted 8 lines
Quoted 1 line
Rob
Hi Rob,
It's my description that's problematic.'syscon' here refers to the hardware module inside our JH7110, which is different from the syscon interface in linux. The syscon I added now uses the syscon interface of linux to read and write the syscon register in our JH7110. So we decided to name it that way.
You didn't really answer Rob's questions.
Also, syscon is Linux term, so are you sure hardware module is called like this? Hardware engineers took pure Linux name and used it?
Best regards,
Krzysztof
Re: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
Quoted 72 lines · Krzysztof Kozlowski
Quoted 61 lines · William Qiu
Quoted 58 lines · Rob Herring
Quoted 45 lines · William Qiu
Quoted 42 lines · Rob Herring
Quoted 27 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>--- .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 56 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yamlDocumentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +12
-0@@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/starfive/jh7110-syscon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 SoC system controller + +maintainers: + - William Qiu <[email protected]> + +description: |Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 10 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +10
-0+ The StarFive JH7110 SoC system controller provides register information such + as offset, mask and shift to configure related modules such as MMC and PCIe. + +properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-sysconIs 'syscon' really part of what the blocks are called? Is just 'stg', 'sys' and 'aon' not unique enough?
Quoted 5 lines
Quoted 1 line
Rob
Hi Rob,
In StarFive SoC, we do have syscrg/aoncrg/stgcrg, which is uesd to be the clock controller, so 'syscon' is added to avoid confusion.
You've only added to my confusion. 'syscrg' and 'sys-syscon' are 2 different h/w blocks and unrelated to each other? Or 'syscrg' is the clock portion of 'sys-syscon'? In that case, 'syscrg' should be a child of 'sys-syscon' or possibly just all one node. Please provide details on the entire h/w block so we can provide better input on the bindings.
Quoted 8 lines
Quoted 1 line
Rob
Hi Rob,
It's my description that's problematic.'syscon' here refers to the hardware module inside our JH7110, which is different from the syscon interface in linux. The syscon I added now uses the syscon interface of linux to read and write the syscon register in our JH7110. So we decided to name it that way.
Quoted 4 lines
You didn't really answer Rob's questions.
Also, syscon is Linux term, so are you sure hardware module is called like this? Hardware engineers took pure Linux name and used it?
Yes, from the documentation I could find[1] there are CRG blocks (Clock and Reset Generator) and SYSCON blocks:
SYS CRG
STG CRG
AON CRG
SYS SYSCON
STG SYSCON
AON SYSCON
The CRG blocks contain registers to control clocks and resets that follow a pattern used by the clock and reset drivers. The SYSCON blocks just seem to contain registers to control whatever didn't fit in any other blocks, but might be vaguely related to the peripherals that run off clocks controlled by the corresponding CRG block.
[1]: https://doc-en.rvspace.org/JH7110/TRM/JH7110_TRM/system_control_registers.html
/Emil
Quoted 8 lines
Best regards,
Krzysztof_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Re: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
Quoted 88 lines · Emil Renner Berthing
Quoted 72 lines · Krzysztof Kozlowski
Quoted 61 lines · William Qiu
Quoted 58 lines · Rob Herring
Quoted 45 lines · William Qiu
Quoted 42 lines · Rob Herring
Quoted 27 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>--- .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 56 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yamlDocumentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +12
-0@@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/starfive/jh7110-syscon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 SoC system controller + +maintainers: + - William Qiu <[email protected]> + +description: |Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 10 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +10
-0+ The StarFive JH7110 SoC system controller provides register information such + as offset, mask and shift to configure related modules such as MMC and PCIe. + +properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-sysconIs 'syscon' really part of what the blocks are called? Is just 'stg', 'sys' and 'aon' not unique enough?
Quoted 5 lines
Quoted 1 line
Rob
Hi Rob,
In StarFive SoC, we do have syscrg/aoncrg/stgcrg, which is uesd to be the clock controller, so 'syscon' is added to avoid confusion.
You've only added to my confusion. 'syscrg' and 'sys-syscon' are 2 different h/w blocks and unrelated to each other? Or 'syscrg' is the clock portion of 'sys-syscon'? In that case, 'syscrg' should be a child of 'sys-syscon' or possibly just all one node. Please provide details on the entire h/w block so we can provide better input on the bindings.
Quoted 8 lines
Quoted 1 line
Rob
Hi Rob,
It's my description that's problematic.'syscon' here refers to the hardware module inside our JH7110, which is different from the syscon interface in linux. The syscon I added now uses the syscon interface of linux to read and write the syscon register in our JH7110. So we decided to name it that way.
Quoted 4 lines
You didn't really answer Rob's questions.
Also, syscon is Linux term, so are you sure hardware module is called like this? Hardware engineers took pure Linux name and used it?
Yes, from the documentation I could find[1] there are CRG blocks (Clock and Reset Generator) and SYSCON blocks:
SYS CRG
STG CRG
AON CRG
SYS SYSCON
STG SYSCON
AON SYSCON
Quoted 5 lines
The CRG blocks contain registers to control clocks and resets that follow a pattern used by the clock and reset drivers. The SYSCON blocks just seem to contain registers to control whatever didn't fit in any other blocks, but might be vaguely related to the peripherals that run off clocks controlled by the corresponding CRG block.
The memory map [1] suggests these are indeed separate address spaces, e.g. AON CRG, AON SYSCON and AON GPIO, but now I would argue that this might be still one device - AON (or STG, SYS). Just like PCIE0 has four address spaces, it does not mean you have four separate PCIE0 devices. You have only one PCIE0, just like you have only one AON, one STG and one SYS (System).
[1] https://doc-en.rvspace.org/JH7110/TRM/JH7110_TRM/system_memory_map.html
Best regards,
Krzysztof
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Re: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
Quoted 95 lines · Krzysztof Kozlowski
Quoted 88 lines · Emil Renner Berthing
Quoted 72 lines · Krzysztof Kozlowski
Quoted 61 lines · William Qiu
Quoted 58 lines · Rob Herring
Quoted 45 lines · William Qiu
Quoted 42 lines · Rob Herring
Quoted 27 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>--- .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 56 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yamlDocumentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +12
-0@@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/starfive/jh7110-syscon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 SoC system controller + +maintainers: + - William Qiu <[email protected]> + +description: |Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 10 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +10
-0+ The StarFive JH7110 SoC system controller provides register information such + as offset, mask and shift to configure related modules such as MMC and PCIe. + +properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-sysconIs 'syscon' really part of what the blocks are called? Is just 'stg', 'sys' and 'aon' not unique enough?
Quoted 5 lines
Quoted 1 line
Rob
Hi Rob,
In StarFive SoC, we do have syscrg/aoncrg/stgcrg, which is uesd to be the clock controller, so 'syscon' is added to avoid confusion.
You've only added to my confusion. 'syscrg' and 'sys-syscon' are 2 different h/w blocks and unrelated to each other? Or 'syscrg' is the clock portion of 'sys-syscon'? In that case, 'syscrg' should be a child of 'sys-syscon' or possibly just all one node. Please provide details on the entire h/w block so we can provide better input on the bindings.
Quoted 8 lines
Quoted 1 line
Rob
Hi Rob,
It's my description that's problematic.'syscon' here refers to the hardware module inside our JH7110, which is different from the syscon interface in linux. The syscon I added now uses the syscon interface of linux to read and write the syscon register in our JH7110. So we decided to name it that way.
Quoted 4 lines
You didn't really answer Rob's questions.
Also, syscon is Linux term, so are you sure hardware module is called like this? Hardware engineers took pure Linux name and used it?
Yes, from the documentation I could find[1] there are CRG blocks (Clock and Reset Generator) and SYSCON blocks:
SYS CRG
STG CRG
AON CRG
SYS SYSCON
STG SYSCON
AON SYSCONQuoted 5 lines
The CRG blocks contain registers to control clocks and resets that follow a pattern used by the clock and reset drivers. The SYSCON blocks just seem to contain registers to control whatever didn't fit in any other blocks, but might be vaguely related to the peripherals that run off clocks controlled by the corresponding CRG block.
Quoted 6 lines
The memory map [1] suggests these are indeed separate address spaces, e.g. AON CRG, AON SYSCON and AON GPIO, but now I would argue that this might be still one device - AON (or STG, SYS). Just like PCIE0 has four address spaces, it does not mean you have four separate PCIE0 devices. You have only one PCIE0, just like you have only one AON, one STG and one SYS (System).
I see what you mean, but if you look into what the registers in the SYSCON blocks actually do it's not clear to me that they should be grouped with the clocks/resets any more than say the pinctrl/GPIO node. Maybe it's my fault for not giving you the full picture. Eg. for "system" and "always-on" there are blocks:
SYS CRG
SYS SYSCON
SYS IOMUX
AON CRG
AON SYSCON
AON IOMUX
..and it really don't see why eg. SYS CRG and SYS SYSCON should be thought of as one device, but not include SYS IOMUX then.
As an examly the SYS SYSCON includes registers to control:
- remapping of different peripherals from SD controller to video encoders
- voltage select for certain GPIO pins
- phy interface selection for ethernet and CAN
- QuadSPI delay chain and SRAM configuration
- PLL configuration
- endian selection for the SD controller
To me this is pretty much exactly described by the syscon device tree binding:
"System controller node represents a register region containing a set of miscellaneous registers. The registers are not cohesive enough to represent as any specific type of device. [..]"
In any case it's clear that however the SYSCON blocks are represented in the device tree, a driver for it would need to export registers in the SYSCON block for other drivers to use.
/Emil
Quoted 6 lines
[1] https://doc-en.rvspace.org/JH7110/TRM/JH7110_TRM/system_memory_map.html
Best regards,
Krzysztof
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Re: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
Quoted 117 lines · Emil Renner Berthing
Quoted 95 lines · Krzysztof Kozlowski
Quoted 88 lines · Emil Renner Berthing
Quoted 72 lines · Krzysztof Kozlowski
Quoted 61 lines · William Qiu
Quoted 58 lines · Rob Herring
Quoted 45 lines · William Qiu
Quoted 42 lines · Rob Herring
Quoted 27 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>--- .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 56 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yamlDocumentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +12
-0@@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/starfive/jh7110-syscon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 SoC system controller + +maintainers: + - William Qiu <[email protected]> + +description: |Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 10 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +10
-0+ The StarFive JH7110 SoC system controller provides register information such + as offset, mask and shift to configure related modules such as MMC and PCIe. + +properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-sysconIs 'syscon' really part of what the blocks are called? Is just 'stg', 'sys' and 'aon' not unique enough?
Quoted 5 lines
Quoted 1 line
Rob
Hi Rob,
In StarFive SoC, we do have syscrg/aoncrg/stgcrg, which is uesd to be the clock controller, so 'syscon' is added to avoid confusion.
You've only added to my confusion. 'syscrg' and 'sys-syscon' are 2 different h/w blocks and unrelated to each other? Or 'syscrg' is the clock portion of 'sys-syscon'? In that case, 'syscrg' should be a child of 'sys-syscon' or possibly just all one node. Please provide details on the entire h/w block so we can provide better input on the bindings.
Quoted 8 lines
Quoted 1 line
Rob
Hi Rob,
It's my description that's problematic.'syscon' here refers to the hardware module inside our JH7110, which is different from the syscon interface in linux. The syscon I added now uses the syscon interface of linux to read and write the syscon register in our JH7110. So we decided to name it that way.
Quoted 4 lines
You didn't really answer Rob's questions.
Also, syscon is Linux term, so are you sure hardware module is called like this? Hardware engineers took pure Linux name and used it?
Yes, from the documentation I could find[1] there are CRG blocks (Clock and Reset Generator) and SYSCON blocks:
SYS CRG
STG CRG
AON CRG
SYS SYSCON
STG SYSCON
AON SYSCONQuoted 5 lines
The CRG blocks contain registers to control clocks and resets that follow a pattern used by the clock and reset drivers. The SYSCON blocks just seem to contain registers to control whatever didn't fit in any other blocks, but might be vaguely related to the peripherals that run off clocks controlled by the corresponding CRG block.
Quoted 6 lines
The memory map [1] suggests these are indeed separate address spaces, e.g. AON CRG, AON SYSCON and AON GPIO, but now I would argue that this might be still one device - AON (or STG, SYS). Just like PCIE0 has four address spaces, it does not mean you have four separate PCIE0 devices. You have only one PCIE0, just like you have only one AON, one STG and one SYS (System).
I see what you mean, but if you look into what the registers in the SYSCON blocks actually do it's not clear to me that they should be grouped with the clocks/resets any more than say the pinctrl/GPIO node. Maybe it's my fault for not giving you the full picture. Eg. for "system" and "always-on" there are blocks:
SYS CRG
SYS SYSCON
SYS IOMUX
AON CRG
AON SYSCON
AON IOMUX
Quoted 2 lines
..and it really don't see why eg. SYS CRG and SYS SYSCON should be thought of as one device, but not include SYS IOMUX then.
... include sys iomux as well, just like GPIO is included for AON.
Quoted 9 lines
As an examly the SYS SYSCON includes registers to control:
- remapping of different peripherals from SD controller to video encoders
- voltage select for certain GPIO pins
- phy interface selection for ethernet and CAN
- QuadSPI delay chain and SRAM configuration
- PLL configuration
- endian selection for the SD controller
Quoted 7 lines
To me this is pretty much exactly described by the syscon device tree binding:
"System controller node represents a register region containing a set of miscellaneous registers. The registers are not cohesive enough to represent as any specific type of device. [..]"
In any case it's clear that however the SYSCON blocks are represented in the device tree, a driver for it would need to export registers in the SYSCON block for other drivers to use.
You started entire sentence with "but" so you disagree but with what exactly? The naming? But syscon is fine - hardware manual calls it like that.
The point was that AON is one device (consisting of multiple blocks).
Best regards,
Krzysztof
Re: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
Quoted 118 lines · Krzysztof Kozlowski
Quoted 117 lines · Emil Renner Berthing
Quoted 95 lines · Krzysztof Kozlowski
Quoted 88 lines · Emil Renner Berthing
Quoted 72 lines · Krzysztof Kozlowski
Quoted 61 lines · William Qiu
Quoted 58 lines · Rob Herring
Quoted 45 lines · William Qiu
Quoted 42 lines · Rob Herring
Quoted 27 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>--- .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 56 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yamlDocumentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +12
-0@@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/starfive/jh7110-syscon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 SoC system controller + +maintainers: + - William Qiu <[email protected]> + +description: |Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 10 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +10
-0+ The StarFive JH7110 SoC system controller provides register information such + as offset, mask and shift to configure related modules such as MMC and PCIe. + +properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-sysconIs 'syscon' really part of what the blocks are called? Is just 'stg', 'sys' and 'aon' not unique enough?
Quoted 5 lines
Quoted 1 line
Rob
Hi Rob,
In StarFive SoC, we do have syscrg/aoncrg/stgcrg, which is uesd to be the clock controller, so 'syscon' is added to avoid confusion.
You've only added to my confusion. 'syscrg' and 'sys-syscon' are 2 different h/w blocks and unrelated to each other? Or 'syscrg' is the clock portion of 'sys-syscon'? In that case, 'syscrg' should be a child of 'sys-syscon' or possibly just all one node. Please provide details on the entire h/w block so we can provide better input on the bindings.
Quoted 8 lines
Quoted 1 line
Rob
Hi Rob,
It's my description that's problematic.'syscon' here refers to the hardware module inside our JH7110, which is different from the syscon interface in linux. The syscon I added now uses the syscon interface of linux to read and write the syscon register in our JH7110. So we decided to name it that way.
Quoted 4 lines
You didn't really answer Rob's questions.
Also, syscon is Linux term, so are you sure hardware module is called like this? Hardware engineers took pure Linux name and used it?
Yes, from the documentation I could find[1] there are CRG blocks (Clock and Reset Generator) and SYSCON blocks:
SYS CRG
STG CRG
AON CRG
SYS SYSCON
STG SYSCON
AON SYSCONQuoted 5 lines
The CRG blocks contain registers to control clocks and resets that follow a pattern used by the clock and reset drivers. The SYSCON blocks just seem to contain registers to control whatever didn't fit in any other blocks, but might be vaguely related to the peripherals that run off clocks controlled by the corresponding CRG block.
Quoted 6 lines
The memory map [1] suggests these are indeed separate address spaces, e.g. AON CRG, AON SYSCON and AON GPIO, but now I would argue that this might be still one device - AON (or STG, SYS). Just like PCIE0 has four address spaces, it does not mean you have four separate PCIE0 devices. You have only one PCIE0, just like you have only one AON, one STG and one SYS (System).
I see what you mean, but if you look into what the registers in the SYSCON blocks actually do it's not clear to me that they should be grouped with the clocks/resets any more than say the pinctrl/GPIO node. Maybe it's my fault for not giving you the full picture. Eg. for "system" and "always-on" there are blocks:
SYS CRG
SYS SYSCON
SYS IOMUX
AON CRG
AON SYSCON
AON IOMUX
Quoted 4 lines
Quoted 2 lines
..and it really don't see why eg. SYS CRG and SYS SYSCON should be thought of as one device, but not include SYS IOMUX then.
... include sys iomux as well, just like GPIO is included for AON.
This would at least take the view that the blocks named alike should be thought of as a single device to its logical conclusion. Unfortunately we're a bit late for that. The pinctrl/GPiO bindings and drivers are already merged:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d6e0a660097dcdb80e7c5c859eb12f776060b02e
Quoted 17 lines
Quoted 9 lines
As an examly the SYS SYSCON includes registers to control:
- remapping of different peripherals from SD controller to video encoders
- voltage select for certain GPIO pins
- phy interface selection for ethernet and CAN
- QuadSPI delay chain and SRAM configuration
- PLL configuration
- endian selection for the SD controllerQuoted 7 lines
To me this is pretty much exactly described by the syscon device tree binding:
"System controller node represents a register region containing a set of miscellaneous registers. The registers are not cohesive enough to represent as any specific type of device. [..]"
In any case it's clear that however the SYSCON blocks are represented in the device tree, a driver for it would need to export registers in the SYSCON block for other drivers to use.
Quoted 5 lines
You started entire sentence with "but" so you disagree but with what exactly? The naming? But syscon is fine - hardware manual calls it like that.
The point was that AON is one device (consisting of multiple blocks).
Yes, and what I'm trying to explain is that I'm not convinced that's the right model. The CRG blocks and IOMUX blocks don't really have anything in common other than the name StarFive gave them. You can argue that the CRG and IOMUX blocks overlap with the corresponding SYSCON block, but so do a lot of other peripherals as you can see from the list above.
I think the IOMUX and SYSCON blocks are just named after the clock domain they're under, but a lot of other peripherals are also under the SYS and AON clock domains and we don't model them as one big device.
/Emil
Quoted 4 lines
Best regards,
Krzysztof
Conor Dooley
maintainerRe: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
Quoted 60 lines · Emil Renner Berthing
Quoted 17 lines · Krzysztof Kozlowski
Quoted 16 lines · Emil Renner Berthing
On Tue, 28 Feb 2023 at 12:28, Krzysztof Kozlowski
<[email protected]> wrote:I see what you mean, but if you look into what the registers in the SYSCON blocks actually do it's not clear to me that they should be grouped with the clocks/resets any more than say the pinctrl/GPIO node. Maybe it's my fault for not giving you the full picture. Eg. for "system" and "always-on" there are blocks:
SYS CRG
SYS SYSCON
SYS IOMUX
AON CRG
AON SYSCON
AON IOMUXQuoted 4 lines
Quoted 2 lines
..and it really don't see why eg. SYS CRG and SYS SYSCON should be thought of as one device, but not include SYS IOMUX then.
... include sys iomux as well, just like GPIO is included for AON.
This would at least take the view that the blocks named alike should be thought of as a single device to its logical conclusion. Unfortunately we're a bit late for that. The pinctrl/GPiO bindings and drivers are already merged:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d6e0a660097dcdb80e7c5c859eb12f776060b02eQuoted 17 lines
Quoted 9 lines
As an examly the SYS SYSCON includes registers to control:
- remapping of different peripherals from SD controller to video encoders
- voltage select for certain GPIO pins
- phy interface selection for ethernet and CAN
- QuadSPI delay chain and SRAM configuration
- PLL configuration
- endian selection for the SD controllerQuoted 7 lines
To me this is pretty much exactly described by the syscon device tree binding:
"System controller node represents a register region containing a set of miscellaneous registers. The registers are not cohesive enough to represent as any specific type of device. [..]"
In any case it's clear that however the SYSCON blocks are represented in the device tree, a driver for it would need to export registers in the SYSCON block for other drivers to use.Quoted 5 lines
You started entire sentence with "but" so you disagree but with what exactly? The naming? But syscon is fine - hardware manual calls it like that.
The point was that AON is one device (consisting of multiple blocks).
Yes, and what I'm trying to explain is that I'm not convinced that's the right model. The CRG blocks and IOMUX blocks don't really have anything in common other than the name StarFive gave them. You can argue that the CRG and IOMUX blocks overlap with the corresponding SYSCON block, but so do a lot of other peripherals as you can see from the list above.
Quoted 4 lines
I think the IOMUX and SYSCON blocks are just named after the clock domain they're under, but a lot of other peripherals are also under the SYS and AON clock domains and we don't model them as one big device.
I went and bothered Rob/Krzysztof on IRC about this.
Not gonna speak for them, but I think they're now okay with keeping the SYS_CRG (clock+reset block) separate from the SYS_SYSCON block ("random collection of registers"). Possibly there was just confusion due to the naming used here, thinking that "SYS", "STG" and "AON" were devices with two register blocks, as opposed to being the name of a clock/power domain on the SoC.
I'll leave it up to them to confirm that though!
Cheers,
Conor.
Re: [PATCH v4 4/4] dt-bindings: syscon: Add StarFive syscon doc
In reply to Krzysztof KozlowskiQuoted 60 lines · Krzysztof Kozlowski
Quoted 54 lines · William Qiu
Quoted 44 lines · Rob Herring
Quoted 42 lines · William Qiu
Quoted 41 lines · Rob Herring
Quoted 27 lines · William Qiu
Add documentation to describe StarFive System Controller Registers.
Signed-off-by William Qiu <[email protected]>--- .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 56 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yamlDocumentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +12
-0@@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/starfive/jh7110-syscon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 SoC system controller + +maintainers: + - William Qiu <[email protected]> + +description: |Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml line 22
Quoted 10 lines
Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml new file +10
-0+ The StarFive JH7110 SoC system controller provides register information such + as offset, mask and shift to configure related modules such as MMC and PCIe. + +properties: + compatible: + items: + - enum: + - starfive,jh7110-stg-syscon + - starfive,jh7110-sys-syscon + - starfive,jh7110-aon-sysconIs 'syscon' really part of what the blocks are called? Is just 'stg', 'sys' and 'aon' not unique enough?
Quoted 8 lines
Quoted 2 lines
In StarFive SoC, we do have syscrg/aoncrg/stgcrg, which is uesd to be the clock controller, so 'syscon' is added to avoid confusion.
You've only added to my confusion. 'syscrg' and 'sys-syscon' are 2 different h/w blocks and unrelated to each other? Or 'syscrg' is the clock portion of 'sys-syscon'? In that case, 'syscrg' should be a child of 'sys-syscon' or possibly just all one node. Please provide details on the entire h/w block so we can provide better input on the bindings.
Quoted 4 lines
It's my description that's problematic.'syscon' here refers to the hardware module inside our JH7110, which is different from the syscon interface in linux. The syscon I added now uses the syscon interface of linux to read and write the syscon register in our JH7110. So we decided to name it that way.
Quoted 4 lines
You didn't really answer Rob's questions.
Also, syscon is Linux term, so are you sure hardware module is called like this? Hardware engineers took pure Linux name and used it?
Their TRM uses the term SYSCON for these, yes.
Eg:
"The JH7110 system provides the following STG SYSCON control registers which provides [sic] clock and reset signals to interfaces..."
In fact, the TRM I have describes the following system control register blocks:
SYS CRG
STG CRG
AON CRG
SYS SYSCON
STG SYSCON
AON SYSCON
SYS IOMUX CFG
AON IOMUX CFG
My understanding is that the first 3 (the CRG ones) are concerned with clocks and resets & the second 3 contain "random" configuration options, such as their QSPI IP's configuration options, GPIO voltage settings etc.
Each of these has a separate, 0x1000 aligned, block in the memory map.
Cheers,
Conor.
Quoted 39 lines · William Qiu
Hi,
This patchset adds initial rudimentary support for the StarFive designware mobile storage host controller driver. And this driver will be used in StarFive's VisionFive 2 board. The main purpose of adding this driver is to accommodate the ultra-high speed mode of eMMC.
The last patch should be applied after the patchset [1]:
[1] https://lore.kernel.org/all/[email protected]/Changes
v3->v4:
- Added documentation to describe StarFive System Controller Registers.
- Addedaon_sysconandstg_sysconnode.
- Fixed some checkpatch errors/warnings.Changes
v2->v3:
- Wraped commit message according to Linux coding style.
- Rephrased the description of the patches.
- Changed the description of syscon regsiter.
- Dropped redundant properties.Changes
v1->v2:
- Renamed the dt-binding 'starfive,jh7110-sdio.yaml' to 'starfive,jh7110-mmc.yaml'.
- Changed the type of 'starfive,syscon' and modify its description.
- Deleted unused head files like '#include <linux/gpio.h>'.
- Added comment for the 'rise_point' and 'fall_point'.
- Changed the API 'num_caps' to 'common_caps'.
- Changed the node name 'sys_syscon' to 'syscon'.
- Changed the node name 'sdio' to 'mmc'.The patch series is based on v6.1.
William Qiu (4):
dt-bindings: mmc: Add StarFive MMC module
mmc: starfive: Add sdio/emmc driver support
riscv: dts: starfive: Add mmc node
dt-bindings: syscon: Add StarFive syscon doc
Quoted 13 lines
.../bindings/mmc/starfive,jh7110-mmc.yaml | 77 ++++++++ .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++ MAINTAINERS | 11 ++ .../jh7110-starfive-visionfive-2.dtsi | 23 +++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 47 +++++ drivers/mmc/host/Kconfig | 10 + drivers/mmc/host/Makefile | 1 + drivers/mmc/host/dw_mmc-starfive.c | 186 ++++++++++++++++++ 8 files changed, 406 insertions(+) create mode 100644 Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml create mode 100644 drivers/mmc/host/dw_mmc-starfive.c
I have dropped the v3 patches and applied patch1 and patch2 from the v4 series instead, for my next branch, thanks!
Kind regards
Uffe
William Qiu
maintainerQuoted 54 lines · Ulf Hansson
Quoted 39 lines · William Qiu
Hi,
This patchset adds initial rudimentary support for the StarFive designware mobile storage host controller driver. And this driver will be used in StarFive's VisionFive 2 board. The main purpose of adding this driver is to accommodate the ultra-high speed mode of eMMC.
The last patch should be applied after the patchset [1]:
[1] https://lore.kernel.org/all/[email protected]/Changes
v3->v4:
- Added documentation to describe StarFive System Controller Registers.
- Addedaon_sysconandstg_sysconnode.
- Fixed some checkpatch errors/warnings.Changes
v2->v3:
- Wraped commit message according to Linux coding style.
- Rephrased the description of the patches.
- Changed the description of syscon regsiter.
- Dropped redundant properties.Changes
v1->v2:
- Renamed the dt-binding 'starfive,jh7110-sdio.yaml' to 'starfive,jh7110-mmc.yaml'.
- Changed the type of 'starfive,syscon' and modify its description.
- Deleted unused head files like '#include <linux/gpio.h>'.
- Added comment for the 'rise_point' and 'fall_point'.
- Changed the API 'num_caps' to 'common_caps'.
- Changed the node name 'sys_syscon' to 'syscon'.
- Changed the node name 'sdio' to 'mmc'.The patch series is based on v6.1.
William Qiu (4):
dt-bindings: mmc: Add StarFive MMC module
mmc: starfive: Add sdio/emmc driver support
riscv: dts: starfive: Add mmc node
dt-bindings: syscon: Add StarFive syscon docQuoted 13 lines
.../bindings/mmc/starfive,jh7110-mmc.yaml | 77 ++++++++ .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++ MAINTAINERS | 11 ++ .../jh7110-starfive-visionfive-2.dtsi | 23 +++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 47 +++++ drivers/mmc/host/Kconfig | 10 + drivers/mmc/host/Makefile | 1 + drivers/mmc/host/dw_mmc-starfive.c | 186 ++++++++++++++++++ 8 files changed, 406 insertions(+) create mode 100644 Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml create mode 100644 drivers/mmc/host/dw_mmc-starfive.c
Quoted 5 lines
I have dropped the v3 patches and applied patch1 and patch2 from the v4 series instead, for my next branch, thanks!
Kind regards
Uffe
Hi Uffe,
Sorry to bother you.But I found a bug that in drivers/mmc/host/dw_mmc-starfive.c:
47 static int dw_mci_starfive_execute_tuning(struct dw_mci_slot *slot,
48 u32 opcode)
49 {
50 static const int grade = MAX_DELAY_CHAIN;
51 struct dw_mci *host = slot->host;
52 struct starfive_priv *priv = host->priv;
53 int rise_point = -1, fall_point = -1;
54 int err, prev_err;
55 int i;
56 bool found = 0;
57 u32 regval;
58
59 /*
60 * Use grade as the max delay chain, and use the rise_point and
61 * fall_point to ensure the best sampling point of a data input
62 * signals.
63 */
64 for (i = 0; i < grade; i++) {
65 regval = i << priv->syscon_shift;
66 err = regmap_update_bits(priv->reg_syscon, priv->syscon_offset,
67 priv->syscon_mask, regval);
68 if (err)
69 return err;
70 mci_writel(host, RINTSTS, ALL_INT_CLR);
71
72 err = mmc_send_tuning(slot->mmc, opcode, NULL);
73 if (!err)
74 found = 1;
75
76 if (i > 0) {--> 77 if (err && !prev_err)
prev_err was never initialized to zero.
So I'm here to ask for your suggestion, should I send a new version to fix it or send you a patch with a fixes tag?
Best regards
William
Quoted 98 lines · William Qiu
Quoted 54 lines · Ulf Hansson
Quoted 39 lines · William Qiu
Hi,
This patchset adds initial rudimentary support for the StarFive designware mobile storage host controller driver. And this driver will be used in StarFive's VisionFive 2 board. The main purpose of adding this driver is to accommodate the ultra-high speed mode of eMMC.
The last patch should be applied after the patchset [1]:
[1] https://lore.kernel.org/all/[email protected]/Changes
v3->v4:
- Added documentation to describe StarFive System Controller Registers.
- Addedaon_sysconandstg_sysconnode.
- Fixed some checkpatch errors/warnings.Changes
v2->v3:
- Wraped commit message according to Linux coding style.
- Rephrased the description of the patches.
- Changed the description of syscon regsiter.
- Dropped redundant properties.Changes
v1->v2:
- Renamed the dt-binding 'starfive,jh7110-sdio.yaml' to 'starfive,jh7110-mmc.yaml'.
- Changed the type of 'starfive,syscon' and modify its description.
- Deleted unused head files like '#include <linux/gpio.h>'.
- Added comment for the 'rise_point' and 'fall_point'.
- Changed the API 'num_caps' to 'common_caps'.
- Changed the node name 'sys_syscon' to 'syscon'.
- Changed the node name 'sdio' to 'mmc'.The patch series is based on v6.1.
William Qiu (4):
dt-bindings: mmc: Add StarFive MMC module
mmc: starfive: Add sdio/emmc driver support
riscv: dts: starfive: Add mmc node
dt-bindings: syscon: Add StarFive syscon docQuoted 13 lines
.../bindings/mmc/starfive,jh7110-mmc.yaml | 77 ++++++++ .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++ MAINTAINERS | 11 ++ .../jh7110-starfive-visionfive-2.dtsi | 23 +++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 47 +++++ drivers/mmc/host/Kconfig | 10 + drivers/mmc/host/Makefile | 1 + drivers/mmc/host/dw_mmc-starfive.c | 186 ++++++++++++++++++ 8 files changed, 406 insertions(+) create mode 100644 Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml create mode 100644 drivers/mmc/host/dw_mmc-starfive.cQuoted 5 lines
I have dropped the v3 patches and applied patch1 and patch2 from the v4 series instead, for my next branch, thanks!
Kind regards
UffeHi Uffe,
Sorry to bother you.But I found a bug that in
drivers/mmc/host/dw_mmc-starfive.c:47 static int dw_mci_starfive_execute_tuning(struct dw_mci_slot *slot, 48 u32 opcode) 49 { 50 static const int grade = MAX_DELAY_CHAIN; 51 struct dw_mci *host = slot->host; 52 struct starfive_priv *priv = host->priv; 53 int rise_point = -1, fall_point = -1; 54 int err, prev_err; 55 int i; 56 bool found = 0; 57 u32 regval; 58 59 /* 60 * Use grade as the max delay chain, and use the rise_point and 61 * fall_point to ensure the best sampling point of a data input 62 * signals. 63 */ 64 for (i = 0; i < grade; i++) { 65 regval = i << priv->syscon_shift; 66 err = regmap_update_bits(priv->reg_syscon, priv->syscon_offset, 67 priv->syscon_mask, regval); 68 if (err) 69 return err; 70 mci_writel(host, RINTSTS, ALL_INT_CLR); 71 72 err = mmc_send_tuning(slot->mmc, opcode, NULL); 73 if (!err) 74 found = 1; 75 76 if (i > 0) {
Quoted 6 lines
--> 77 if (err && !prev_err)
prev_errwas never initialized to zero.So I'm here to ask for your suggestion, should I send a new version to fix it or send you a patch with a fixes tag?
Please send a new incremental patch on top. I will queue it up as a fix for v6.3-rc[n].
Kind regards
Uffe
William Qiu
maintainerQuoted 103 lines · Ulf Hansson
Quoted 102 lines · William Qiu
Quoted 54 lines · Ulf Hansson
Quoted 39 lines · William Qiu
Hi,
This patchset adds initial rudimentary support for the StarFive designware mobile storage host controller driver. And this driver will be used in StarFive's VisionFive 2 board. The main purpose of adding this driver is to accommodate the ultra-high speed mode of eMMC.
The last patch should be applied after the patchset [1]:
[1] https://lore.kernel.org/all/[email protected]/Changes
v3->v4:
- Added documentation to describe StarFive System Controller Registers.
- Addedaon_sysconandstg_sysconnode.
- Fixed some checkpatch errors/warnings.Changes
v2->v3:
- Wraped commit message according to Linux coding style.
- Rephrased the description of the patches.
- Changed the description of syscon regsiter.
- Dropped redundant properties.Changes
v1->v2:
- Renamed the dt-binding 'starfive,jh7110-sdio.yaml' to 'starfive,jh7110-mmc.yaml'.
- Changed the type of 'starfive,syscon' and modify its description.
- Deleted unused head files like '#include <linux/gpio.h>'.
- Added comment for the 'rise_point' and 'fall_point'.
- Changed the API 'num_caps' to 'common_caps'.
- Changed the node name 'sys_syscon' to 'syscon'.
- Changed the node name 'sdio' to 'mmc'.The patch series is based on v6.1.
William Qiu (4):
dt-bindings: mmc: Add StarFive MMC module
mmc: starfive: Add sdio/emmc driver support
riscv: dts: starfive: Add mmc node
dt-bindings: syscon: Add StarFive syscon docQuoted 13 lines
.../bindings/mmc/starfive,jh7110-mmc.yaml | 77 ++++++++ .../bindings/soc/starfive/jh7110-syscon.yaml | 51 +++++ MAINTAINERS | 11 ++ .../jh7110-starfive-visionfive-2.dtsi | 23 +++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 47 +++++ drivers/mmc/host/Kconfig | 10 + drivers/mmc/host/Makefile | 1 + drivers/mmc/host/dw_mmc-starfive.c | 186 ++++++++++++++++++ 8 files changed, 406 insertions(+) create mode 100644 Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml create mode 100644 Documentation/devicetree/bindings/soc/starfive/jh7110-syscon.yaml create mode 100644 drivers/mmc/host/dw_mmc-starfive.cQuoted 5 lines
I have dropped the v3 patches and applied patch1 and patch2 from the v4 series instead, for my next branch, thanks!
Kind regards
UffeHi Uffe,
Sorry to bother you.But I found a bug that in
drivers/mmc/host/dw_mmc-starfive.c:47 static int dw_mci_starfive_execute_tuning(struct dw_mci_slot *slot, 48 u32 opcode) 49 { 50 static const int grade = MAX_DELAY_CHAIN; 51 struct dw_mci *host = slot->host; 52 struct starfive_priv *priv = host->priv; 53 int rise_point = -1, fall_point = -1; 54 int err, prev_err; 55 int i; 56 bool found = 0; 57 u32 regval; 58 59 /* 60 * Use grade as the max delay chain, and use the rise_point and 61 * fall_point to ensure the best sampling point of a data input 62 * signals. 63 */ 64 for (i = 0; i < grade; i++) { 65 regval = i << priv->syscon_shift; 66 err = regmap_update_bits(priv->reg_syscon, priv->syscon_offset, 67 priv->syscon_mask, regval); 68 if (err) 69 return err; 70 mci_writel(host, RINTSTS, ALL_INT_CLR); 71 72 err = mmc_send_tuning(slot->mmc, opcode, NULL); 73 if (!err) 74 found = 1; 75 76 if (i > 0) {--> 77 if (err && !prev_err)
prev_errwas never initialized to zero.
Quoted 8 lines
Quoted 2 lines
So I'm here to ask for your suggestion, should I send a new version to fix it or send you a patch with a fixes tag?
Please send a new incremental patch on top. I will queue it up as a fix for v6.3-rc[n].
Kind regards
Uffe
Fine, I'll do it in my next version. Thanks for your apply.
Best regards
William