diff mbox series

[2/4] dt-bindings: phy: add imx8 pcie phy driver support

Message ID 1631845863-24249-3-git-send-email-hongxing.zhu@nxp.com
State Superseded
Headers show
Series add the imx8 pcie phy driver support | expand

Commit Message

Richard Zhu Sept. 17, 2021, 2:31 a.m. UTC
Add dt-binding for the standalone i.MX8 PCIe PHY driver.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
 .../bindings/phy/fsl,imx8-pcie-phy.yaml       | 66 +++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/fsl,imx8-pcie-phy.yaml

Comments

Rob Herring (Arm) Sept. 17, 2021, 7:48 p.m. UTC | #1
On Fri, 17 Sep 2021 10:31:01 +0800, Richard Zhu wrote:
> Add dt-binding for the standalone i.MX8 PCIe PHY driver.
> 
> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> ---
>  .../bindings/phy/fsl,imx8-pcie-phy.yaml       | 66 +++++++++++++++++++
>  1 file changed, 66 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/phy/fsl,imx8-pcie-phy.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/phy/fsl,imx8-pcie-phy.yaml: properties:fsl,refclk-pad-mode: 'oneOf' conditional failed, one must be fixed:
	'type' is a required property
		hint: A vendor boolean property can use "type: boolean"
	Additional properties are not allowed ('enum' was unexpected)
		hint: A vendor boolean property can use "type: boolean"
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/phy/fsl,imx8-pcie-phy.yaml: properties:fsl,refclk-pad-mode: 'oneOf' conditional failed, one must be fixed:
		'$ref' is a required property
		'allOf' is a required property
		hint: A vendor property needs a $ref to types.yaml
		from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
	0 is not of type 'string'
		hint: A vendor string property with exact values has an implicit type
	1 is not of type 'string'
		hint: A vendor string property with exact values has an implicit type
	2 is not of type 'string'
		hint: A vendor string property with exact values has an implicit type
	hint: Vendor specific properties must have a type and description unless they have a defined, common suffix.
	from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/phy/fsl,imx8-pcie-phy.yaml: ignoring, error in schema: properties: fsl,refclk-pad-mode
warning: no schema found in file: ./Documentation/devicetree/bindings/phy/fsl,imx8-pcie-phy.yaml
Documentation/devicetree/bindings/phy/fsl,imx8-pcie-phy.example.dt.yaml:0:0: /example-0/pcie-phy@32f00000: failed to match any schema with compatible: ['fsl,imx8mm-pcie-phy']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1529140

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

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.
Richard Zhu Sept. 22, 2021, 8:24 a.m. UTC | #2
> -----Original Message-----
> From: Rob Herring <robh@kernel.org>
> Sent: Saturday, September 18, 2021 3:49 AM
> To: Richard Zhu <hongxing.zhu@nxp.com>
> Cc: dl-linux-imx <linux-imx@nxp.com>; linux-phy@lists.infradead.org;
> l.stach@pengutronix.de; linux-arm-kernel@lists.infradead.org;
> kernel@pengutronix.de; kishon@ti.com; linux-kernel@vger.kernel.org;
> vkoul@kernel.org; shawnguo@kernel.org; devicetree@vger.kernel.org;
> galak@kernel.crashing.org
> Subject: Re: [PATCH 2/4] dt-bindings: phy: add imx8 pcie phy driver support
> 
> On Fri, 17 Sep 2021 10:31:01 +0800, Richard Zhu wrote:
> > Add dt-binding for the standalone i.MX8 PCIe PHY driver.
> >
> > Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> > ---
> >  .../bindings/phy/fsl,imx8-pcie-phy.yaml       | 66 +++++++++++++++++++
> >  1 file changed, 66 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/phy/fsl,imx8-pcie-phy.yaml
> >
> 
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
> 
Thanks for your comments. The errors are fixed by adding "$ref" below.
       Refer include/dt-bindings/phy/phy-imx8-pcie.h for the constants
       to be used.
+    $ref: /schemas/types.yaml#/definitions/uint32
     enum: [ 0, 1, 2 ]

