2024-04-17 14:24:41

by Pratik Farkase

[permalink] [raw]
Subject: [PATCH v2] dt-bindings: serial: brcm,bcm2835-aux-uart: convert to dtschema

Convert the Broadcom BCM2835 Auxiliary UART to newer DT schema.
Created DT schema based on the .txt file which had
`compatible`, `reg` `clocks` and `interrupts` as the
required properties. This binding is used by Broadcom BCM2835
SOC used in some Raspberry PI boards.
Changes from original file:
Implemented complete example which the original txt binding lacked.

Signed-off-by: Pratik Farkase <[email protected]>
---
Changes in v2
- Updated Maintainers list according to feedback
- Fixed typo `Auxiliar` to `Auxiliary`
---
---
.../bindings/serial/brcm,bcm2835-aux-uart.txt | 18 -------
.../serial/brcm,bcm2835-aux-uart.yaml | 48 +++++++++++++++++++
2 files changed, 48 insertions(+), 18 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt
create mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.yaml

diff --git a/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt b/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt
deleted file mode 100644
index b5cc6297cd1b..000000000000
--- a/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-* BCM2835 AUXILIAR UART
-
-Required properties:
-
-- compatible: "brcm,bcm2835-aux-uart"
-- reg: The base address of the UART register bank.
-- interrupts: A single interrupt specifier.
-- clocks: Clock driving the hardware; used to figure out the baud rate
- divisor.
-
-Example:
-
- uart1: serial@7e215040 {
- compatible = "brcm,bcm2835-aux-uart";
- reg = <0x7e215040 0x40>;
- interrupts = <1 29>;
- clocks = <&aux BCM2835_AUX_CLOCK_UART>;
- };
diff --git a/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.yaml b/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.yaml
new file mode 100644
index 000000000000..5d4d37371d6b
--- /dev/null
+++ b/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.yaml
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/serial/brcm,bcm2835-aux-uart.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: BCM2835 AUXILIARY UART
+
+maintainers:
+ - Pratik Farkase <[email protected]>
+ - Florian Fainelli <[email protected]>
+ - Stefan Wahren <[email protected]>
+
+allOf:
+ - $ref: serial.yaml
+
+properties:
+ compatible:
+ const: brcm,bcm2835-aux-uart
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/bcm2835.h>
+ #include <dt-bindings/clock/bcm2835-aux.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+ uart1: serial@7e215040 {
+ compatible = "brcm,bcm2835-aux-uart";
+ reg = <0x7e215040 0x40>;
+ interrupts = <1 29>;
+ clocks = <&aux BCM2835_AUX_CLOCK_UART>;
+ };
--
2.34.1



2024-04-17 15:03:28

by Conor Dooley

[permalink] [raw]
Subject: Re: [PATCH v2] dt-bindings: serial: brcm,bcm2835-aux-uart: convert to dtschema

On Wed, Apr 17, 2024 at 03:51:10PM +0200, Pratik Farkase wrote:
> Convert the Broadcom BCM2835 Auxiliary UART to newer DT schema.
> Created DT schema based on the .txt file which had
> `compatible`, `reg` `clocks` and `interrupts` as the
> required properties. This binding is used by Broadcom BCM2835
> SOC used in some Raspberry PI boards.
> Changes from original file:
> Implemented complete example which the original txt binding lacked.
>
> Signed-off-by: Pratik Farkase <[email protected]>
> ---
> Changes in v2
> - Updated Maintainers list according to feedback
> - Fixed typo `Auxiliar` to `Auxiliary`
> ---
> ---
> .../bindings/serial/brcm,bcm2835-aux-uart.txt | 18 -------
> .../serial/brcm,bcm2835-aux-uart.yaml | 48 +++++++++++++++++++
> 2 files changed, 48 insertions(+), 18 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt
> create mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.yaml
>
> diff --git a/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt b/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt
> deleted file mode 100644
> index b5cc6297cd1b..000000000000
> --- a/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -* BCM2835 AUXILIAR UART
> -
> -Required properties:
> -
> -- compatible: "brcm,bcm2835-aux-uart"
> -- reg: The base address of the UART register bank.
> -- interrupts: A single interrupt specifier.
> -- clocks: Clock driving the hardware; used to figure out the baud rate
> - divisor.
> -
> -Example:
> -
> - uart1: serial@7e215040 {
> - compatible = "brcm,bcm2835-aux-uart";
> - reg = <0x7e215040 0x40>;
> - interrupts = <1 29>;
> - clocks = <&aux BCM2835_AUX_CLOCK_UART>;
> - };
> diff --git a/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.yaml b/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.yaml
> new file mode 100644
> index 000000000000..5d4d37371d6b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.yaml
> @@ -0,0 +1,48 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/serial/brcm,bcm2835-aux-uart.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: BCM2835 AUXILIARY UART
> +
> +maintainers:
> + - Pratik Farkase <[email protected]>
> + - Florian Fainelli <[email protected]>
> + - Stefan Wahren <[email protected]>
> +
> +allOf:
> + - $ref: serial.yaml
> +
> +properties:
> + compatible:
> + const: brcm,bcm2835-aux-uart
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 1
> +
> + clocks:
> + maxItems: 1
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - clocks
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/bcm2835.h>
> + #include <dt-bindings/clock/bcm2835-aux.h>
> + #include <dt-bindings/interrupt-controller/irq.h>

