diff mbox series

[v5,5/9] dt-bindings: fsi: Document the FSI controller common properties

Message ID 20240514195435.155372-6-eajames@linux.ibm.com
State New
Headers show
Series dt-bindings: fsi: Convert to json-schema and add missing engines | expand

Commit Message

Eddie James May 14, 2024, 7:54 p.m. UTC
Since there are multiple FSI controllers documented, the common
properties should be documented separately and then referenced
from the specific controller documentation.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
Changes since v4:
 - Add interrupt controller properties
 - Add clock-frequency property to FSI controller and CFAM
 - Add detail to chip-id property description

 .../bindings/fsi/fsi-controller.yaml          | 66 +++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/fsi/fsi-controller.yaml

Comments

Krzysztof Kozlowski May 15, 2024, 2:18 p.m. UTC | #1
On 14/05/2024 21:54, Eddie James wrote:
> Since there are multiple FSI controllers documented, the common
> properties should be documented separately and then referenced
> from the specific controller documentation.
> 
> Signed-off-by: Eddie James <eajames@linux.ibm.com>
> ---
> Changes since v4:
>  - Add interrupt controller properties
>  - Add clock-frequency property to FSI controller and CFAM
>  - Add detail to chip-id property description
> 
>  .../bindings/fsi/fsi-controller.yaml          | 66 +++++++++++++++++++
>  1 file changed, 66 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/fsi/fsi-controller.yaml
> 
> diff --git a/Documentation/devicetree/bindings/fsi/fsi-controller.yaml b/Documentation/devicetree/bindings/fsi/fsi-controller.yaml
> new file mode 100644
> index 0000000000000..8620e4da6de77
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/fsi/fsi-controller.yaml
> @@ -0,0 +1,66 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/fsi/fsi-controller.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: FSI Controller Common Properties
> +
> +maintainers:
> +  - Eddie James <eajames@linux.ibm.com>
> +
> +description:
> +  FSI (FRU (Field Replaceable Unit) Service Interface) is a two wire bus. The
> +  FSI bus is connected to a CFAM (Common FRU Access Macro) which contains
> +  various engines such as I2C controllers, SPI controllers, etc.
> +
> +properties:
> +  "#address-cells":
> +    const: 2
> +
> +  "#size-cells":
> +    const: 0
> +
> +  '#interrupt-cells':
> +    const: 1
> +
> +  clock-frequency:
> +    minimum: 1
> +    maximum: 200000000

This is a deprecated property in general. Why did it appear? It does not
exist in current bindings and nothing in commit msg suggests changes in
the bindings themselves.

> +
> +  interrupt-controller: true
> +
> +  no-scan-on-init:
> +    $ref: /schemas/types.yaml#/definitions/flag
> +    description:
> +      The FSI controller cannot scan the bus during initialization.
> +
> +patternProperties:
> +  "cfam@[0-9a-f],[0-9a-f]":
> +    type: object
> +    properties:
> +      chip-id:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description:
> +          Processor index, a global unique chip ID which is used to identify
> +          the physical location of the chip in a system specific way.
> +
> +      clock-frequency:
> +        minimum: 1
> +        maximum: 100000000

Same question.


Best regards,
Krzysztof
Eddie James May 15, 2024, 2:28 p.m. UTC | #2
On 5/15/24 09:18, Krzysztof Kozlowski wrote:
> On 14/05/2024 21:54, Eddie James wrote:
>> Since there are multiple FSI controllers documented, the common
>> properties should be documented separately and then referenced
>> from the specific controller documentation.
>>
>> Signed-off-by: Eddie James <eajames@linux.ibm.com>
>> ---
>> Changes since v4:
>>   - Add interrupt controller properties
>>   - Add clock-frequency property to FSI controller and CFAM
>>   - Add detail to chip-id property description
>>
>>   .../bindings/fsi/fsi-controller.yaml          | 66 +++++++++++++++++++
>>   1 file changed, 66 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/fsi/fsi-controller.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/fsi/fsi-controller.yaml b/Documentation/devicetree/bindings/fsi/fsi-controller.yaml
>> new file mode 100644
>> index 0000000000000..8620e4da6de77
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/fsi/fsi-controller.yaml
>> @@ -0,0 +1,66 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/fsi/fsi-controller.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: FSI Controller Common Properties
>> +
>> +maintainers:
>> +  - Eddie James <eajames@linux.ibm.com>
>> +
>> +description:
>> +  FSI (FRU (Field Replaceable Unit) Service Interface) is a two wire bus. The
>> +  FSI bus is connected to a CFAM (Common FRU Access Macro) which contains
>> +  various engines such as I2C controllers, SPI controllers, etc.
>> +
>> +properties:
>> +  "#address-cells":
>> +    const: 2
>> +
>> +  "#size-cells":
>> +    const: 0
>> +
>> +  '#interrupt-cells':
>> +    const: 1
>> +
>> +  clock-frequency:
>> +    minimum: 1
>> +    maximum: 200000000
> This is a deprecated property in general. Why did it appear? It does not
> exist in current bindings and nothing in commit msg suggests changes in
> the bindings themselves.


