[v3,1/2] dt-bindings: ptp: Add bindings doc for IDT ClockMatrix based PTP clock
diff mbox series

Message ID 1571687868-22834-1-git-send-email-vincent.cheng.xh@renesas.com
State Changes Requested
Headers show
Series
  • [v3,1/2] dt-bindings: ptp: Add bindings doc for IDT ClockMatrix based PTP clock
Related show

Checks

Context Check Description
robh/dt-meta-schema fail build log
robh/checkpatch success

Commit Message

Vincent Cheng Oct. 21, 2019, 7:57 p.m. UTC
From: Vincent Cheng <vincent.cheng.xh@renesas.com>

Add device tree binding doc for the IDT ClockMatrix PTP clock.

Co-developed-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Vincent Cheng <vincent.cheng.xh@renesas.com>
---

Changes since v2:
 - As suggested by Rob Herring:
   1. Replace with DT schema
   2. Remove '-ptp' from compatible string
   3. Replace wildcard 'x' with the part numbers.

Changes since v1:
 - No changes
---
 .../devicetree/bindings/ptp/ptp-idtcm.yaml         | 63 ++++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ptp/ptp-idtcm.yaml

Comments

Rob Herring Oct. 25, 2019, 7:32 p.m. UTC | #1
On Mon, Oct 21, 2019 at 03:57:47PM -0400, vincent.cheng.xh@renesas.com wrote:
> From: Vincent Cheng <vincent.cheng.xh@renesas.com>
> 
> Add device tree binding doc for the IDT ClockMatrix PTP clock.
> 
> Co-developed-by: Richard Cochran <richardcochran@gmail.com>
> Signed-off-by: Richard Cochran <richardcochran@gmail.com>
> Signed-off-by: Vincent Cheng <vincent.cheng.xh@renesas.com>
> ---
> 
> Changes since v2:
>  - As suggested by Rob Herring:
>    1. Replace with DT schema
>    2. Remove '-ptp' from compatible string
>    3. Replace wildcard 'x' with the part numbers.
> 
> Changes since v1:
>  - No changes
> ---
>  .../devicetree/bindings/ptp/ptp-idtcm.yaml         | 63 ++++++++++++++++++++++
>  1 file changed, 63 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/ptp/ptp-idtcm.yaml
> 
> diff --git a/Documentation/devicetree/bindings/ptp/ptp-idtcm.yaml b/Documentation/devicetree/bindings/ptp/ptp-idtcm.yaml
> new file mode 100644
> index 0000000..d3771e0
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/ptp/ptp-idtcm.yaml
> @@ -0,0 +1,63 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/ptp/ptp-idtcm.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: IDT ClockMatrix (TM) PTP Clock Device Tree Bindings
> +
> +maintainers:
> +  - Vincent Cheng <vincent.cheng.xh@renesas.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      # For System Synchronizer
> +      - idt,8a34000
> +      - idt,8a34001
> +      - idt,8a34002
> +      - idt,8a34003
> +      - idt,8a34004
> +      - idt,8a34005
> +      - idt,8a34006
> +      - idt,8a34007
> +      - idt,8a34008
> +      - idt,8a34009
> +      # For Port Synchronizer
> +      - idt,8a34010
> +      - idt,8a34011
> +      - idt,8a34012
> +      - idt,8a34013
> +      - idt,8a34014
> +      - idt,8a34015
> +      - idt,8a34016
> +      - idt,8a34017
> +      - idt,8a34018
> +      - idt,8a34019
> +      # For Universal Frequency Translator (UFT)
> +      - idt,8a34040
> +      - idt,8a34041
> +      - idt,8a34042
> +      - idt,8a34043
> +      - idt,8a34044
> +      - idt,8a34045
> +      - idt,8a34046
> +      - idt,8a34047
> +      - idt,8a34048
> +      - idt,8a34049
> +
> +  reg:
> +    maxItems: 1
> +    description:
> +      I2C slave address of the device.
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    phc@5b {

ptp@5b

Examples are built now and this fails:

Documentation/devicetree/bindings/ptp/ptp-idtcm.example.dts:19.15-28: 
Warning (reg_format): /example-0/phc@5b:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)

