linux-gbmc: aspeed-g7: Add vuart timeout width control setting
- Add vuart timeout width control setting, allowing user to set VUART
timeout time width control bit in DTS.
Tested:
root@bmc:~# devmem 0x14c30038
0x00000002
Google-Bug-Id: 433426198
Change-Id: Ic1ca6e471ec888967cf4eb0e46798dcd47958748
Signed-off-by: Harvey Wu <harvey.wu@quanta.corp-partner.google.com>
diff --git a/recipes-kernel/linux/files/0031-8250_aspeed-add-vuart-timeout-width-control-setting.patch b/recipes-kernel/linux/files/0031-8250_aspeed-add-vuart-timeout-width-control-setting.patch
new file mode 100644
index 0000000..d3129b1
--- /dev/null
+++ b/recipes-kernel/linux/files/0031-8250_aspeed-add-vuart-timeout-width-control-setting.patch
@@ -0,0 +1,60 @@
+From 2f637a1d2cd27db1e5cf660501c8e975a9cfd23c Mon Sep 17 00:00:00 2001
+From: Harvey Wu <harvey.wu@quanta.corp-partner.google.com>
+Date: Wed, 6 Aug 2025 13:24:51 +0800
+Subject: [PATCH] 8250_aspeed: add vuart timeout width control setting
+
+Test: Ensure register setting correct after set
+ "vuart-timeout-width-control" to dts
+
+Signed-off-by: Harvey Wu <harvey.wu@quanta.corp-partner.google.com>
+---
+ drivers/tty/serial/8250/8250_aspeed.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/drivers/tty/serial/8250/8250_aspeed.c b/drivers/tty/serial/8250/8250_aspeed.c
+index b2c43f3b8..94abc0097 100644
+--- a/drivers/tty/serial/8250/8250_aspeed.c
++++ b/drivers/tty/serial/8250/8250_aspeed.c
+@@ -33,6 +33,8 @@
+ #define VUART_GCRB_HOST_SIRQ_SHIFT 4
+ #define VUART_ADDRL 0x28
+ #define VUART_ADDRH 0x2c
++#define VUART_GCRG 0x38
++#define VUART_GCRG_VUART_TIMEOUT_WIDTH_CONTROL BIT(1)
+
+ #define DMA_TX_BUFSZ PAGE_SIZE
+ #define DMA_RX_BUFSZ (64 * 1024)
+@@ -43,6 +45,7 @@ struct ast8250_vuart {
+ u32 port;
+ u32 sirq;
+ u32 sirq_pol;
++ bool timeout_width_control;
+ };
+
+ struct ast8250_udma {
+@@ -179,6 +182,12 @@ static void ast8250_vuart_init(struct ast8250_data *data)
+ else
+ reg &= ~VUART_GCRA_SIRQ_POLARITY;
+ writeb(reg, data->regs + VUART_GCRA);
++
++ /* VUART timeout width control */
++ reg = readb(data->regs + VUART_GCRG);
++ if (vuart->timeout_width_control)
++ reg |= VUART_GCRG_VUART_TIMEOUT_WIDTH_CONTROL;
++ writeb(reg, data->regs + VUART_GCRG);
+ }
+
+ static void ast8250_vuart_set_host_tx_discard(struct ast8250_data *data, bool discard)
+@@ -419,6 +428,9 @@ static int ast8250_probe(struct platform_device *pdev)
+ return -ENODEV;
+ }
+
++ data->vuart.timeout_width_control = of_property_read_bool(dev->of_node,
++ "vuart-timeout-width-control");
++
+ ast8250_vuart_init(data);
+ ast8250_vuart_set_host_tx_discard(data, true);
+ ast8250_vuart_set_enable(data, true);
+--
+2.34.1
+
diff --git a/recipes-kernel/linux/linux-gbmc_aspeedg7.bb b/recipes-kernel/linux/linux-gbmc_aspeedg7.bb
index 97b5039..8cd60a1 100644
--- a/recipes-kernel/linux/linux-gbmc_aspeedg7.bb
+++ b/recipes-kernel/linux/linux-gbmc_aspeedg7.bb
@@ -78,6 +78,7 @@
SRC_URI:append:aspeed-g7 = " \
file://0027-Add-setting-SGPIO-default-value.patch \
file://0030-data-transfer-to-reserved-memory-for-edaf.patch \
+ file://0031-8250_aspeed-add-vuart-timeout-width-control-setting.patch \
"
KCONFIG_MODE="--allnoconfig"