summaryrefslogtreecommitdiff
path: root/sys/src/9/pc/uarti8250.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-01-13 10:23:31 +0100
committercinap_lenrek <cinap_lenrek@gmx.de>2013-01-13 10:23:31 +0100
commitaa0627162b3abdf2a9f8dd68e5b845a8461c75a4 (patch)
tree950088e60429b7a6cb75af173be7d6b8c9f60c9a /sys/src/9/pc/uarti8250.c
parent63f1fc07eb77a5443d693b902dd2b74b56f95057 (diff)
remove non standard COM3 (eia2) serial port from i8250 uart.
access to non standard serial port COM3 at i/o port 0x200 causes kernel panic on some machines (Toshiba Sattelite 1415-S115). also, some machines have gameport at 0x200. i readded uartisa to the pcf and pccpuf kernel configurations so one can use plan9.ini to add non standard uarts like: uart2=type=isa port=0x200 irq=5
Diffstat (limited to 'sys/src/9/pc/uarti8250.c')
-rw-r--r--sys/src/9/pc/uarti8250.c58
1 files changed, 4 insertions, 54 deletions
diff --git a/sys/src/9/pc/uarti8250.c b/sys/src/9/pc/uarti8250.c
index aba0be90c..fe14bdf0e 100644
--- a/sys/src/9/pc/uarti8250.c
+++ b/sys/src/9/pc/uarti8250.c
@@ -14,8 +14,6 @@ enum {
Uart0IRQ = 4,
Uart1 = 0x2F8, /* COM2 */
Uart1IRQ = 3,
- Uart2 = 0x200, /* COM3 */
- Uart2IRQ = 5,
UartFREQ = 1843200,
};
@@ -123,7 +121,7 @@ typedef struct Ctlr {
extern PhysUart i8250physuart;
-static Ctlr i8250ctlr[3] = {
+static Ctlr i8250ctlr[2] = {
{ .io = Uart0,
.irq = Uart0IRQ,
.tbdf = BUSUNKNOWN, },
@@ -131,13 +129,9 @@ static Ctlr i8250ctlr[3] = {
{ .io = Uart1,
.irq = Uart1IRQ,
.tbdf = BUSUNKNOWN, },
-
-{ .io = Uart2,
- .irq = Uart2IRQ,
- .tbdf = BUSUNKNOWN, },
};
-static Uart i8250uart[3] = {
+static Uart i8250uart[2] = {
{ .regs = &i8250ctlr[0],
.name = "COM1",
.freq = UartFREQ,
@@ -150,13 +144,6 @@ static Uart i8250uart[3] = {
.freq = UartFREQ,
.phys = &i8250physuart,
.special= 0,
- .next = &i8250uart[2], },
-
-{ .regs = &i8250ctlr[2],
- .name = "COM3",
- .freq = UartFREQ,
- .phys = &i8250physuart,
- .special= 0,
.next = nil, },
};
@@ -704,21 +691,9 @@ i8250console(void)
if((p = getconf("console")) == nil)
return;
n = strtoul(p, &cmd, 0);
- if(p == cmd)
- return;
- switch(n){
- default:
+ if(p == cmd || n < 0 || n >= nelem(i8250uart))
return;
- case 0:
- uart = &i8250uart[0];
- break;
- case 1:
- uart = &i8250uart[1];
- break;
- case 2:
- uart = &i8250uart[2];
- break;
- }
+ uart = &i8250uart[n];
(*uart->phys->enable)(uart, 0);
uartctl(uart, "b9600 l8 pn s1");
@@ -728,28 +703,3 @@ i8250console(void)
consuart = uart;
uart->console = 1;
}
-
-void
-i8250mouse(char* which, int (*putc)(Queue*, int), int setb1200)
-{
- char *p;
- int port;
-
- port = strtol(which, &p, 0);
- if(p == which || port < 0 || port > 1)
- error(Ebadarg);
- uartmouse(&i8250uart[port], putc, setb1200);
-}
-
-void
-i8250setmouseputc(char* which, int (*putc)(Queue*, int))
-{
- char *p;
- int port;
-
- port = strtol(which, &p, 0);
- if(p == which || port < 0 || port > 1)
- error(Ebadarg);
- uartsetmouseputc(&i8250uart[port], putc);
-
-}