[PATCH v5 1/2] dt-bindings: mmc: sdhci-of-dwcmshc: Add Eswin EIC7700

hehuan1@eswincomputing.com posted 2 patches 3 months, 3 weeks ago
[PATCH v5 1/2] dt-bindings: mmc: sdhci-of-dwcmshc: Add Eswin EIC7700
Posted by hehuan1@eswincomputing.com 3 months, 3 weeks ago
From: Huan He <hehuan1@eswincomputing.com>

EIC7700 use Synopsys dwcmshc IP for SD/eMMC controllers.
Add Eswin EIC7700 support in sdhci-of-dwcmshc.yaml.

Signed-off-by: Huan He <hehuan1@eswincomputing.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
---
 .../bindings/mmc/snps,dwcmshc-sdhci.yaml      | 57 +++++++++++++++++--
 1 file changed, 51 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
index f882219a0a26..7e7c55dc2440 100644
--- a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
+++ b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
@@ -30,6 +30,7 @@ properties:
           - sophgo,sg2002-dwcmshc
           - sophgo,sg2042-dwcmshc
           - thead,th1520-dwcmshc
+          - eswin,eic7700-dwcmshc
 
   reg:
     maxItems: 1
@@ -52,17 +53,30 @@ properties:
     maxItems: 5
 
   reset-names:
-    items:
-      - const: core
-      - const: bus
-      - const: axi
-      - const: block
-      - const: timer
+    maxItems: 5
 
   rockchip,txclk-tapnum:
     description: Specify the number of delay for tx sampling.
     $ref: /schemas/types.yaml#/definitions/uint8
 
+  eswin,hsp-sp-csr:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    items:
+      - items:
+          - description: Phandle to HSP(High-Speed Peripheral) device
+          - description: Offset of the stability status register for internal
+                         clock.
+          - description: Offset of the stability register for host regulator
+                         voltage.
+    description:
+      HSP CSR is to control and get status of different high-speed peripherals
+      (such as Ethernet, USB, SATA, etc.) via register, which can tune
+      board-level's parameters of PHY, etc.
+
+  eswin,drive-impedance-ohms:
+    description: Specifies the drive impedance in Ohm.
+    enum: [33, 40, 50, 66, 100]
+
 required:
   - compatible
   - reg
@@ -110,6 +124,37 @@ allOf:
             - const: block
             - const: timer
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: eswin,eic7700-dwcmshc
+    then:
+      properties:
+        resets:
+          minItems: 4
+          maxItems: 4
+        reset-names:
+          items:
+            - const: axi
+            - const: phy
+            - const: prstn
+            - const: txrx
+      required:
+        - eswin,hsp-sp-csr
+        - eswin,drive-impedance-ohms
+    else:
+      properties:
+        resets:
+          maxItems: 5
+        reset-names:
+          items:
+            - const: core
+            - const: bus
+            - const: axi
+            - const: block
+            - const: timer
+
   - if:
       properties:
         compatible:
-- 
2.25.1
Re: [PATCH v5 1/2] dt-bindings: mmc: sdhci-of-dwcmshc: Add Eswin EIC7700
Posted by Ulf Hansson 3 months, 2 weeks ago
On Sun, 19 Oct 2025 at 13:52, <hehuan1@eswincomputing.com> wrote:
>
> From: Huan He <hehuan1@eswincomputing.com>
>
> EIC7700 use Synopsys dwcmshc IP for SD/eMMC controllers.
> Add Eswin EIC7700 support in sdhci-of-dwcmshc.yaml.
>
> Signed-off-by: Huan He <hehuan1@eswincomputing.com>
> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
> ---
>  .../bindings/mmc/snps,dwcmshc-sdhci.yaml      | 57 +++++++++++++++++--
>  1 file changed, 51 insertions(+), 6 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
> index f882219a0a26..7e7c55dc2440 100644
> --- a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
> +++ b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
> @@ -30,6 +30,7 @@ properties:
>            - sophgo,sg2002-dwcmshc
>            - sophgo,sg2042-dwcmshc
>            - thead,th1520-dwcmshc
> +          - eswin,eic7700-dwcmshc
>
>    reg:
>      maxItems: 1
> @@ -52,17 +53,30 @@ properties:
>      maxItems: 5
>
>    reset-names:
> -    items:
> -      - const: core
> -      - const: bus
> -      - const: axi
> -      - const: block
> -      - const: timer
> +    maxItems: 5
>
>    rockchip,txclk-tapnum:
>      description: Specify the number of delay for tx sampling.
>      $ref: /schemas/types.yaml#/definitions/uint8
>
> +  eswin,hsp-sp-csr:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +    items:
> +      - items:
> +          - description: Phandle to HSP(High-Speed Peripheral) device
> +          - description: Offset of the stability status register for internal
> +                         clock.
> +          - description: Offset of the stability register for host regulator
> +                         voltage.
> +    description:
> +      HSP CSR is to control and get status of different high-speed peripherals
> +      (such as Ethernet, USB, SATA, etc.) via register, which can tune
> +      board-level's parameters of PHY, etc.

