From b93bb3dc629d50cd8885b8ee11e379e3b2a3c4b6 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 7 Mar 2023 12:02:26 +0100 Subject: [PATCH] kernel: make tty count for 8250 configurable The number of serial interfaces for the chip 8250 can be configured at build time. This is currently not configurable and is always set to 16 interfaces. This is too little for some small embedded devices and too much for others (x86_64). Therefore, this commit creates the possibility to set this at compile time. Signed-off-by: Florian Eckert Link: https://github.com/openwrt/openwrt/pull/19217 Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/other.mk | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 53b1043a53d..42c7ab06e87 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -566,8 +566,6 @@ define KernelPackage/serial-8250 DEPENDS:=@!TARGET_uml KCONFIG:= CONFIG_SERIAL_8250 \ CONFIG_SERIAL_8250_PCI \ - CONFIG_SERIAL_8250_NR_UARTS=16 \ - CONFIG_SERIAL_8250_RUNTIME_UARTS=16 \ CONFIG_SERIAL_8250_EXTENDED=y \ CONFIG_SERIAL_8250_MANY_PORTS=y \ CONFIG_SERIAL_8250_SHARE_IRQ=y \ @@ -585,6 +583,31 @@ define KernelPackage/serial-8250/description Kernel module for 8250 UART based serial ports endef +define KernelPackage/serial-8250/config +menu "Configuration" + depends on PACKAGE_kmod-serial-8250 + +config KERNEL_SERIAL_8250_NR_UARTS + int "Maximum number of 8250/16550 serial ports" + default "16" + help + Set this to the number of serial ports you want the driver + to support. This includes any ports discovered via ACPI or + PCI enumeration and any ports that may be added at run-time + via hot-plug, or any ISA multi-port serial cards. + +config KERNEL_SERIAL_8250_RUNTIME_UARTS + int "Number of 8250/16550 serial ports to register at runtime" + range 0 KERNEL_SERIAL_8250_NR_UARTS + default "16" + help + Set this to the maximum number of serial ports you want + the kernel to register at boot time. This can be overridden + with the module parameter "nr_uarts", or boot-time parameter + 8250.nr_uarts +endmenu +endef + $(eval $(call KernelPackage,serial-8250))