mbox series

[0/5] tty: serial: uartlite: Disable changing fixed parameters

Message ID 20210723223152.648326-1-sean.anderson@seco.com
Headers show
Series tty: serial: uartlite: Disable changing fixed parameters | expand

Message

Sean Anderson July 23, 2021, 10:31 p.m. UTC
The uartlite device is a "soft" device and certain parameters (such as
data bits, parity, and baud) are configured at synthesis time, and
cannot be discovered at runtime. Fortunately, bindings for this device
typically include some of these parameters (especially baud rate).
Instead of silently letting Linux's termios drift away from what the
hardware is actually doing, make the termios reflect the hardware, and
prevent them from being changed. With this series applied, the user
recieves an error message the first time they try and change these
termios:

    # stty parity
    [    7.221696] uartlite 84000000.serial: only 'n' parity supported
    [    7.222139] uartlite 84000000.serial: only 8 data bits supported
    stty: standard input: cannot perform all requested operations

In addition, the configured baud/parity/bits/etc. are exposed through
the standard termios ioctls, instead of using the default termios for
unconfigured ttys.


Sean Anderson (5):
  dt-bindings: serial: uartlite: Convert to json-schema
  dt-bindings: serial: uartlite: Add properties for synthesis-time
    parameters
  sh: j2: Update uartlite binding with data and parity properties
  tty: serial: uartlite: Initialize termios with fixed synthesis
    parameters
  tty: serial: uartlite: Prevent changing fixed parameters

 .../bindings/serial/xlnx,opb-uartlite.txt     |  23 ----
 .../bindings/serial/xlnx,opb-uartlite.yaml    |  92 ++++++++++++++
 arch/sh/boot/dts/j2_mimas_v2.dts              |   2 +
 drivers/tty/serial/uartlite.c                 | 118 ++++++++++++++++--
 4 files changed, 203 insertions(+), 32 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.txt
 create mode 100644 Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml

Comments

Michal Simek July 26, 2021, 2:19 p.m. UTC | #1
+Shubhrajyoti

On 7/24/21 12:31 AM, Sean Anderson wrote:
> The uartlite device is a "soft" device and certain parameters (such as
> data bits, parity, and baud) are configured at synthesis time, and
> cannot be discovered at runtime. Fortunately, bindings for this device
> typically include some of these parameters (especially baud rate).
> Instead of silently letting Linux's termios drift away from what the
> hardware is actually doing, make the termios reflect the hardware, and
> prevent them from being changed. With this series applied, the user
> recieves an error message the first time they try and change these
> termios:
> 
>     # stty parity
>     [    7.221696] uartlite 84000000.serial: only 'n' parity supported
>     [    7.222139] uartlite 84000000.serial: only 8 data bits supported
>     stty: standard input: cannot perform all requested operations
> 
> In addition, the configured baud/parity/bits/etc. are exposed through
> the standard termios ioctls, instead of using the default termios for
> unconfigured ttys.
> 
> 
> Sean Anderson (5):
>   dt-bindings: serial: uartlite: Convert to json-schema
>   dt-bindings: serial: uartlite: Add properties for synthesis-time
>     parameters
>   sh: j2: Update uartlite binding with data and parity properties
>   tty: serial: uartlite: Initialize termios with fixed synthesis
>     parameters
>   tty: serial: uartlite: Prevent changing fixed parameters
> 
>  .../bindings/serial/xlnx,opb-uartlite.txt     |  23 ----
>  .../bindings/serial/xlnx,opb-uartlite.yaml    |  92 ++++++++++++++
>  arch/sh/boot/dts/j2_mimas_v2.dts              |   2 +
>  drivers/tty/serial/uartlite.c                 | 118 ++++++++++++++++--
>  4 files changed, 203 insertions(+), 32 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.txt
>  create mode 100644 Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml
>