I would like second confirmation from DT maintainers, to make sure
it's reasonable to model the HW like this.

In principle the phandle above gets translated into a regmap via a
call to syscon_node_to_regmap() in the driver, to allow some registers
to be written that are outside the controllers address space.

> +
> +  eswin,drive-impedance-ohms:
> +    description: Specifies the drive impedance in Ohm.
> +    enum: [33, 40, 50, 66, 100]
> +
>  required:
>    - compatible
>    - reg
> @@ -110,6 +124,37 @@ allOf:
>              - const: block
>              - const: timer
>
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: eswin,eic7700-dwcmshc
> +    then:
> +      properties:
> +        resets:
> +          minItems: 4
> +          maxItems: 4
> +        reset-names:
> +          items:
> +            - const: axi
> +            - const: phy
> +            - const: prstn
> +            - const: txrx
> +      required:
> +        - eswin,hsp-sp-csr
> +        - eswin,drive-impedance-ohms
> +    else:
> +      properties:
> +        resets:
> +          maxItems: 5
> +        reset-names:
> +          items:
> +            - const: core
> +            - const: bus
> +            - const: axi
> +            - const: block
> +            - const: timer
> +
>    - if:
>        properties:
>          compatible:
> --
> 2.25.1
>

Kind regards
Uffe
Re: [PATCH v5 1/2] dt-bindings: mmc: sdhci-of-dwcmshc: Add Eswin EIC7700
Posted by Conor Dooley 3 months, 2 weeks ago
On Fri, Oct 24, 2025 at 03:57:33PM +0200, Ulf Hansson wrote:
> On Sun, 19 Oct 2025 at 13:52, <hehuan1@eswincomputing.com> wrote:
> >
> > From: Huan He <hehuan1@eswincomputing.com>
> >
> > EIC7700 use Synopsys dwcmshc IP for SD/eMMC controllers.
> > Add Eswin EIC7700 support in sdhci-of-dwcmshc.yaml.
> >
> > Signed-off-by: Huan He <hehuan1@eswincomputing.com>
> > Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
> > ---
> >  .../bindings/mmc/snps,dwcmshc-sdhci.yaml      | 57 +++++++++++++++++--
> >  1 file changed, 51 insertions(+), 6 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
> > index f882219a0a26..7e7c55dc2440 100644
> > --- a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
> > +++ b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
> > @@ -30,6 +30,7 @@ properties:
> >            - sophgo,sg2002-dwcmshc
> >            - sophgo,sg2042-dwcmshc
> >            - thead,th1520-dwcmshc
> > +          - eswin,eic7700-dwcmshc
> >
> >    reg:
> >      maxItems: 1
> > @@ -52,17 +53,30 @@ properties:
> >      maxItems: 5
> >
> >    reset-names:
> > -    items:
> > -      - const: core
> > -      - const: bus
> > -      - const: axi
> > -      - const: block
> > -      - const: timer
> > +    maxItems: 5
> >
> >    rockchip,txclk-tapnum:
> >      description: Specify the number of delay for tx sampling.
> >      $ref: /schemas/types.yaml#/definitions/uint8
> >
> > +  eswin,hsp-sp-csr:
> > +    $ref: /schemas/types.yaml#/definitions/phandle-array
> > +    items:
> > +      - items:
> > +          - description: Phandle to HSP(High-Speed Peripheral) device
> > +          - description: Offset of the stability status register for internal
> > +                         clock.
> > +          - description: Offset of the stability register for host regulator
> > +                         voltage.
> > +    description:
> > +      HSP CSR is to control and get status of different high-speed peripherals
> > +      (such as Ethernet, USB, SATA, etc.) via register, which can tune
> > +      board-level's parameters of PHY, etc.
> 
> I would like second confirmation from DT maintainers, to make sure
> it's reasonable to model the HW like this.

