diff mbox series

[v5,2/4] dt-bindings: aspeed: Add UART routing controller

Message ID 20210916092515.10553-3-chiawei_wang@aspeedtech.com
State New
Headers show
Series arm: aspeed: Add UART routing support | expand

Commit Message

ChiaWei Wang Sept. 16, 2021, 9:25 a.m. UTC
Add dt-bindings for Aspeed UART routing controller.

Signed-off-by: Oskar Senft <osk@google.com>
Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
---
 .../devicetree/bindings/mfd/aspeed-lpc.yaml   |  4 ++
 .../bindings/soc/aspeed/uart-routing.yaml     | 70 +++++++++++++++++++
 2 files changed, 74 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/aspeed/uart-routing.yaml

Comments

Rob Herring Sept. 16, 2021, 8:18 p.m. UTC | #1
On Thu, Sep 16, 2021 at 05:25:13PM +0800, Chia-Wei Wang wrote:
> Add dt-bindings for Aspeed UART routing controller.
> 
> Signed-off-by: Oskar Senft <osk@google.com>
> Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
> ---
>  .../devicetree/bindings/mfd/aspeed-lpc.yaml   |  4 ++
>  .../bindings/soc/aspeed/uart-routing.yaml     | 70 +++++++++++++++++++
>  2 files changed, 74 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/soc/aspeed/uart-routing.yaml
> 
> diff --git a/Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml b/Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml
> index 54f080df5e2f..697331d840a0 100644
> --- a/Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml
> +++ b/Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml
> @@ -142,6 +142,10 @@ patternProperties:
>        - interrupts
>        - snoop-ports
>  
> +  "^uart-routing@[0-9a-f]+$":
> +    $ref: /schemas/soc/aspeed/uart-routing.yaml#
> +    description: The UART routing control under LPC register space
> +
>  required:
>    - compatible
>    - reg
> diff --git a/Documentation/devicetree/bindings/soc/aspeed/uart-routing.yaml b/Documentation/devicetree/bindings/soc/aspeed/uart-routing.yaml
> new file mode 100644
> index 000000000000..534b2a9340ce
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/aspeed/uart-routing.yaml
> @@ -0,0 +1,70 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +# # Copyright (c) 2018 Google LLC
> +# # Copyright (c) 2021 Aspeed Technology Inc.
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/soc/aspeed/uart-routing.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: Aspeed UART Routing Controller
> +
> +maintainers:
> +  - Oskar Senft <osk@google.com>
> +  - Chia-Wei Wang <chiawei_wang@aspeedtech.com>
> +
> +description:
> +  The Aspeed UART routing control allow to dynamically route the inputs for
> +  the built-in UARTS and physical serial I/O ports.
> +
> +  This allows, for example, to connect the output of UART to another UART.
> +  This can be used to enable Host <-> BMC communication via UARTs, e.g. to
> +  allow access to the Host's serial console.
> +
> +  This driver is for the BMC side. The sysfs files allow the BMC userspace
> +  which owns the system configuration policy, to configure how UARTs and
> +  physical serial I/O ports are routed.
> +
> +  Two types of files, uart* and io*, are presented in sysfs. The uart*
> +  configures the input signal of a UART controller whereas io* configures
> +  that of a physical serial port.
> +
> +  When read, each file shows the list of available options with currently
> +  selected option marked by brackets "[]". The list of available options
> +  depends on the selected file.
> +
> +  e.g.
> +  cat /sys/bus/platform/drivers/aspeed-uart-routing/*.uart_routing/uart1
> +  [io1] io2 io3 io4 uart2 uart3 uart4 io6
> +
> +  In this case, UART1 gets its input from IO1 (physical serial port 1).

This is about documenting the hardware, not an OS driver.

sysfs files have their own documentation.

> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - aspeed,ast2400-uart-routing
> +          - aspeed,ast2500-uart-routing
> +          - aspeed,ast2600-uart-routing
> +  reg:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    lpc: lpc@1e789000 {
> +        compatible = "aspeed,ast2600-lpc-v2", "simple-mfd", "syscon";
> +        reg = <0x1e789000 0x1000>;
> +
> +        #address-cells = <1>;
> +        #size-cells = <1>;
> +        ranges = <0x0 0x1e789000 0x1000>;
> +
> +        uart_routing: uart-routing@98 {
> +            compatible = "aspeed,ast2600-uart-routing";
> +            reg = <0x98 0x8>;
> +        };
> +    };
> -- 
> 2.17.1
> 
>
ChiaWei Wang Sept. 17, 2021, 12:46 a.m. UTC | #2
Hi Rob,

> From: Rob Herring <robh@kernel.org>
> Sent: Friday, September 17, 2021 4:19 AM
> 
> On Thu, Sep 16, 2021 at 05:25:13PM +0800, Chia-Wei Wang wrote:
> > Add dt-bindings for Aspeed UART routing controller.
> >
> > Signed-off-by: Oskar Senft <osk@google.com>
> > Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
> > ---
> >  .../devicetree/bindings/mfd/aspeed-lpc.yaml   |  4 ++
> >  .../bindings/soc/aspeed/uart-routing.yaml     | 70
> +++++++++++++++++++
> >  2 files changed, 74 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/soc/aspeed/uart-routing.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml
> > b/Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml
> > index 54f080df5e2f..697331d840a0 100644
> > --- a/Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml
> > +++ b/Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml
> > @@ -142,6 +142,10 @@ patternProperties:
> >        - interrupts
> >        - snoop-ports
> >
> > +  "^uart-routing@[0-9a-f]+$":
> > +    $ref: /schemas/soc/aspeed/uart-routing.yaml#
> > +    description: The UART routing control under LPC register space
> > +
> >  required:
> >    - compatible
> >    - reg
> > diff --git
> > a/Documentation/devicetree/bindings/soc/aspeed/uart-routing.yaml
> > b/Documentation/devicetree/bindings/soc/aspeed/uart-routing.yaml
> > new file mode 100644
> > index 000000000000..534b2a9340ce
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/soc/aspeed/uart-routing.yaml
> > @@ -0,0 +1,70 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) # #
> > +Copyright (c) 2018 Google LLC # # Copyright (c) 2021 Aspeed
> > +Technology Inc.
> > +%YAML 1.2
> > +---
> > +$id: "http://devicetree.org/schemas/soc/aspeed/uart-routing.yaml#"
> > +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> > +
> > +title: Aspeed UART Routing Controller
> > +
> > +maintainers:
> > +  - Oskar Senft <osk@google.com>
> > +  - Chia-Wei Wang <chiawei_wang@aspeedtech.com>
> > +
> > +description:
> > +  The Aspeed UART routing control allow to dynamically route the
> > +inputs for
> > +  the built-in UARTS and physical serial I/O ports.
> > +
> > +  This allows, for example, to connect the output of UART to another UART.
> > +  This can be used to enable Host <-> BMC communication via UARTs,
> > + e.g. to  allow access to the Host's serial console.
> > +
> > +  This driver is for the BMC side. The sysfs files allow the BMC
> > + userspace  which owns the system configuration policy, to configure
> > + how UARTs and  physical serial I/O ports are routed.
> > +
> > +  Two types of files, uart* and io*, are presented in sysfs. The
> > + uart*  configures the input signal of a UART controller whereas io*
> > + configures  that of a physical serial port.
> > +
> > +  When read, each file shows the list of available options with
> > + currently  selected option marked by brackets "[]". The list of
> > + available options  depends on the selected file.
> > +
> > +  e.g.
> > +  cat
> > + /sys/bus/platform/drivers/aspeed-uart-routing/*.uart_routing/uart1
> > +  [io1] io2 io3 io4 uart2 uart3 uart4 io6
> > +
> > +  In this case, UART1 gets its input from IO1 (physical serial port 1).
> 
> This is about documenting the hardware, not an OS driver.
> 
> sysfs files have their own documentation.
> 

Understood. I will remove this sysfs description from bindings in the next revision.
Thanks.

Chiawei
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml b/Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml
index 54f080df5e2f..697331d840a0 100644
--- a/Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml
+++ b/Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml
@@ -142,6 +142,10 @@  patternProperties:
       - interrupts
       - snoop-ports
 
+  "^uart-routing@[0-9a-f]+$":
+    $ref: /schemas/soc/aspeed/uart-routing.yaml#
+    description: The UART routing control under LPC register space
+
 required:
   - compatible
   - reg
diff --git a/Documentation/devicetree/bindings/soc/aspeed/uart-routing.yaml b/Documentation/devicetree/bindings/soc/aspeed/uart-routing.yaml
new file mode 100644
index 000000000000..534b2a9340ce
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/aspeed/uart-routing.yaml
@@ -0,0 +1,70 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# # Copyright (c) 2018 Google LLC
+# # Copyright (c) 2021 Aspeed Technology Inc.
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/soc/aspeed/uart-routing.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Aspeed UART Routing Controller
+
+maintainers:
+  - Oskar Senft <osk@google.com>
+  - Chia-Wei Wang <chiawei_wang@aspeedtech.com>
+
+description:
+  The Aspeed UART routing control allow to dynamically route the inputs for
+  the built-in UARTS and physical serial I/O ports.
+
+  This allows, for example, to connect the output of UART to another UART.
+  This can be used to enable Host <-> BMC communication via UARTs, e.g. to
+  allow access to the Host's serial console.
+
+  This driver is for the BMC side. The sysfs files allow the BMC userspace
+  which owns the system configuration policy, to configure how UARTs and
+  physical serial I/O ports are routed.
+
+  Two types of files, uart* and io*, are presented in sysfs. The uart*
+  configures the input signal of a UART controller whereas io* configures
+  that of a physical serial port.
+
+  When read, each file shows the list of available options with currently
+  selected option marked by brackets "[]". The list of available options
+  depends on the selected file.
+
+  e.g.
+  cat /sys/bus/platform/drivers/aspeed-uart-routing/*.uart_routing/uart1
+  [io1] io2 io3 io4 uart2 uart3 uart4 io6
+
+  In this case, UART1 gets its input from IO1 (physical serial port 1).
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - aspeed,ast2400-uart-routing
+          - aspeed,ast2500-uart-routing
+          - aspeed,ast2600-uart-routing
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+
+additionalProperties: false
+
+examples:
+  - |
+    lpc: lpc@1e789000 {
+        compatible = "aspeed,ast2600-lpc-v2", "simple-mfd", "syscon";
+        reg = <0x1e789000 0x1000>;
+
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0x0 0x1e789000 0x1000>;
+
+        uart_routing: uart-routing@98 {
+            compatible = "aspeed,ast2600-uart-routing";
+            reg = <0x98 0x8>;
+        };
+    };