OK, is there some document that describes what properties are 
deprecated? Because it's used all over the place in the bindings. Anyway 
I need this property, I can rename it if you like. I can also update the 
commit message to indicate that I'm adding it.


Thanks,

Eddie



>
>> +
>> +  interrupt-controller: true
>> +
>> +  no-scan-on-init:
>> +    $ref: /schemas/types.yaml#/definitions/flag
>> +    description:
>> +      The FSI controller cannot scan the bus during initialization.
>> +
>> +patternProperties:
>> +  "cfam@[0-9a-f],[0-9a-f]":
>> +    type: object
>> +    properties:
>> +      chip-id:
>> +        $ref: /schemas/types.yaml#/definitions/uint32
>> +        description:
>> +          Processor index, a global unique chip ID which is used to identify
>> +          the physical location of the chip in a system specific way.
>> +
>> +      clock-frequency:
>> +        minimum: 1
>> +        maximum: 100000000
> Same question.
>
>
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski May 15, 2024, 2:35 p.m. UTC | #3
On 15/05/2024 16:28, Eddie James wrote:
> 
> On 5/15/24 09:18, Krzysztof Kozlowski wrote:
>> On 14/05/2024 21:54, Eddie James wrote:
>>> Since there are multiple FSI controllers documented, the common
>>> properties should be documented separately and then referenced
>>> from the specific controller documentation.
>>>
>>> Signed-off-by: Eddie James <eajames@linux.ibm.com>
>>> ---
>>> Changes since v4:
>>>   - Add interrupt controller properties
>>>   - Add clock-frequency property to FSI controller and CFAM
>>>   - Add detail to chip-id property description
>>>
>>>   .../bindings/fsi/fsi-controller.yaml          | 66 +++++++++++++++++++
>>>   1 file changed, 66 insertions(+)
>>>   create mode 100644 Documentation/devicetree/bindings/fsi/fsi-controller.yaml
>>>
>>> diff --git a/Documentation/devicetree/bindings/fsi/fsi-controller.yaml b/Documentation/devicetree/bindings/fsi/fsi-controller.yaml
>>> new file mode 100644
>>> index 0000000000000..8620e4da6de77
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/fsi/fsi-controller.yaml
>>> @@ -0,0 +1,66 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/fsi/fsi-controller.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: FSI Controller Common Properties
>>> +
>>> +maintainers:
>>> +  - Eddie James <eajames@linux.ibm.com>
>>> +
>>> +description:
>>> +  FSI (FRU (Field Replaceable Unit) Service Interface) is a two wire bus. The
>>> +  FSI bus is connected to a CFAM (Common FRU Access Macro) which contains
>>> +  various engines such as I2C controllers, SPI controllers, etc.
>>> +
>>> +properties:
>>> +  "#address-cells":
>>> +    const: 2
>>> +
>>> +  "#size-cells":
>>> +    const: 0
>>> +
>>> +  '#interrupt-cells':
>>> +    const: 1
>>> +
>>> +  clock-frequency:
>>> +    minimum: 1
>>> +    maximum: 200000000
>> This is a deprecated property in general. Why did it appear? It does not
>> exist in current bindings and nothing in commit msg suggests changes in
>> the bindings themselves.
> 
> 
> OK, is there some document that describes what properties are 
> deprecated? Because it's used all over the place in the bindings. Anyway 

dtschema: dtschema/schemas/clock/clock.yaml

buses anyway should use bus-frequency but it is also legacy one.