Only 1 of these headers seems used, there's only one define below.

> + uart1: serial@7e215040 {

The label is unused and can be dropped.

Otherwise,
Reviewed-by: Conor Dooley <[email protected]>


> + compatible = "brcm,bcm2835-aux-uart";
> + reg = <0x7e215040 0x40>;
> + interrupts = <1 29>;
> + clocks = <&aux BCM2835_AUX_CLOCK_UART>;
> + };
> --
> 2.34.1
>


Attachments:
(No filename) (3.50 kB)
signature.asc (235.00 B)
Download all attachments

2024-04-17 15:20:01

by Pratik Farkase

[permalink] [raw]
Subject: Re: [PATCH v2] dt-bindings: serial: brcm,bcm2835-aux-uart: convert to dtschema

On Wed, Apr 17, 2024 at 4:54 PM Conor Dooley <[email protected]> wrote:
>
> On Wed, Apr 17, 2024 at 03:51:10PM +0200, Pratik Farkase wrote:
> > Convert the Broadcom BCM2835 Auxiliary UART to newer DT schema.
> > Created DT schema based on the .txt file which had
> > `compatible`, `reg` `clocks` and `interrupts` as the
> > required properties. This binding is used by Broadcom BCM2835
> > SOC used in some Raspberry PI boards.
> > Changes from original file:
> > Implemented complete example which the original txt binding lacked.
> >
> > Signed-off-by: Pratik Farkase <[email protected]>
> > ---
> > Changes in v2
> > - Updated Maintainers list according to feedback
> > - Fixed typo `Auxiliar` to `Auxiliary`
> > ---
> > ---
> > .../bindings/serial/brcm,bcm2835-aux-uart.txt | 18 -------
> > .../serial/brcm,bcm2835-aux-uart.yaml | 48 +++++++++++++++++++
> > 2 files changed, 48 insertions(+), 18 deletions(-)
> > delete mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt
> > create mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt b/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt
> > deleted file mode 100644
> > index b5cc6297cd1b..000000000000
> > --- a/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt
> > +++ /dev/null
> > @@ -1,18 +0,0 @@
> > -* BCM2835 AUXILIAR UART
> > -
> > -Required properties:
> > -
> > -- compatible: "brcm,bcm2835-aux-uart"
> > -- reg: The base address of the UART register bank.
> > -- interrupts: A single interrupt specifier.
> > -- clocks: Clock driving the hardware; used to figure out the baud rate
> > - divisor.
> > -
> > -Example:
> > -
> > - uart1: serial@7e215040 {
> > - compatible = "brcm,bcm2835-aux-uart";
> > - reg = <0x7e215040 0x40>;
> > - interrupts = <1 29>;
> > - clocks = <&aux BCM2835_AUX_CLOCK_UART>;
> > - };
> > diff --git a/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.yaml b/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.yaml
> > new file mode 100644
> > index 000000000000..5d4d37371d6b
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.yaml
> > @@ -0,0 +1,48 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/serial/brcm,bcm2835-aux-uart.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: BCM2835 AUXILIARY UART
> > +
> > +maintainers:
> > + - Pratik Farkase <[email protected]>
> > + - Florian Fainelli <[email protected]>
> > + - Stefan Wahren <[email protected]>
> > +
> > +allOf:
> > + - $ref: serial.yaml
> > +
> > +properties:
> > + compatible:
> > + const: brcm,bcm2835-aux-uart
> > +
> > + reg:
> > + maxItems: 1
> > +
> > + interrupts:
> > + maxItems: 1
> > +
> > + clocks:
> > + maxItems: 1
> > +
> > +required:
> > + - compatible
> > + - reg
> > + - interrupts
> > + - clocks
> > +
> > +unevaluatedProperties: false
> > +
> > +examples:
> > + - |
> > + #include <dt-bindings/clock/bcm2835.h>
> > + #include <dt-bindings/clock/bcm2835-aux.h>
> > + #include <dt-bindings/interrupt-controller/irq.h>
>
> Only 1 of these headers seems used, there's only one define below.
>
> > + uart1: serial@7e215040 {
>
> The label is unused and can be dropped.
I did not understand this part. What do you suggest i change it into?
I took the example from original dtsi file:
arch/arm/boot/dts/broadcom/bcm283x.dtsi
>
> Otherwise,
> Reviewed-by: Conor Dooley <[email protected]>
>
>
> > + compatible = "brcm,bcm2835-aux-uart";
> > + reg = <0x7e215040 0x40>;
> > + interrupts = <1 29>;
> > + clocks = <&aux BCM2835_AUX_CLOCK_UART>;
> > + };
> > --
> > 2.34.1
> >