If by second confirmation, you mean by someone other than me, obviously
ignore this, but I think this is "fine". It discussed on a previous
revision that all is being done with it is setting a handful bits that
signify that the peripheral has been configured correctly.

That said, I don't have a clue what's going on with the warning about
the dwmac device. That's definitely one for Rob.

> 
> In principle the phandle above gets translated into a regmap via a
> call to syscon_node_to_regmap() in the driver, to allow some registers
> to be written that are outside the controllers address space.
> 
> > +
> > +  eswin,drive-impedance-ohms:
> > +    description: Specifies the drive impedance in Ohm.
> > +    enum: [33, 40, 50, 66, 100]
> > +
> >  required:
> >    - compatible
> >    - reg
> > @@ -110,6 +124,37 @@ allOf:
> >              - const: block
> >              - const: timer
> >
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: eswin,eic7700-dwcmshc
> > +    then:
> > +      properties:
> > +        resets:
> > +          minItems: 4
> > +          maxItems: 4
> > +        reset-names:
> > +          items:
> > +            - const: axi
> > +            - const: phy
> > +            - const: prstn
> > +            - const: txrx
> > +      required:
> > +        - eswin,hsp-sp-csr
> > +        - eswin,drive-impedance-ohms
> > +    else:
> > +      properties:
> > +        resets:
> > +          maxItems: 5
> > +        reset-names:
> > +          items:
> > +            - const: core
> > +            - const: bus
> > +            - const: axi
> > +            - const: block
> > +            - const: timer
> > +
> >    - if:
> >        properties:
> >          compatible:
> > --
> > 2.25.1
> >
> 
> Kind regards
> Uffe
Re: [PATCH v5 1/2] dt-bindings: mmc: sdhci-of-dwcmshc: Add Eswin EIC7700
Posted by Conor Dooley 3 months, 2 weeks ago
On Fri, Oct 24, 2025 at 05:37:59PM +0100, Conor Dooley wrote:
> On Fri, Oct 24, 2025 at 03:57:33PM +0200, Ulf Hansson wrote:
> > On Sun, 19 Oct 2025 at 13:52, <hehuan1@eswincomputing.com> wrote:
> > >
> > > From: Huan He <hehuan1@eswincomputing.com>
> > >
> > > EIC7700 use Synopsys dwcmshc IP for SD/eMMC controllers.
> > > Add Eswin EIC7700 support in sdhci-of-dwcmshc.yaml.
> > >
> > > Signed-off-by: Huan He <hehuan1@eswincomputing.com>
> > > Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
> > > ---
> > >  .../bindings/mmc/snps,dwcmshc-sdhci.yaml      | 57 +++++++++++++++++--
> > >  1 file changed, 51 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
> > > index f882219a0a26..7e7c55dc2440 100644
> > > --- a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
> > > +++ b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
> > > @@ -30,6 +30,7 @@ properties:
> > >            - sophgo,sg2002-dwcmshc
> > >            - sophgo,sg2042-dwcmshc
> > >            - thead,th1520-dwcmshc
> > > +          - eswin,eic7700-dwcmshc
> > >
> > >    reg:
> > >      maxItems: 1
> > > @@ -52,17 +53,30 @@ properties:
> > >      maxItems: 5
> > >
> > >    reset-names:
> > > -    items:
> > > -      - const: core
> > > -      - const: bus
> > > -      - const: axi
> > > -      - const: block
> > > -      - const: timer
> > > +    maxItems: 5
> > >
> > >    rockchip,txclk-tapnum:
> > >      description: Specify the number of delay for tx sampling.
> > >      $ref: /schemas/types.yaml#/definitions/uint8
> > >
> > > +  eswin,hsp-sp-csr:
> > > +    $ref: /schemas/types.yaml#/definitions/phandle-array
> > > +    items:
> > > +      - items:
> > > +          - description: Phandle to HSP(High-Speed Peripheral) device
> > > +          - description: Offset of the stability status register for internal
> > > +                         clock.
> > > +          - description: Offset of the stability register for host regulator
> > > +                         voltage.
> > > +    description:
> > > +      HSP CSR is to control and get status of different high-speed peripherals
> > > +      (such as Ethernet, USB, SATA, etc.) via register, which can tune
> > > +      board-level's parameters of PHY, etc.
> > 
> > I would like second confirmation from DT maintainers, to make sure
> > it's reasonable to model the HW like this.
> 
> If by second confirmation, you mean by someone other than me, obviously
> ignore this, but I think this is "fine". It discussed on a previous
> revision that all is being done with it is setting a handful bits that
> signify that the peripheral has been configured correctly.
> 
> That said, I don't have a clue what's going on with the warning about
> the dwmac device. That's definitely one for Rob.