> I need this property, I can rename it if you like. I can also update the 

Why do you need it? Why clocks cannot be chosen by drivers and initial
state selected by assigned-clock-rates?


> commit message to indicate that I'm adding it.



Best regards,
Krzysztof
Eddie James May 15, 2024, 3:02 p.m. UTC | #4
On 5/15/24 09:35, Krzysztof Kozlowski wrote:
> On 15/05/2024 16:28, Eddie James wrote:
>> On 5/15/24 09:18, Krzysztof Kozlowski wrote:
>>> On 14/05/2024 21:54, Eddie James wrote:
>>>> Since there are multiple FSI controllers documented, the common
>>>> properties should be documented separately and then referenced
>>>> from the specific controller documentation.
>>>>
>>>> Signed-off-by: Eddie James <eajames@linux.ibm.com>
>>>> ---
>>>> Changes since v4:
>>>>    - Add interrupt controller properties
>>>>    - Add clock-frequency property to FSI controller and CFAM
>>>>    - Add detail to chip-id property description
>>>>
>>>>    .../bindings/fsi/fsi-controller.yaml          | 66 +++++++++++++++++++
>>>>    1 file changed, 66 insertions(+)
>>>>    create mode 100644 Documentation/devicetree/bindings/fsi/fsi-controller.yaml
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/fsi/fsi-controller.yaml b/Documentation/devicetree/bindings/fsi/fsi-controller.yaml
>>>> new file mode 100644
>>>> index 0000000000000..8620e4da6de77
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/fsi/fsi-controller.yaml
>>>> @@ -0,0 +1,66 @@
>>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>>> +%YAML 1.2
>>>> +---
>>>> +$id: http://devicetree.org/schemas/fsi/fsi-controller.yaml#
>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>> +
>>>> +title: FSI Controller Common Properties
>>>> +
>>>> +maintainers:
>>>> +  - Eddie James <eajames@linux.ibm.com>
>>>> +
>>>> +description:
>>>> +  FSI (FRU (Field Replaceable Unit) Service Interface) is a two wire bus. The
>>>> +  FSI bus is connected to a CFAM (Common FRU Access Macro) which contains
>>>> +  various engines such as I2C controllers, SPI controllers, etc.
>>>> +
>>>> +properties:
>>>> +  "#address-cells":
>>>> +    const: 2
>>>> +
>>>> +  "#size-cells":
>>>> +    const: 0
>>>> +
>>>> +  '#interrupt-cells':
>>>> +    const: 1
>>>> +
>>>> +  clock-frequency:
>>>> +    minimum: 1
>>>> +    maximum: 200000000
>>> This is a deprecated property in general. Why did it appear? It does not
>>> exist in current bindings and nothing in commit msg suggests changes in
>>> the bindings themselves.
>>
>> OK, is there some document that describes what properties are
>> deprecated? Because it's used all over the place in the bindings. Anyway
> dtschema: dtschema/schemas/clock/clock.yaml
>
> buses anyway should use bus-frequency but it is also legacy one.
>
>> I need this property, I can rename it if you like. I can also update the
> Why do you need it? Why clocks cannot be chosen by drivers and initial
> state selected by assigned-clock-rates?


Well, I could use assigned-clock-rates, though it seems like I'd then 
have to implement the clock provider framework for both the FSI 
controller driver and the CFAM driver, which is a lot of extra work. FSI 
controller isn't really a clock provider, it's a bus like i2c (which 
uses clock-frequency), so it doesn't quite fit in my opinion...


Thanks for your detailed review Krzysztof,

Eddie


