2024-05-06 22:53:38

by Krishna Yarlagadda

[permalink] [raw]
Subject: [RFC PATCH 03/11] soc: tegra: config settings binding document

Config framework parses device tree and provides a list of register
settings with mask per mode to be applied by the controller.

Add binding document for config settings framework. Config settings
are defined as a property per field and have different modes per device.

Signed-off-by: Krishna Yarlagadda <[email protected]>
---
.../misc/nvidia,tegra-config-settings.yaml | 50 +++++++++++++++++++
MAINTAINERS | 1 +
2 files changed, 51 insertions(+)
create mode 100644 Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml

diff --git a/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml b/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml
new file mode 100644
index 000000000000..e379cbd5b597
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/misc/nvidia,tegra-config-settings.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Config properties for a device.
+
+description:
+ Config setting is the configuration based on chip/board/system
+ characterization on interface/controller settings. This is needed for
+ - making the controller internal configuration to better perform
+ - making the interface to work proper by setting drive strength, slew
+ rates etc
+ - making the low power leakage.
+ There are two types of recommended configuration settings
+ - Controller register specific for internal operation of controller.
+ - Pad control/Pinmux/pincontrol registers for interfacing.
+ These configurations can further be categorized as static and dynamic.
+ - Static config does not change until a controller is reset.
+ - Dynamic config changes based on mode or condition, controller is
+ operating in.
+
+maintainers:
+ - Thierry Reding <[email protected]>
+
+patternProperties:
+ "^[a-z0-9_]*$":
+ description:
+ Config name to be applied on controller.
+ type: object
+
+additionalProperties: true
+
+examples:
+ - |
+ config {
+ common {
+ nvidia,i2c-hs-sclk-high-period = <0x03>;
+ nvidia,i2c-hs-sclk-low-period = <0x08>;
+ };
+ fast {
+ nvidia,i2c-clk-divisor-fs-mode = <0x3c>;
+ nvidia,i2c-sclk-high-period = <0x02>;
+ };
+ fastplus {
+ nvidia,i2c-clk-divisor-fs-mode = <0x4f>;
+ nvidia,i2c-sclk-high-period = <0x07>;
+ };
+ };
diff --git a/MAINTAINERS b/MAINTAINERS
index 9eeb749ef234..a8c0cfd1d5a6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -21996,6 +21996,7 @@ M: Thierry Reding <[email protected]>
R: Laxman Dewangan <[email protected]>
R: Krishna Yarlagadda <[email protected]>
S: Supported
+F: Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml
F: Documentation/misc-devices/tegra-cfg.rst
F: drivers/soc/tegra/tegra-cfg.c

--
2.43.2



2024-05-07 06:33:03

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [RFC PATCH 03/11] soc: tegra: config settings binding document

On 07/05/2024 00:51, Krishna Yarlagadda wrote:
> Config framework parses device tree and provides a list of register
> settings with mask per mode to be applied by the controller.
>
> Add binding document for config settings framework. Config settings
> are defined as a property per field and have different modes per device.

Please use subject prefixes matching the subsystem. You can get them for
example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
your patch is touching. For bindings, the preferred subjects are
explained here:
https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters

>
> Signed-off-by: Krishna Yarlagadda <[email protected]>
> ---
> .../misc/nvidia,tegra-config-settings.yaml | 50 +++++++++++++++++++
> MAINTAINERS | 1 +
> 2 files changed, 51 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml
>
> diff --git a/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml b/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml
> new file mode 100644
> index 000000000000..e379cbd5b597
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml
> @@ -0,0 +1,50 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/misc/nvidia,tegra-config-settings.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Config properties for a device.

No full stop, that's a title.

> +
> +description:
> + Config setting is the configuration based on chip/board/system
> + characterization on interface/controller settings. This is needed for
> + - making the controller internal configuration to better perform
> + - making the interface to work proper by setting drive strength, slew
> + rates etc
> + - making the low power leakage.
> + There are two types of recommended configuration settings
> + - Controller register specific for internal operation of controller.
> + - Pad control/Pinmux/pincontrol registers for interfacing.
> + These configurations can further be categorized as static and dynamic.
> + - Static config does not change until a controller is reset.
> + - Dynamic config changes based on mode or condition, controller is
> + operating in.
> +
> +maintainers:
> + - Thierry Reding <[email protected]>
> +
> +patternProperties:
> + "^[a-z0-9_]*$":
> + description:
> + Config name to be applied on controller.
> + type: object

Nope, this means nothing. Sorry, describe hardware, do not create some
fake nodes.

> +
> +additionalProperties: true
> +
> +examples:
> + - |
> + config {

Messed indentation.

> + common {
> + nvidia,i2c-hs-sclk-high-period = <0x03>;
> + nvidia,i2c-hs-sclk-low-period = <0x08>;
> + };


Best regards,
Krzysztof


2024-05-24 08:02:05

by Thierry Reding

[permalink] [raw]
Subject: Re: [RFC PATCH 03/11] soc: tegra: config settings binding document

On Tue May 7, 2024 at 8:32 AM CEST, Krzysztof Kozlowski wrote:
> On 07/05/2024 00:51, Krishna Yarlagadda wrote:
> > Config framework parses device tree and provides a list of register
> > settings with mask per mode to be applied by the controller.
> >
> > Add binding document for config settings framework. Config settings
> > are defined as a property per field and have different modes per device.
>
> Please use subject prefixes matching the subsystem. You can get them for
> example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
> your patch is touching. For bindings, the preferred subjects are
> explained here:
> https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters
>
> >
> > Signed-off-by: Krishna Yarlagadda <[email protected]>
> > ---
> > .../misc/nvidia,tegra-config-settings.yaml | 50 +++++++++++++++++++
> > MAINTAINERS | 1 +
> > 2 files changed, 51 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml b/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml
> > new file mode 100644
> > index 000000000000..e379cbd5b597
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/misc/nvidia,tegra-config-settings.yaml
> > @@ -0,0 +1,50 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/misc/nvidia,tegra-config-settings.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Config properties for a device.
>
> No full stop, that's a title.
>
> > +
> > +description:
> > + Config setting is the configuration based on chip/board/system
> > + characterization on interface/controller settings. This is needed for
> > + - making the controller internal configuration to better perform
> > + - making the interface to work proper by setting drive strength, slew
> > + rates etc
> > + - making the low power leakage.
> > + There are two types of recommended configuration settings
> > + - Controller register specific for internal operation of controller.
> > + - Pad control/Pinmux/pincontrol registers for interfacing.
> > + These configurations can further be categorized as static and dynamic.
> > + - Static config does not change until a controller is reset.
> > + - Dynamic config changes based on mode or condition, controller is
> > + operating in.
> > +
> > +maintainers:
> > + - Thierry Reding <[email protected]>
> > +
> > +patternProperties:
> > + "^[a-z0-9_]*$":
> > + description:
> > + Config name to be applied on controller.
> > + type: object
>
> Nope, this means nothing. Sorry, describe hardware, do not create some
> fake nodes.

We're trying to solve a real problem here, though. In order for the
hardware to operate properly we need certain parameters to be programmed
into the hardware.

If this is not acceptable, do you have a suggestion on where else to put
this information?

Thierry


Attachments:
signature.asc (849.00 B)