Apparently it's just as simple as there being more than one definition
of the same property. I had it in my head that that was okay when only
one binding was applied to the node, but clearly not.

I'll have to un-review it until that error is sorted out.


> > In principle the phandle above gets translated into a regmap via a
> > call to syscon_node_to_regmap() in the driver, to allow some registers
> > to be written that are outside the controllers address space.
> > 
> > > +
> > > +  eswin,drive-impedance-ohms:
> > > +    description: Specifies the drive impedance in Ohm.
> > > +    enum: [33, 40, 50, 66, 100]
> > > +
> > >  required:
> > >    - compatible
> > >    - reg
> > > @@ -110,6 +124,37 @@ allOf:
> > >              - const: block
> > >              - const: timer
> > >
> > > +  - if:
> > > +      properties:
> > > +        compatible:
> > > +          contains:
> > > +            const: eswin,eic7700-dwcmshc
> > > +    then:
> > > +      properties:
> > > +        resets:
> > > +          minItems: 4
> > > +          maxItems: 4
> > > +        reset-names:
> > > +          items:
> > > +            - const: axi
> > > +            - const: phy
> > > +            - const: prstn
> > > +            - const: txrx
> > > +      required:
> > > +        - eswin,hsp-sp-csr
> > > +        - eswin,drive-impedance-ohms
> > > +    else:
> > > +      properties:
> > > +        resets:
> > > +          maxItems: 5
> > > +        reset-names:
> > > +          items:
> > > +            - const: core
> > > +            - const: bus
> > > +            - const: axi
> > > +            - const: block
> > > +            - const: timer
> > > +
> > >    - if:
> > >        properties:
> > >          compatible:
> > > --
> > > 2.25.1
> > >
> > 
> > Kind regards
> > Uffe


