[openwrt/openwrt] airoha: an7581: enable uart baudrate control

LEDE Commits lede-commits at lists.infradead.org
Thu Sep 18 06:28:48 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/440b85f5b1025d26b3a40d6b55b34b17cb6520c8

commit 440b85f5b1025d26b3a40d6b55b34b17cb6520c8
Author: Aleksander Jan Bajkowski <olek2 at wp.pl>
AuthorDate: Sun Sep 14 17:38:24 2025 +0200

    airoha: an7581: enable uart baudrate control
    
    The baud rate control on Airoha does not function properly. This
    patch enables the inactive code responsible for this. The UART2
    baud rate is correct. HSUART3 operates at twice the requested
    baud rate. The same problem exists in the current code, so this
    doesn't introduce any regression. Support for baud rates higher
    than 460800 is still required. This will be added in the future.
    
    Tested on Gemtek W1700k. UART2 and HSUART3 are working fine.
    
    Signed-off-by: Aleksander Jan Bajkowski <olek2 at wp.pl>
    Link: https://github.com/openwrt/openwrt/pull/20049
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/airoha/an7581/config-6.12                |  1 +
 target/linux/airoha/an7581/config-6.6                 |  1 +
 .../patches-6.6/105-uart-add-en7523-support.patch     | 19 +++++++++++++++++++
 3 files changed, 21 insertions(+)

diff --git a/target/linux/airoha/an7581/config-6.12 b/target/linux/airoha/an7581/config-6.12
index 431adea759..95011b1e35 100644
--- a/target/linux/airoha/an7581/config-6.12
+++ b/target/linux/airoha/an7581/config-6.12
@@ -331,6 +331,7 @@ CONFIG_RODATA_FULL_DEFAULT_ENABLED=y
 CONFIG_RPS=y
 CONFIG_RTL8261N_PHY=y
 CONFIG_RWSEM_SPIN_ON_OWNER=y
+CONFIG_SERIAL_8250_AIROHA=y
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_FSL=y
 CONFIG_SERIAL_8250_NR_UARTS=5
diff --git a/target/linux/airoha/an7581/config-6.6 b/target/linux/airoha/an7581/config-6.6
index 600f1e45b4..a079241ad4 100644
--- a/target/linux/airoha/an7581/config-6.6
+++ b/target/linux/airoha/an7581/config-6.6
@@ -310,6 +310,7 @@ CONFIG_RFS_ACCEL=y
 CONFIG_RODATA_FULL_DEFAULT_ENABLED=y
 CONFIG_RPS=y
 CONFIG_RWSEM_SPIN_ON_OWNER=y
+CONFIG_SERIAL_8250_AIROHA=y
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_FSL=y
 CONFIG_SERIAL_8250_NR_UARTS=5
diff --git a/target/linux/airoha/patches-6.6/105-uart-add-en7523-support.patch b/target/linux/airoha/patches-6.6/105-uart-add-en7523-support.patch
index 9ea355370b..39a4944daf 100644
--- a/target/linux/airoha/patches-6.6/105-uart-add-en7523-support.patch
+++ b/target/linux/airoha/patches-6.6/105-uart-add-en7523-support.patch
@@ -135,6 +135,25 @@
  	/*
  	 * LCR DLAB must be set to enable 64-byte FIFO mode. If the FCR
  	 * is written without DLAB set, this mode will be disabled.
+--- a/drivers/tty/serial/8250/Kconfig
++++ b/drivers/tty/serial/8250/Kconfig
+@@ -354,6 +354,16 @@ config SERIAL_8250_ACORN
+ 	  system, say Y to this option.  The driver can handle 1, 2, or 3 port
+ 	  cards.  If unsure, say N.
+ 
++config SERIAL_8250_AIROHA
++	tristate "Airoha UART support"
++	depends on (ARCH_AIROHA || COMPILE_TEST) && OF && SERIAL_8250
++	help
++	  Selecting this option enables an Airoha SoC specific baud rate
++	  calculation routine on an otherwise 16550 compatible UART hardware.
++
++	  If you have an Airoha based board and want to use the serial port,
++	  say Y to this option. If unsure, say N.
++
+ config SERIAL_8250_BCM2835AUX
+ 	tristate "BCM2835 auxiliar mini UART support"
+ 	depends on ARCH_BCM2835 || COMPILE_TEST
 --- a/drivers/tty/serial/8250/Makefile
 +++ b/drivers/tty/serial/8250/Makefile
 @@ -46,6 +46,7 @@ obj-$(CONFIG_SERIAL_8250_PERICOM)	+= 825




More information about the lede-commits mailing list