Skip to content

Commit

Permalink
dt-bindings: serial: uartlite: Add properties for synthesis-time para…
Browse files Browse the repository at this point in the history
…meters

The uartlite device is a "soft" device. Many parameters, such as baud
rate, data bits, and the presence of a parity bit are configured before
synthesis and may not be changed (or discovered) at runtime. However, we
must know what these settings are in order to properly calculate the
uart timeout (and to inform the user about the actual baud of the uart).

These properties are present for out-of-tree bindings generated by
Xilinx's tools. However, they are also (mostly) present in in-tree
bindings. I chose current-speed over xlnx,baudrate primarily because it
seemed to be used by more existing bindings. Although these properties
are marked as "required", note that only current-speed is required by
the driver itself. Hopefully, this will allow for an easier transition.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Link: https://lore.kernel.org/r/20210826192154.3202269-3-sean.anderson@seco.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Sean Anderson authored and Greg Kroah-Hartman committed Sep 14, 2021
1 parent f77529d commit 3de536a
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,47 @@ properties:
clock-names:
const: s_axi_aclk

current-speed:
$ref: /schemas/types.yaml#/definitions/uint32
description:
The fixed baud rate that the device was configured for.

xlnx,data-bits:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [5, 6, 7, 8]
description:
The fixed number of data bits that the device was configured for.

xlnx,use-parity:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1]
description:
Whether parity checking was enabled when the device was configured.

xlnx,odd-parity:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1]
description:
Whether odd parity was configured.

required:
- compatible
- reg
- interrupts
- current-speed
- xlnx,data-bits
- xlnx,use-parity

allOf:
- $ref: /schemas/serial.yaml#
- if:
properties:
xlnx,use-parity:
contains:
const: 1
then:
required:
- xlnx,odd-parity

unevaluatedProperties: false

Expand All @@ -49,5 +83,8 @@ examples:
reg = <0x800c0000 0x10000>;
interrupts = <0x0 0x6e 0x1>;
port-number = <0>;
current-speed = <115200>;
xlnx,data-bits = <8>;
xlnx,use-parity = <0>;
};
...

0 comments on commit 3de536a

Please sign in to comment.