summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/Kconfig
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2018-03-05 18:17:40 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-23 10:08:18 +0200
commit7678f4c20fa7670fcc23e2537a26543c5c6a7772 (patch)
tree33a235c27d572c9322a353f4cfea9daeb1d9c3e9 /drivers/tty/serial/Kconfig
parent394e835145414f8633303b46fe938e10fda697c4 (diff)
downloadlinux-7678f4c20fa7670fcc23e2537a26543c5c6a7772.tar.bz2
serial: sh-sci: Add support for dynamic instances
On DT platforms, the sh-sci driver requires the presence of "serialN" aliases in DT, from which instance IDs are derived. If a DT alias is missing, the drivers fails to probe the corresponding serial port. This becomes cumbersome when considering DT overlays, as currently there is no upstream support for dynamically updating the /aliases node in DT. Furthermore, even in the presence of such support, hardcoded instance IDs in independent overlays are prone to conflicts. Hence add support for dynamic instance IDs, to be used in the absence of a DT alias. This makes serial ports behave similar to I2C and SPI buses, which already support dynamic instances. Ports in use are tracked using a simple bitmask of type unsigned long, which is sufficient to handle all current hardware (max. 18 ports). The maximum number of serial ports is still fixed, and configurable through Kconfig. Range validation is done through both Kconfig and a compile-time check. Due to the fixed maximum number of serial ports, dynamic and static instances share the same ID space. Static instances added later are rejected when conflicting with dynamic instances registered earlier. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/Kconfig')
-rw-r--r--drivers/tty/serial/Kconfig2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 0f058df0b070..3c5dd209c1d1 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -676,6 +676,8 @@ config SERIAL_SH_SCI
config SERIAL_SH_SCI_NR_UARTS
int "Maximum number of SCI(F) serial ports" if EXPERT
+ range 1 64 if 64BIT
+ range 1 32 if !64BIT
depends on SERIAL_SH_SCI
default "3" if H8300
default "10" if SUPERH