>
>
>> commit message to indicate that I'm adding it.
>
>
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski May 17, 2024, 9:17 a.m. UTC | #5
On 15/05/2024 17:02, Eddie James wrote:
> 
> On 5/15/24 09:35, Krzysztof Kozlowski wrote:
>> On 15/05/2024 16:28, Eddie James wrote:
>>> On 5/15/24 09:18, Krzysztof Kozlowski wrote:
>>>> On 14/05/2024 21:54, Eddie James wrote:
>>>>> Since there are multiple FSI controllers documented, the common
>>>>> properties should be documented separately and then referenced
>>>>> from the specific controller documentation.
>>>>>
>>>>> Signed-off-by: Eddie James <eajames@linux.ibm.com>
>>>>> ---
>>>>> Changes since v4:
>>>>>    - Add interrupt controller properties
>>>>>    - Add clock-frequency property to FSI controller and CFAM
>>>>>    - Add detail to chip-id property description
>>>>>
>>>>>    .../bindings/fsi/fsi-controller.yaml          | 66 +++++++++++++++++++
>>>>>    1 file changed, 66 insertions(+)
>>>>>    create mode 100644 Documentation/devicetree/bindings/fsi/fsi-controller.yaml
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/fsi/fsi-controller.yaml b/Documentation/devicetree/bindings/fsi/fsi-controller.yaml
>>>>> new file mode 100644
>>>>> index 0000000000000..8620e4da6de77
>>>>> --- /dev/null
>>>>> +++ b/Documentation/devicetree/bindings/fsi/fsi-controller.yaml
>>>>> @@ -0,0 +1,66 @@
>>>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>>>> +%YAML 1.2
>>>>> +---
>>>>> +$id: http://devicetree.org/schemas/fsi/fsi-controller.yaml#
>>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>>> +
>>>>> +title: FSI Controller Common Properties
>>>>> +
>>>>> +maintainers:
>>>>> +  - Eddie James <eajames@linux.ibm.com>
>>>>> +
>>>>> +description:
>>>>> +  FSI (FRU (Field Replaceable Unit) Service Interface) is a two wire bus. The
>>>>> +  FSI bus is connected to a CFAM (Common FRU Access Macro) which contains
>>>>> +  various engines such as I2C controllers, SPI controllers, etc.
>>>>> +
>>>>> +properties:
>>>>> +  "#address-cells":
>>>>> +    const: 2
>>>>> +
>>>>> +  "#size-cells":
>>>>> +    const: 0
>>>>> +
>>>>> +  '#interrupt-cells':
>>>>> +    const: 1
>>>>> +
>>>>> +  clock-frequency:
>>>>> +    minimum: 1
>>>>> +    maximum: 200000000
>>>> This is a deprecated property in general. Why did it appear? It does not
>>>> exist in current bindings and nothing in commit msg suggests changes in
>>>> the bindings themselves.
>>>
>>> OK, is there some document that describes what properties are
>>> deprecated? Because it's used all over the place in the bindings. Anyway
>> dtschema: dtschema/schemas/clock/clock.yaml
>>
>> buses anyway should use bus-frequency but it is also legacy one.
>>
>>> I need this property, I can rename it if you like. I can also update the
>> Why do you need it? Why clocks cannot be chosen by drivers and initial
>> state selected by assigned-clock-rates?
> 
> 
> Well, I could use assigned-clock-rates, though it seems like I'd then 
> have to implement the clock provider framework for both the FSI 
> controller driver and the CFAM driver, which is a lot of extra work. FSI 
> controller isn't really a clock provider, it's a bus like i2c (which 
> uses clock-frequency), so it doesn't quite fit in my opinion...

OK, it's fine in such case.

