serial: add new I/O type for SPI and I2C bus devices
Get series with b4
b4 am [email protected] change-id 20260423-tty-upio-c8b66a0a593eVersions newest first · linked by author and title
- v3 Latest10 patches 5 repliesIn review
- v215 patches 15 repliesSuperseded
- v19 patches 8 repliesSuperseded
Changes in v3 from the cover letter
- Rename uart_iotype_legacy_io() -> uart_iotype_io() (Andy)
- Merge patches 15, 4, 5, 6, 7 and 8
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | serial: 8250_hub6: add hub6_match_port()drivers/ drivers/ drivers/ | +15 | 0 replies | |
| 2/10 | serial: core: add uart_iotype_mmio/io helper functionsdrivers/ include/ | +32 | 0 replies | |
| 3/10 | serial: core: use uart_iotype_*() to simplify uart_match_port()drivers/ | +4 | 0 replies | |
| 4/10 | serial: uniformize serial port I/O infos displaydrivers/ drivers/ include/ | +47 | 4 replies | |
| 5/10 | serial: 8250: use uart_iotype_*() to simplify codedrivers/ | +7 | 0 replies | |
| 6/10 | serial: 8250_rsa: use uart_iotype_*() to simplify codedrivers/ | +19 | 0 replies | |
| 7/10 | serial: core: add new I/O type for SPI and I2C bus devicesdrivers/ include/ include/ | +8 | 0 replies | |
| 8/10 | serial: sc16is7xx: use new UPIO_BUS as iotypedrivers/ | +1 | 0 replies | |
| 9/10 | serial: max310x: use new UPIO_BUS as iotypedrivers/ | +1 | 0 replies | |
| 10/10 | serial: max3100: use new UPIO_BUS as iotypedrivers/ | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH v3 00/10] serial: add new I/O type for SPI and I2C bus devices
Hello,
this patch series add a new I/O type for serial devices on a SPI/I2C bus, and a few related cleanups/improvements.
These changes are based on a suggestion [1] made by Ilpo Järvinen during past sc16is7xx driver patches review.
The first patches make use of uart_iotype_*() functions to simplify and cleanup the UART report functions.
This cleanup sets the stage to avoid displaying irrelevant MMIO or legacy I/O information for serial devices on I2C or SPI busses when we add the new UPIO_BUS type.
Tested on a imx6 board with two SC16is752 using SPI mode, and a dummy device-tree entry for a MAX3100:
dmesg -t | grep "base_baud"
2020000.serial: ttymxc0 MMIO:0x02020000 (irq = 197, base_baud = 5000000) is a IMX
21e8000.serial: ttymxc1 MMIO:0x021e8000 (irq = 198, base_baud = 5000000) is a IMX
spi1.0: ttySC0 (irq = 165, base_baud = 1500000) is a SC16IS752
spi1.0: ttySC1 (irq = 165, base_baud = 1500000) is a SC16IS752
spi3.0: ttySC2 (irq = 37, base_baud = 1500000) is a SC16IS752
spi3.0: ttySC3 (irq = 37, base_baud = 1500000) is a SC16IS752
spi3.1: ttyMAX0 (irq = 0, base_baud = 0) is a MAX3100Note that before these patches, max3100 silently failed in uart_configure_port() because membase/iobase/mapbase were zero.
For max310x and SC16is7xx in i2c mode, tested only that driver is properly registered by using i2c-stub.
Also tested on a custom board with a Renesas RZ/G2L cpu (sh-sci driver) to confirm there is no regression (also with earlycon):
dmesg -t | grep "MMIO"
earlycon: scif0 MMIO:0x000000001004b800 (options '115200n8')
1004b800.serial: ttySC0 MMIO:0x000000001004b800 (irq = 35, base_baud = 0) is a scif
1004bc00.serial: ttySC1 MMIO:0x000000001004bc00 (irq = 40, base_baud = 0) is a scifThank you.
[1] https://lore.kernel.org/lkml/[email protected]/raw
Changes for v3:
- Rename uart_iotype_legacy_io() -> uart_iotype_io() (Andy)
- Merge patches 15, 4, 5, 6, 7 and 8
Changes for v2:
- Replace snprintf with scnprintf (Ilpo)
- Fix alignment of : to ? (Ilpo)
- Move hub6 match port to 8250_hub6.c (Ilpo)
- earlycon: use uart_iotype_*()
- 8250_rsa: use uart_iotype_*()
- 8250_port: use uart_iotype_*() in serial_port_out_sync()
- simplified uart_line_info() even more and remove intermediate mmio variable
- Split and rename patch serial: core: prevent irrelevant I/O infos display for UPIO_BUS to serial: core: use uart_iotype_*() to simplify uart_report_port() and moved before UPIO_BUS patch.
- Add a new patch to implement a function to uniformize the display of I/O infos for uart_report_port(), uart_line_info() and earlycon_print_info(). If accepted could be better integrated/merged with the next series submission. If not, can simply be dropped.
- Add patch for uart_regiowidth_to_iotype()
---
Hugo Villeneuve (10):
serial: 8250_hub6: add hub6_match_port()
serial: core: add uart_iotype_mmio/io helper functions
serial: core: use uart_iotype_*() to simplify uart_match_port()
serial: uniformize serial port I/O infos display
serial: 8250: use uart_iotype_*() to simplify code
serial: 8250_rsa: use uart_iotype_*() to simplify code
serial: core: add new I/O type for SPI and I2C bus devices
serial: sc16is7xx: use new UPIO_BUS as iotype
serial: max310x: use new UPIO_BUS as iotype
serial: max3100: use new UPIO_BUS as iotype
drivers/tty/serial/8250/8250.h | 7 ++ drivers/tty/serial/8250/8250_hub6.c | 6 ++ drivers/tty/serial/8250/8250_port.c | 43 ++---------- drivers/tty/serial/8250/8250_rsa.c | 40 +++++------ drivers/tty/serial/earlycon.c | 17 ++--- drivers/tty/serial/max3100.c | 1 + drivers/tty/serial/max310x.c | 9 +-- drivers/tty/serial/sc16is7xx.c | 9 +-- drivers/tty/serial/serial_core.c | 135 +++++++++++++++++++++--------------- include/linux/serial_core.h | 6 ++ include/uapi/linux/serial.h | 1 + 11 files changed, 135 insertions(+), 139 deletions(-)
---
base-commit: 16e95bfb79b5d9d01dc7651d98caf3c2ace331cd
change-id: 20260521-tty-upio-3906a1f84ef5
Best regards,
Signature · 1 line
Hugo Villeneuve <[email protected]>