The problem is i2c devices need to be shown under an i2c bus node.

> +          compatible = "idt,8a34000";
> +          reg = <0x5b>;
> +    };
> -- 
> 2.7.4
>
Vincent Cheng Oct. 29, 2019, 3 p.m. UTC | #2
On Fri, Oct 25, 2019 at 03:32:28PM EDT, Rob Herring wrote:
>On Mon, Oct 21, 2019 at 03:57:47PM -0400, vincent.cheng.xh@renesas.com wrote:
>> From: Vincent Cheng <vincent.cheng.xh@renesas.com>
>> 
>> Add device tree binding doc for the IDT ClockMatrix PTP clock.
>> 
>> +
>> +examples:
>> +  - |
>> +    phc@5b {
>
>ptp@5b
>
>Examples are built now and this fails:
>
>Documentation/devicetree/bindings/ptp/ptp-idtcm.example.dts:19.15-28: 
>Warning (reg_format): /example-0/phc@5b:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
>
>The problem is i2c devices need to be shown under an i2c bus node.
>
>> +          compatible = "idt,8a34000";
>> +          reg = <0x5b>;
>> +    };

I am trying to replicate the problem locally to confirm the fix prior to re-submission.

I have tried the following:

./tools/dt-doc-validate ~/projects/linux/Documentation/devicetree/bindings/ptp/ptp-idtcm.yaml
./tools/dt-extract-example ~/projects/linux/Documentation/devicetree/bindings/ptp/ptp-idtcm.yaml > example.dts

How to validate the example.dts file against the schema in ptp-idtcm.yaml?

Thanks in advance.

Regards,
Vincent
Rob Herring Oct. 29, 2019, 9:20 p.m. UTC | #3
On Tue, Oct 29, 2019 at 10:00 AM Vincent Cheng
<vincent.cheng.xh@renesas.com> wrote:
>
> On Fri, Oct 25, 2019 at 03:32:28PM EDT, Rob Herring wrote:
> >On Mon, Oct 21, 2019 at 03:57:47PM -0400, vincent.cheng.xh@renesas.com wrote:
> >> From: Vincent Cheng <vincent.cheng.xh@renesas.com>
> >>
> >> Add device tree binding doc for the IDT ClockMatrix PTP clock.
> >>
> >> +
> >> +examples:
> >> +  - |
> >> +    phc@5b {
> >
> >ptp@5b
> >
> >Examples are built now and this fails:
> >
> >Documentation/devicetree/bindings/ptp/ptp-idtcm.example.dts:19.15-28:
> >Warning (reg_format): /example-0/phc@5b:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
> >
> >The problem is i2c devices need to be shown under an i2c bus node.
> >
> >> +          compatible = "idt,8a34000";
> >> +          reg = <0x5b>;
> >> +    };
>
> I am trying to replicate the problem locally to confirm the fix prior to re-submission.
>
> I have tried the following:
>
> ./tools/dt-doc-validate ~/projects/linux/Documentation/devicetree/bindings/ptp/ptp-idtcm.yaml
> ./tools/dt-extract-example ~/projects/linux/Documentation/devicetree/bindings/ptp/ptp-idtcm.yaml > example.dts
>
> How to validate the example.dts file against the schema in ptp-idtcm.yaml?

'make -k dt_binding_check' in the kernel tree.