Best regards,
Krzysztof
Rob Herring (Arm) May 22, 2024, 2:39 p.m. UTC | #6
On Wed, May 15, 2024 at 10:02:46AM -0500, Eddie James wrote:
> 
> On 5/15/24 09:35, Krzysztof Kozlowski wrote:
> > On 15/05/2024 16:28, Eddie James wrote:
> > > On 5/15/24 09:18, Krzysztof Kozlowski wrote:
> > > > On 14/05/2024 21:54, Eddie James wrote:
> > > > > Since there are multiple FSI controllers documented, the common
> > > > > properties should be documented separately and then referenced
> > > > > from the specific controller documentation.
> > > > > 
> > > > > Signed-off-by: Eddie James <eajames@linux.ibm.com>
> > > > > ---
> > > > > Changes since v4:
> > > > >    - Add interrupt controller properties
> > > > >    - Add clock-frequency property to FSI controller and CFAM
> > > > >    - Add detail to chip-id property description
> > > > > 
> > > > >    .../bindings/fsi/fsi-controller.yaml          | 66 +++++++++++++++++++
> > > > >    1 file changed, 66 insertions(+)
> > > > >    create mode 100644 Documentation/devicetree/bindings/fsi/fsi-controller.yaml
> > > > > 
> > > > > diff --git a/Documentation/devicetree/bindings/fsi/fsi-controller.yaml b/Documentation/devicetree/bindings/fsi/fsi-controller.yaml
> > > > > new file mode 100644
> > > > > index 0000000000000..8620e4da6de77
> > > > > --- /dev/null
> > > > > +++ b/Documentation/devicetree/bindings/fsi/fsi-controller.yaml
> > > > > @@ -0,0 +1,66 @@
> > > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > > > +%YAML 1.2
> > > > > +---
> > > > > +$id: http://devicetree.org/schemas/fsi/fsi-controller.yaml#
> > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > > +
> > > > > +title: FSI Controller Common Properties
> > > > > +
> > > > > +maintainers:
> > > > > +  - Eddie James <eajames@linux.ibm.com>
> > > > > +
> > > > > +description:
> > > > > +  FSI (FRU (Field Replaceable Unit) Service Interface) is a two wire bus. The
> > > > > +  FSI bus is connected to a CFAM (Common FRU Access Macro) which contains
> > > > > +  various engines such as I2C controllers, SPI controllers, etc.
> > > > > +
> > > > > +properties:
> > > > > +  "#address-cells":
> > > > > +    const: 2
> > > > > +
> > > > > +  "#size-cells":
> > > > > +    const: 0
> > > > > +
> > > > > +  '#interrupt-cells':
> > > > > +    const: 1
> > > > > +
> > > > > +  clock-frequency:
> > > > > +    minimum: 1
> > > > > +    maximum: 200000000
> > > > This is a deprecated property in general. Why did it appear? It does not
> > > > exist in current bindings and nothing in commit msg suggests changes in
> > > > the bindings themselves.
> > > 
> > > OK, is there some document that describes what properties are
> > > deprecated? Because it's used all over the place in the bindings. Anyway
> > dtschema: dtschema/schemas/clock/clock.yaml
> > 
> > buses anyway should use bus-frequency but it is also legacy one.
> > 
> > > I need this property, I can rename it if you like. I can also update the
> > Why do you need it? Why clocks cannot be chosen by drivers and initial
> > state selected by assigned-clock-rates?
> 
> 
> Well, I could use assigned-clock-rates, though it seems like I'd then have
> to implement the clock provider framework for both the FSI controller driver
> and the CFAM driver, which is a lot of extra work. FSI controller isn't
> really a clock provider, it's a bus like i2c (which uses clock-frequency),
> so it doesn't quite fit in my opinion...

'clock-frequency' was used for I2C, but it really should have been 
'bus-frequency' as it is frequency of the bus rather than input 
frequency to the controller. So if this is bus frequency, use 
'bus-frequency'.

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/fsi/fsi-controller.yaml b/Documentation/devicetree/bindings/fsi/fsi-controller.yaml
new file mode 100644
index 0000000000000..8620e4da6de77
--- /dev/null
+++ b/Documentation/devicetree/bindings/fsi/fsi-controller.yaml
@@ -0,0 +1,66 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/fsi/fsi-controller.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: FSI Controller Common Properties
+
+maintainers:
+  - Eddie James <eajames@linux.ibm.com>
+
+description:
+  FSI (FRU (Field Replaceable Unit) Service Interface) is a two wire bus. The
+  FSI bus is connected to a CFAM (Common FRU Access Macro) which contains
+  various engines such as I2C controllers, SPI controllers, etc.
+
+properties:
+  "#address-cells":
+    const: 2
+
+  "#size-cells":
+    const: 0
+
+  '#interrupt-cells':
+    const: 1
+
+  clock-frequency:
+    minimum: 1
+    maximum: 200000000
+
+  interrupt-controller: true
+
+  no-scan-on-init:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      The FSI controller cannot scan the bus during initialization.
+
+patternProperties:
+  "cfam@[0-9a-f],[0-9a-f]":
+    type: object
+    properties:
+      chip-id:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description:
+          Processor index, a global unique chip ID which is used to identify
+          the physical location of the chip in a system specific way.
+
+      clock-frequency:
+        minimum: 1
+        maximum: 100000000
+
+      reg:
+        maxItems: 1
+
+      "#address-cells":
+        const: 1
+
+      "#size-cells":
+        const: 1
+
+    required:
+      - reg
+
+    additionalProperties: true
+
+additionalProperties: true