Re: [PATCH v5 1/2] dt-bindings: mmc: sdhci-of-dwcmshc: Add Eswin EIC7700
Posted by Rob Herring 3 months, 2 weeks ago
On Fri, Oct 24, 2025 at 10:47:34PM +0100, Conor Dooley wrote:
> On Fri, Oct 24, 2025 at 05:37:59PM +0100, Conor Dooley wrote:
> > On Fri, Oct 24, 2025 at 03:57:33PM +0200, Ulf Hansson wrote:
> > > On Sun, 19 Oct 2025 at 13:52, <hehuan1@eswincomputing.com> wrote:
> > > >
> > > > From: Huan He <hehuan1@eswincomputing.com>
> > > >
> > > > EIC7700 use Synopsys dwcmshc IP for SD/eMMC controllers.
> > > > Add Eswin EIC7700 support in sdhci-of-dwcmshc.yaml.
> > > >
> > > > Signed-off-by: Huan He <hehuan1@eswincomputing.com>
> > > > Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
> > > > ---
> > > >  .../bindings/mmc/snps,dwcmshc-sdhci.yaml      | 57 +++++++++++++++++--
> > > >  1 file changed, 51 insertions(+), 6 deletions(-)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
> > > > index f882219a0a26..7e7c55dc2440 100644
> > > > --- a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
> > > > +++ b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
> > > > @@ -30,6 +30,7 @@ properties:
> > > >            - sophgo,sg2002-dwcmshc
> > > >            - sophgo,sg2042-dwcmshc
> > > >            - thead,th1520-dwcmshc
> > > > +          - eswin,eic7700-dwcmshc
> > > >
> > > >    reg:
> > > >      maxItems: 1
> > > > @@ -52,17 +53,30 @@ properties:
> > > >      maxItems: 5
> > > >
> > > >    reset-names:
> > > > -    items:
> > > > -      - const: core
> > > > -      - const: bus
> > > > -      - const: axi
> > > > -      - const: block
> > > > -      - const: timer
> > > > +    maxItems: 5
> > > >
> > > >    rockchip,txclk-tapnum:
> > > >      description: Specify the number of delay for tx sampling.
> > > >      $ref: /schemas/types.yaml#/definitions/uint8
> > > >
> > > > +  eswin,hsp-sp-csr:
> > > > +    $ref: /schemas/types.yaml#/definitions/phandle-array
> > > > +    items:
> > > > +      - items:
> > > > +          - description: Phandle to HSP(High-Speed Peripheral) device
> > > > +          - description: Offset of the stability status register for internal
> > > > +                         clock.
> > > > +          - description: Offset of the stability register for host regulator
> > > > +                         voltage.
> > > > +    description:
> > > > +      HSP CSR is to control and get status of different high-speed peripherals
> > > > +      (such as Ethernet, USB, SATA, etc.) via register, which can tune
> > > > +      board-level's parameters of PHY, etc.
> > > 
> > > I would like second confirmation from DT maintainers, to make sure
> > > it's reasonable to model the HW like this.
> > 
> > If by second confirmation, you mean by someone other than me, obviously
> > ignore this, but I think this is "fine". It discussed on a previous
> > revision that all is being done with it is setting a handful bits that
> > signify that the peripheral has been configured correctly.
> > 
> > That said, I don't have a clue what's going on with the warning about
> > the dwmac device. That's definitely one for Rob.
> 
> Apparently it's just as simple as there being more than one definition
> of the same property. I had it in my head that that was okay when only
> one binding was applied to the node, but clearly not.
> 
> I'll have to un-review it until that error is sorted out.

This binding is fine. The error is in the eswin,eic770-eth.yaml binding:

  eswin,hsp-sp-csr:
    $ref: /schemas/types.yaml#/definitions/phandle-array
    items:
      - description: Phandle to HSP(High-Speed Peripheral) device
      - description: Offset of phy control register for internal
                     or external clock selection
      - description: Offset of AXI clock controller Low-Power request
                     register
      - description: Offset of register controlling TX/RX clock delay
    description: |
      High-Speed Peripheral device needed to configure clock selection,
      clock low-power mode and clock delay.


The issue here is phandle-array is really a matrix and an outer 'items' 
is needed to say there is 1 entry with 4 cells. Like this:

items:
  - items:
      - description: ...
      - description: ...
      - description: ...
      - description: ...

Please send a fix for that.

The tools could handle this case better, so I'll look into a fix for 
them.

Rob
Re: [PATCH v5 1/2] dt-bindings: mmc: sdhci-of-dwcmshc: Add Eswin EIC7700
Posted by Rob Herring (Arm) 3 months, 2 weeks ago
On Sun, 19 Oct 2025 19:52:38 +0800, hehuan1@eswincomputing.com wrote:
> From: Huan He <hehuan1@eswincomputing.com>
> 
> EIC7700 use Synopsys dwcmshc IP for SD/eMMC controllers.
> Add Eswin EIC7700 support in sdhci-of-dwcmshc.yaml.
> 
> Signed-off-by: Huan He <hehuan1@eswincomputing.com>
> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
> ---
>  .../bindings/mmc/snps,dwcmshc-sdhci.yaml      | 57 +++++++++++++++++--
>  1 file changed, 51 insertions(+), 6 deletions(-)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/eswin,eic7700-eth.example.dtb: ethernet@50400000 (eswin,eic7700-qos-eth): eswin,hsp-sp-csr: [[4294967295, 256], [264, 280]] is too short
	from schema $id: http://devicetree.org/schemas/net/eswin,eic7700-eth.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/eswin,eic7700-eth.example.dtb: ethernet@50400000 (eswin,eic7700-qos-eth): Unevaluated properties are not allowed ('eswin,hsp-sp-csr' was unexpected)
	from schema $id: http://devicetree.org/schemas/net/eswin,eic7700-eth.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20251019115238.320-1-hehuan1@eswincomputing.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.