Best Regards
Richard Zhu
> yamllint warnings/errors:
> 
> dtschema/dtc warnings/errors:
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/phy/fsl,i
> mx8-pcie-phy.yaml: properties:fsl,refclk-pad-mode: 'oneOf' conditional failed,
> one must be fixed:
> 	'type' is a required property
> 		hint: A vendor boolean property can use "type: boolean"
> 	Additional properties are not allowed ('enum' was unexpected)
> 		hint: A vendor boolean property can use "type: boolean"
> 	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/ph
> y/fsl,imx8-pcie-phy.yaml: properties:fsl,refclk-pad-mode: 'oneOf' conditional
> failed, one must be fixed:
> 		'$ref' is a required property
> 		'allOf' is a required property
> 		hint: A vendor property needs a $ref to types.yaml
> 		from schema $id:
> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevicetree
> .org%2Fmeta-schemas%2Fvendor-props.yaml%23&amp;data=04%7C01%7Chon
> gxing.zhu%40nxp.com%7Cfacb5eafa5eb4fe72a1908d97a1430c0%7C686ea1d3
> bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637675049421428781%7CUnkno
> wn%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1ha
> WwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=lOkPSEyYhyhHPHQBi916FgdPeqK
> GWi1yCC1KyhlsUCU%3D&amp;reserved=0
> 	0 is not of type 'string'
> 		hint: A vendor string property with exact values has an implicit type
> 	1 is not of type 'string'
> 		hint: A vendor string property with exact values has an implicit type
> 	2 is not of type 'string'
> 		hint: A vendor string property with exact values has an implicit type
> 	hint: Vendor specific properties must have a type and description unless
> they have a defined, common suffix.
> 	from schema $id:
> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevicetree
> .org%2Fmeta-schemas%2Fvendor-props.yaml%23&amp;data=04%7C01%7Chon
> gxing.zhu%40nxp.com%7Cfacb5eafa5eb4fe72a1908d97a1430c0%7C686ea1d3
> bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637675049421428781%7CUnkno
> wn%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1ha
> WwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=lOkPSEyYhyhHPHQBi916FgdPeqK
> GWi1yCC1KyhlsUCU%3D&amp;reserved=0
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/phy/fsl,i
> mx8-pcie-phy.yaml: ignoring, error in schema: properties: fsl,refclk-pad-mode
> warning: no schema found in
> file: ./Documentation/devicetree/bindings/phy/fsl,imx8-pcie-phy.yaml
> Documentation/devicetree/bindings/phy/fsl,imx8-pcie-phy.example.dt.yaml:0:0:
> /example-0/pcie-phy@32f00000: failed to match any schema with compatible:
> ['fsl,imx8mm-pcie-phy']
> 
> doc reference errors (make refcheckdocs):
> 
> See
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwor
> k.ozlabs.org%2Fpatch%2F1529140&amp;data=04%7C01%7Chongxing.zhu%40
> nxp.com%7Cfacb5eafa5eb4fe72a1908d97a1430c0%7C686ea1d3bc2b4c6fa92c
> d99c5c301635%7C0%7C0%7C637675049421428781%7CUnknown%7CTWFpb
> GZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6
> Mn0%3D%7C1000&amp;sdata=qePjUlHV6abE0GeKxqqoddS8%2Bc28wRGOoLB
> NyDPpDc8%3D&amp;reserved=0
> 
> This check can fail if there are any dependencies. The base for a patch series is
> generally the most recent rc1.
> 
> 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.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/phy/fsl,imx8-pcie-phy.yaml b/Documentation/devicetree/bindings/phy/fsl,imx8-pcie-phy.yaml
new file mode 100644
index 000000000000..2a81a17f1779
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/fsl,imx8-pcie-phy.yaml
@@ -0,0 +1,66 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/fsl,imx8-pcie-phy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale i.MX8 SoC series PCIe PHY Device Tree Bindings
+
+maintainers:
+  - Richard Zhu <hongxing.zhu@nxp.com>
+
+properties:
+  "#phy-cells":
+    const: 0
+
+  compatible:
+    enum:
+      - fsl,imx8mm-pcie-phy
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: PHY module clock
+
+  clock-names:
+    items:
+      - const: phy
+
+  fsl,refclk-pad-mode:
+    description:
+      Specifies the mode of the refclk pad used. It can be NO_USED(PHY
+      refclock is derived from SoC internal source), INPUT(PHY refclock
+      is provided externally via the refclk pad) or OUTPUT(PHY refclock
+      is derived from SoC internal source and provided on the refclk pad).
+      Refer include/dt-bindings/phy/phy-imx8-pcie.h for the constants
+      to be used.
+    enum: [ 0, 1, 2 ]
+
+required:
+  - "#phy-cells"
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - fsl,refclk-pad-mode
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx8mm-clock.h>
+
+    pcie_phy: pcie-phy@32f00000 {
+            compatible = "fsl,imx8mm-pcie-phy";
+            reg = <0x32f00000 0x10000>;
+            clocks = <&clk IMX8MM_CLK_PCIE1_PHY>;
+            clock-names = "phy";
+            assigned-clocks = <&clk IMX8MM_CLK_PCIE1_PHY>;
+            assigned-clock-rates = <100000000>;
+            assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_100M>;
+            fsl,refclk-pad-mode = <1>;
+            #phy-cells = <0>;
+    };
+...