This series of patches introduces the GCLK as a potential clock source for the baudrate generator of UART on sama5d2 SoCs. Unlike the serial mode of the USART offered by FLEXCOM, the UART does not provide a fractional part that can be added to the clock divisor to obtain a more accurate result, which greatly decreases the flexibility available for producing a higher variety of baudrates. Now, with the last patch of the series, the driver will check for a GCLK in the DT. If provided, whenever `atmel_set_termios` is called, unless there is a fractional part, the driver will compare the error rate between the desired baudrate and the actual baudrate obtained through each of the available clock sources and will choose the clock source with the lowest error rate. While at it, convert the DT binding for UART/USART to json-schema, update the FLEXCOM binding to reference the new UART/USART binding and differentiate between the SPI of USART and the SPI of FLEXCOM. The first three patches of this patch series depend on this patch series converting atmel-flexcom bindings to json-schema: https://lore.kernel.org/all/20220708115619.254073-1-kavyasree.kotagiri@xxxxxxxxxxxxx/ Sergiu Moga (5): dt-bindings: mfd: atmel,sama5d2-flexcom: Add SPI child node ref binding dt-bindings: mfd: atmel,at91-usart: convert to json-schema dt-bindings: mfd: atmel,sama5d2-flexcom: Add USART child node ref binding clk: at91: sama5d2: Add Generic Clocks for UART/USART tty: serial: atmel: Make the driver aware of the existence of GCLK .../bindings/mfd/atmel,at91-usart.yaml | 190 ++++++++++++++++++ .../bindings/mfd/atmel,sama5d2-flexcom.yaml | 18 +- .../devicetree/bindings/mfd/atmel-usart.txt | 98 --------- drivers/clk/at91/sama5d2.c | 10 + drivers/tty/serial/atmel_serial.c | 52 ++++- drivers/tty/serial/atmel_serial.h | 1 + 6 files changed, 264 insertions(+), 105 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/atmel,at91-usart.yaml delete mode 100644 Documentation/devicetree/bindings/mfd/atmel-usart.txt -- 2.25.1