Rob
Vincent Cheng Oct. 30, 2019, 2:45 a.m. UTC | #4
On Tue, Oct 29, 2019 at 05:20:03PM EDT, Rob Herring wrote:
>On Tue, Oct 29, 2019 at 10:00 AM Vincent Cheng
><vincent.cheng.xh@renesas.com> wrote:
>>
>> On Fri, Oct 25, 2019 at 03:32:28PM EDT, Rob Herring wrote:
>> >On Mon, Oct 21, 2019 at 03:57:47PM -0400, vincent.cheng.xh@renesas.com wrote:
>> >> From: Vincent Cheng <vincent.cheng.xh@renesas.com>
>> >>
>> >> Add device tree binding doc for the IDT ClockMatrix PTP clock.
>> >>
>> >> +
>> >> +examples:
>> >> +  - |
>> >> +    phc@5b {
>> >
>> >ptp@5b
>> >
>> >Examples are built now and this fails:
>> >
>> >Documentation/devicetree/bindings/ptp/ptp-idtcm.example.dts:19.15-28:
>> >Warning (reg_format): /example-0/phc@5b:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
>> >
>> >The problem is i2c devices need to be shown under an i2c bus node.
>> >
>> >> +          compatible = "idt,8a34000";
>> >> +          reg = <0x5b>;
>> >> +    };
>>
>> I am trying to replicate the problem locally to confirm the fix prior to re-submission.
>>
>> I have tried the following:
>>
>> ./tools/dt-doc-validate ~/projects/linux/Documentation/devicetree/bindings/ptp/ptp-idtcm.yaml
>> ./tools/dt-extract-example ~/projects/linux/Documentation/devicetree/bindings/ptp/ptp-idtcm.yaml > example.dts
>>
>> How to validate the example.dts file against the schema in ptp-idtcm.yaml?
>
>'make -k dt_binding_check' in the kernel tree.

Thanks for the tip - that led me to re-discover write-schema.rst

Did the following to ensure dt-schema and yaml is installed:
$ pip3 install git+https://github.com/devicetree-org/dt-schema.git@master

$ pkg-config --exists yaml-0.1 && echo yes
yes

$ pkg-config yaml-0.1 --libs
-lyaml


However, I get 'No rule to make target" error with 'make -k dt_binding_check'.

On linux: Tue Oct 29, commit 23fdb198ae8

$ make -k dt_binding_check \
    DT_SCHEMA_FILES=Documentation/devicetree/bindings/trivial-devices.yaml
  SCHEMA  Documentation/devicetree/bindings/processed-schema.yaml
  CHKDT   Documentation/devicetree/bindings/trivial-devices.yaml
make[1]: *** No rule to make target
	'Documentation/devicetree/bindings/trivial-devices.example.dt.yaml',
	 needed by '__build'.
								
On linux-next-mirror: Tue Oct 29, commit c57cf3833c6

$ make -k dt_binding_check \
	DT_SCHEMA_FILES=Documentation/devicetree/bindings/trivial-devices.yaml
  SCHEMA  Documentation/devicetree/bindings/processed-schema.yaml
  CHKDT   Documentation/devicetree/bindings/trivial-devices.yaml
make[1]: *** No rule to make target 
	'Documentation/devicetree/bindings/trivial-devices.example.dt.yaml', 
	needed by '__build'.

I will keep googling, but any tips will be greatly appreciated.