--
Best Regards
Pratik Farkase
Be Passionate Be Smart

2024-04-17 15:30:50

by Conor Dooley

[permalink] [raw]
Subject: Re: [PATCH v2] dt-bindings: serial: brcm,bcm2835-aux-uart: convert to dtschema

On Wed, Apr 17, 2024 at 05:19:18PM +0200, Pratik Farkase wrote:
> On Wed, Apr 17, 2024 at 4:54 PM Conor Dooley <[email protected]> wrote:
> >
> > On Wed, Apr 17, 2024 at 03:51:10PM +0200, Pratik Farkase wrote:
> > > Convert the Broadcom BCM2835 Auxiliary UART to newer DT schema.
> > > Created DT schema based on the .txt file which had
> > > `compatible`, `reg` `clocks` and `interrupts` as the
> > > required properties. This binding is used by Broadcom BCM2835
> > > SOC used in some Raspberry PI boards.
> > > Changes from original file:
> > > Implemented complete example which the original txt binding lacked.
> > >
> > > Signed-off-by: Pratik Farkase <[email protected]>
> > > ---
> > > Changes in v2
> > > - Updated Maintainers list according to feedback
> > > - Fixed typo `Auxiliar` to `Auxiliary`
> > > ---
> > > ---
> > > .../bindings/serial/brcm,bcm2835-aux-uart.txt | 18 -------
> > > .../serial/brcm,bcm2835-aux-uart.yaml | 48 +++++++++++++++++++
> > > 2 files changed, 48 insertions(+), 18 deletions(-)
> > > delete mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt
> > > create mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.yaml
> > >
> > > diff --git a/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt b/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt
> > > deleted file mode 100644
> > > index b5cc6297cd1b..000000000000
> > > --- a/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt
> > > +++ /dev/null
> > > @@ -1,18 +0,0 @@
> > > -* BCM2835 AUXILIAR UART
> > > -
> > > -Required properties:
> > > -
> > > -- compatible: "brcm,bcm2835-aux-uart"
> > > -- reg: The base address of the UART register bank.
> > > -- interrupts: A single interrupt specifier.
> > > -- clocks: Clock driving the hardware; used to figure out the baud rate
> > > - divisor.
> > > -
> > > -Example:
> > > -
> > > - uart1: serial@7e215040 {
> > > - compatible = "brcm,bcm2835-aux-uart";
> > > - reg = <0x7e215040 0x40>;
> > > - interrupts = <1 29>;
> > > - clocks = <&aux BCM2835_AUX_CLOCK_UART>;
> > > - };
> > > diff --git a/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.yaml b/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.yaml
> > > new file mode 100644
> > > index 000000000000..5d4d37371d6b
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.yaml
> > > @@ -0,0 +1,48 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/serial/brcm,bcm2835-aux-uart.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: BCM2835 AUXILIARY UART
> > > +
> > > +maintainers:
> > > + - Pratik Farkase <[email protected]>
> > > + - Florian Fainelli <[email protected]>
> > > + - Stefan Wahren <[email protected]>
> > > +
> > > +allOf:
> > > + - $ref: serial.yaml
> > > +
> > > +properties:
> > > + compatible:
> > > + const: brcm,bcm2835-aux-uart
> > > +
> > > + reg:
> > > + maxItems: 1
> > > +
> > > + interrupts:
> > > + maxItems: 1
> > > +
> > > + clocks:
> > > + maxItems: 1
> > > +
> > > +required:
> > > + - compatible
> > > + - reg
> > > + - interrupts
> > > + - clocks
> > > +
> > > +unevaluatedProperties: false
> > > +
> > > +examples:
> > > + - |
> > > + #include <dt-bindings/clock/bcm2835.h>
> > > + #include <dt-bindings/clock/bcm2835-aux.h>
> > > + #include <dt-bindings/interrupt-controller/irq.h>
> >
> > Only 1 of these headers seems used, there's only one define below.
> >
> > > + uart1: serial@7e215040 {
> >
> > The label is unused and can be dropped.
> I did not understand this part. What do you suggest i change it into?
> I took the example from original dtsi file:
> arch/arm/boot/dts/broadcom/bcm283x.dtsi

s/uart1: //
The "uart1" part is a label. The dtsi needs it so that the &uart1 syntax
can be used from a dts file to set properties etc, but that's no
required in bindings where there are no references to the node, so we
remove them.

Hope that helps,
Conor.

> >
> > Otherwise,
> > Reviewed-by: Conor Dooley <[email protected]>


Attachments:
(No filename) (4.31 kB)
signature.asc (235.00 B)
Download all attachments