bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH gnumach] console: Fix baud rate on com ports, use 115200 default


From: Damien Zammit
Subject: [PATCH gnumach] console: Fix baud rate on com ports, use 115200 default baud, 8 data bits
Date: Fri, 19 Jan 2024 03:12:24 +0000

TESTED: By booting gnumach off an HP T620 with console=com0 and receiving 
115200 8N1 console
on another machine connected via the serial port in minicom.
Without this patch, part of the console is garbled by mismatching com params 
(9600 7N1).

---
 i386/i386at/com.c | 27 +++++++--------------------
 i386/i386at/kd.c  |  4 ++--
 xen/console.c     |  4 ++--
 3 files changed, 11 insertions(+), 24 deletions(-)

diff --git a/i386/i386at/com.c b/i386/i386at/com.c
index de21206c..bfc8da4e 100644
--- a/i386/i386at/com.c
+++ b/i386/i386at/com.c
@@ -62,20 +62,15 @@ boolean_t comfifo[NCOM];
 boolean_t comtimer_active;
 int comtimer_state[NCOM];
 
-#define RCBAUD B9600
+#define RCBAUD B115200
 static int rcline = -1;
 static struct bus_device *comcndev;
 
 /* XX */
 extern char *kernel_cmdline;
 
-#ifndef        PORTSELECTOR
-#define ISPEED B9600
-#define IFLAGS (EVENP|ODDP|ECHO|CRMOD)
-#else
-#define ISPEED B4800
-#define IFLAGS (EVENP|ODDP)
-#endif
+#define ISPEED B115200
+#define IFLAGS (EVENP|ODDP|ECHO|CRMOD|XTABS|LITOUT)
 
 u_short divisorreg[] = {
        0,      2304,   1536,   1047,           /*     0,    50,    75,   110*/
@@ -361,18 +356,10 @@ io_return_t comopen(
                tp->t_mctl = commctl;
                tp->t_getstat = comgetstat;
                tp->t_setstat = comsetstat;
-#ifndef        PORTSELECTOR
-               if (tp->t_ispeed == 0) {
-#else
-                       tp->t_state |= TS_HUPCLS;
-#endif /* PORTSELECTOR */
-                       tp->t_ispeed = ISPEED;
-                       tp->t_ospeed = ISPEED;
-                       tp->t_flags = IFLAGS;
-                       tp->t_state &= ~TS_BUSY;
-#ifndef        PORTSELECTOR
-               }
-#endif /* PORTSELECTOR */
+               tp->t_ispeed = ISPEED;
+               tp->t_ospeed = ISPEED;
+               tp->t_flags = IFLAGS;
+               tp->t_state &= ~TS_BUSY;
        }
 /*rvb  tp->t_state |= TS_WOPEN; */
        if ((tp->t_state & TS_ISOPEN) == 0)
diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c
index e9b110bf..984d62e3 100644
--- a/i386/i386at/kd.c
+++ b/i386/i386at/kd.c
@@ -453,8 +453,8 @@ kdopen(
                 */
                tp->t_oproc = kdstart;
                tp->t_stop = kdstop;
-               tp->t_ospeed = tp->t_ispeed = B9600;
-               tp->t_flags = ODDP|EVENP|ECHO|CRMOD|XTABS;
+               tp->t_ospeed = tp->t_ispeed = B115200;
+               tp->t_flags = ODDP|EVENP|ECHO|CRMOD|XTABS|LITOUT;
                kdinit();
        }
        tp->t_state |= TS_CARR_ON;
diff --git a/xen/console.c b/xen/console.c
index e0ec0ca4..9ceb6ddf 100644
--- a/xen/console.c
+++ b/xen/console.c
@@ -191,8 +191,8 @@ int hypcnopen(dev_t dev, int flag, io_req_t ior)
                simple_lock_nocheck(&tp->t_lock.slock);
                tp->t_oproc = hypcnstart;
                tp->t_stop = hypcnstop;
-               tp->t_ospeed = tp->t_ispeed = B9600;
-               tp->t_flags = ODDP|EVENP|ECHO|CRMOD|XTABS;
+               tp->t_ospeed = tp->t_ispeed = B115200;
+               tp->t_flags = ODDP|EVENP|ECHO|CRMOD|XTABS|LITOUT;
        }
        tp->t_state |= TS_CARR_ON;
        simple_unlock_irq(o_pri, &tp->t_lock);
-- 
2.40.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]