Regards,
Vincent
Vincent Cheng Oct. 30, 2019, 2:54 a.m. UTC | #5
On Tue, Oct 29, 2019 at 10:45:52PM EDT, Vincent Cheng wrote:
>On Tue, Oct 29, 2019 at 05:20:03PM EDT, Rob Herring wrote:
>>On Tue, Oct 29, 2019 at 10:00 AM Vincent Cheng
>><vincent.cheng.xh@renesas.com> wrote:
>>>
>>> On Fri, Oct 25, 2019 at 03:32:28PM EDT, Rob Herring wrote:
>>> >On Mon, Oct 21, 2019 at 03:57:47PM -0400, vincent.cheng.xh@renesas.com wrote:
>>> >> From: Vincent Cheng <vincent.cheng.xh@renesas.com>
>>> >>
>>> >> Add device tree binding doc for the IDT ClockMatrix PTP clock.
>>> >>
>>> >> +
>>> >> +examples:
>>> >> +  - |
>>> >> +    phc@5b {
>>> >
>>> >ptp@5b
>>> >
>>> >Examples are built now and this fails:
>>> >
>>> >Documentation/devicetree/bindings/ptp/ptp-idtcm.example.dts:19.15-28:
>>> >Warning (reg_format): /example-0/phc@5b:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
>>> >
>>> >The problem is i2c devices need to be shown under an i2c bus node.
>>> >
>>> >> +          compatible = "idt,8a34000";
>>> >> +          reg = <0x5b>;
>>> >> +    };
>>>
>>> I am trying to replicate the problem locally to confirm the fix prior to re-submission.
>>>
>>> I have tried the following:
>>>
>>> ./tools/dt-doc-validate ~/projects/linux/Documentation/devicetree/bindings/ptp/ptp-idtcm.yaml
>>> ./tools/dt-extract-example ~/projects/linux/Documentation/devicetree/bindings/ptp/ptp-idtcm.yaml > example.dts
>>>
>>> How to validate the example.dts file against the schema in ptp-idtcm.yaml?
>>
>>'make -k dt_binding_check' in the kernel tree.
>
>Thanks for the tip - that led me to re-discover write-schema.rst
>
>Did the following to ensure dt-schema and yaml is installed:
>$ pip3 install git+https://github.com/devicetree-org/dt-schema.git@master
>
>$ pkg-config --exists yaml-0.1 && echo yes
>yes
>
>$ pkg-config yaml-0.1 --libs
>-lyaml
>
>
>However, I get 'No rule to make target" error with 'make -k dt_binding_check'.
>
>On linux: Tue Oct 29, commit 23fdb198ae8
>
>$ make -k dt_binding_check \
>    DT_SCHEMA_FILES=Documentation/devicetree/bindings/trivial-devices.yaml
>  SCHEMA  Documentation/devicetree/bindings/processed-schema.yaml
>  CHKDT   Documentation/devicetree/bindings/trivial-devices.yaml
>make[1]: *** No rule to make target
>	'Documentation/devicetree/bindings/trivial-devices.example.dt.yaml',
>	 needed by '__build'.
>								
>On linux-next-mirror: Tue Oct 29, commit c57cf3833c6
>
>$ make -k dt_binding_check \
>	DT_SCHEMA_FILES=Documentation/devicetree/bindings/trivial-devices.yaml
>  SCHEMA  Documentation/devicetree/bindings/processed-schema.yaml
>  CHKDT   Documentation/devicetree/bindings/trivial-devices.yaml
>make[1]: *** No rule to make target 
>	'Documentation/devicetree/bindings/trivial-devices.example.dt.yaml', 
>	needed by '__build'.
>
>I will keep googling, but any tips will be greatly appreciated.

Please ignore, I figured it out.

'make -k dt_binding check ARCH=arm' works without make errors.

Regards,
Vincent

Patch
diff mbox series

diff --git a/Documentation/devicetree/bindings/ptp/ptp-idtcm.yaml b/Documentation/devicetree/bindings/ptp/ptp-idtcm.yaml
new file mode 100644
index 0000000..d3771e0
--- /dev/null
+++ b/Documentation/devicetree/bindings/ptp/ptp-idtcm.yaml
@@ -0,0 +1,63 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/ptp/ptp-idtcm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: IDT ClockMatrix (TM) PTP Clock Device Tree Bindings
+
+maintainers:
+  - Vincent Cheng <vincent.cheng.xh@renesas.com>
+
+properties:
+  compatible:
+    enum:
+      # For System Synchronizer
+      - idt,8a34000
+      - idt,8a34001
+      - idt,8a34002
+      - idt,8a34003
+      - idt,8a34004
+      - idt,8a34005
+      - idt,8a34006
+      - idt,8a34007
+      - idt,8a34008
+      - idt,8a34009
+      # For Port Synchronizer
+      - idt,8a34010
+      - idt,8a34011
+      - idt,8a34012
+      - idt,8a34013
+      - idt,8a34014
+      - idt,8a34015
+      - idt,8a34016
+      - idt,8a34017
+      - idt,8a34018
+      - idt,8a34019
+      # For Universal Frequency Translator (UFT)
+      - idt,8a34040
+      - idt,8a34041
+      - idt,8a34042
+      - idt,8a34043
+      - idt,8a34044
+      - idt,8a34045
+      - idt,8a34046
+      - idt,8a34047
+      - idt,8a34048
+      - idt,8a34049
+
+  reg:
+    maxItems: 1
+    description:
+      I2C slave address of the device.
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    phc@5b {
+          compatible = "idt,8a34000";
+          reg = <0x5b>;
+    };