linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] soc: samsung: Add USIv2 driver
@ 2021-11-27 22:32 Sam Protsenko
  2021-11-27 22:32 ` [PATCH 1/8] dt-bindings: soc: samsung: Add Exynos USIv2 bindings Sam Protsenko
                   ` (8 more replies)
  0 siblings, 9 replies; 27+ messages in thread
From: Sam Protsenko @ 2021-11-27 22:32 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Mark Brown, Greg Kroah-Hartman
  Cc: Jaewon Kim, Chanho Park, David Virag, Youngmin Nam, devicetree,
	linux-spi, linux-serial, linux-arm-kernel, linux-kernel,
	linux-samsung-soc, linux-i2c

USIv2 IP-core provides selectable serial protocol (UART, SPI or
High-Speed I2C); only one can be chosen at a time. This series
implements USIv2 driver, which allows one to select particular USI
function in device tree, and also performs USI block initialization.

With that driver implemented, it's not needed to do USI initialization
in protocol drivers anymore, so that code is removed from the serial
driver.

Because USI driver is tristate (can be built as a module), serial driver
was reworked so it's possible to use its console part as a module too.
This way we can load serial driver module from user space and still have
serial console functional.

Make it impossible to build UART/SPI/I2C driver as a built-in when USIv2
driver built as a module: USIv2 configuration must be always done before
tinkering with particular protocol it implements.

Design features:
  - "reg" property contains USI registers start address (0xc0 offset);
    it's used in the driver to access USI_CON and USI_OPTION registers.
    This way all USI initialization (reset, HWACG, etc) can be done in
    USIv2 driver separately, rather than duplicating that code over
    UART/SPI/I2C drivers
  - System Register (system controller node) and its SW_CONF register
    offset are provided in "samsung,sysreg" property; it's used to
    select USI function (protocol to be used)
  - USI function is specified in "samsung,mode" property; integer value
    is used to simplify parsing
  - there is "samsung,clkreq-on" bool property, which makes driver
    disable HWACG control (needed for UART to work properly)
  - PCLK and IPCLK clocks are both provided to USI node; apparently both
    need to be enabled to access USI registers
  - protocol nodes are embedded (as a child nodes) in USI node; it
    allows correct init order, and reflects HW properly
  - USIv2 driver is a tristate: can be also useful from Android GKI
    requirements point of view
  - driver functions are implemented with further development in mind:
    we might want to add some SysFS interface later for example, or
    provide some functions to serial drivers with EXPORT_SYMBOL(), etc

Sam Protsenko (8):
  dt-bindings: soc: samsung: Add Exynos USIv2 bindings
  dt-bindings: soc: samsung: Add Exynos USIv2 bindings doc
  soc: samsung: Add USIv2 driver
  tty: serial: samsung: Remove USI initialization
  tty: serial: samsung: Enable console as module
  tty: serial: Make SERIAL_SAMSUNG=y impossible when EXYNOS_USI_V2=m
  i2c: Make I2C_EXYNOS5=y impossible when EXYNOS_USI_V2=m
  spi: Make SPI_S3C64XX=y impossible when EXYNOS_USI_V2=m

 .../bindings/soc/samsung/exynos-usi-v2.yaml   | 124 +++++++++
 drivers/i2c/busses/Kconfig                    |   1 +
 drivers/soc/samsung/Kconfig                   |  14 +
 drivers/soc/samsung/Makefile                  |   2 +
 drivers/soc/samsung/exynos-usi-v2.c           | 242 ++++++++++++++++++
 drivers/spi/Kconfig                           |   1 +
 drivers/tty/serial/Kconfig                    |   3 +-
 drivers/tty/serial/samsung_tty.c              |  57 ++---
 .../dt-bindings/soc/samsung,exynos-usi-v2.h   |  16 ++
 include/linux/serial_s3c.h                    |   9 -
 10 files changed, 425 insertions(+), 44 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/soc/samsung/exynos-usi-v2.yaml
 create mode 100644 drivers/soc/samsung/exynos-usi-v2.c
 create mode 100644 include/dt-bindings/soc/samsung,exynos-usi-v2.h

-- 
2.30.2


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2021-11-30  0:02 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-27 22:32 [PATCH 0/8] soc: samsung: Add USIv2 driver Sam Protsenko
2021-11-27 22:32 ` [PATCH 1/8] dt-bindings: soc: samsung: Add Exynos USIv2 bindings Sam Protsenko
2021-11-27 22:32 ` [PATCH 2/8] dt-bindings: soc: samsung: Add Exynos USIv2 bindings doc Sam Protsenko
2021-11-29  8:33   ` Krzysztof Kozlowski
2021-11-27 22:32 ` [PATCH 3/8] soc: samsung: Add USIv2 driver Sam Protsenko
2021-11-29  8:49   ` Krzysztof Kozlowski
2021-11-27 22:32 ` [PATCH 4/8] tty: serial: samsung: Remove USI initialization Sam Protsenko
2021-11-28 14:28   ` Greg Kroah-Hartman
2021-11-28 16:26     ` Sam Protsenko
2021-11-28 17:03       ` Sam Protsenko
2021-11-27 22:32 ` [PATCH 5/8] tty: serial: samsung: Enable console as module Sam Protsenko
2021-11-29  8:52   ` Krzysztof Kozlowski
2021-11-29 20:18     ` Sam Protsenko
2021-11-29 20:38       ` Sam Protsenko
2021-11-27 22:32 ` [PATCH 6/8] tty: serial: Make SERIAL_SAMSUNG=y impossible when EXYNOS_USI_V2=m Sam Protsenko
2021-11-28 14:27   ` Greg Kroah-Hartman
2021-11-28 23:54     ` Sam Protsenko
2021-11-27 22:32 ` [PATCH 7/8] i2c: Make I2C_EXYNOS5=y " Sam Protsenko
2021-11-29  0:02   ` Sam Protsenko
2021-11-27 22:32 ` [PATCH 8/8] spi: Make SPI_S3C64XX=y " Sam Protsenko
2021-11-29  0:02   ` Sam Protsenko
2021-11-28  3:15 ` [PATCH 0/8] soc: samsung: Add USIv2 driver David Virag
2021-11-29  9:02   ` Krzysztof Kozlowski
2021-11-29 13:56   ` Sam Protsenko
2021-11-29 17:35     ` Krzysztof Kozlowski
2021-11-29 19:19     ` David Virag
2021-11-30  0:01       ` Sam Protsenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).