diff mbox series

[RFC,v1] dt-bindings: mmc: snps,dwcmshc-sdhci: fix rockchip,txclk-tapnum

Message ID 20210430072138.6537-1-jbx6244@gmail.com
State New
Headers show
Series [RFC,v1] dt-bindings: mmc: snps,dwcmshc-sdhci: fix rockchip,txclk-tapnum | expand

Commit Message

Johan Jonker April 30, 2021, 7:21 a.m. UTC
A test with the command below gives this error:
mmc@fe310000: rockchip,txclk-tapnum: missing size tag in [[8]]

With this added to a dts file:
rockchip,txclk-tapnum = <0x8>;

A look at the driver shows that:
DLL_TXCLK_TAPNUM_DEFAULT	0x8

Adding the default value to the dts files is not needed.
Every clock is divided into 32 taps equally and
the max value is 31.

Fix rockchip,txclk-tapnum property in snps,dwcmshc-sdhci.yaml by
adding a minimum, maximum and default.

In the driver the function of_property_read_u8() is used,
but with dtbs_check the notifications only disappear in YAML
by changing uint8 to uint32.
The driver has no limit check for rockchip,txclk-tapnum.

make ARCH=arm64 dtbs_check

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Rob Herring May 3, 2021, 10:40 p.m. UTC | #1
On Fri, Apr 30, 2021 at 2:21 AM Johan Jonker <jbx6244@gmail.com> wrote:
>
> A test with the command below gives this error:
> mmc@fe310000: rockchip,txclk-tapnum: missing size tag in [[8]]
>
> With this added to a dts file:
> rockchip,txclk-tapnum = <0x8>;
>
> A look at the driver shows that:
> DLL_TXCLK_TAPNUM_DEFAULT        0x8
>
> Adding the default value to the dts files is not needed.
> Every clock is divided into 32 taps equally and
> the max value is 31.
>
> Fix rockchip,txclk-tapnum property in snps,dwcmshc-sdhci.yaml by
> adding a minimum, maximum and default.
>
> In the driver the function of_property_read_u8() is used,
> but with dtbs_check the notifications only disappear in YAML
> by changing uint8 to uint32.

Did you check what value the driver sees when you put 8 in the dts. I
expect it will be 0 because you are reading the 1st byte in big
endian.

> The driver has no limit check for rockchip,txclk-tapnum.
>
> make ARCH=arm64 dtbs_check
>
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> ---
>  Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
> index e6c9a2f77..f43d8d829 100644
> --- a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
> +++ b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
> @@ -48,7 +48,10 @@ properties:
>
>    rockchip,txclk-tapnum:
>      description: Specify the number of delay for tx sampling.
> -    $ref: /schemas/types.yaml#/definitions/uint8
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    minimum: 0
> +    maximum: 31
> +    default: 8
>
>
>  required:
> --
> 2.11.0
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
index e6c9a2f77..f43d8d829 100644
--- a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
+++ b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
@@ -48,7 +48,10 @@  properties:
 
   rockchip,txclk-tapnum:
     description: Specify the number of delay for tx sampling.
-    $ref: /schemas/types.yaml#/definitions/uint8
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 31
+    default: 8
 
 
 required: