diff options
author | stanley lieber <stanley.lieber@gmail.com> | 2011-04-27 14:57:11 +0000 |
---|---|---|
committer | stanley lieber <stanley.lieber@gmail.com> | 2011-04-27 14:57:11 +0000 |
commit | 863411f3b0694ffe4ed4b205588810fd4551639d (patch) | |
tree | 68928911a626c3e54b84da4b0d6d21339e34af31 /sys | |
parent | 62d6def842134468d9c9199e86fe81da6056df76 (diff) |
add Uart2 for serial tablets
Diffstat (limited to 'sys')
-rw-r--r-- | sys/src/9/pc/uarti8250.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/sys/src/9/pc/uarti8250.c b/sys/src/9/pc/uarti8250.c index a3caf7741..f309859d9 100644 --- a/sys/src/9/pc/uarti8250.c +++ b/sys/src/9/pc/uarti8250.c @@ -14,6 +14,8 @@ enum { Uart0IRQ = 4, Uart1 = 0x2F8, /* COM2 */ Uart1IRQ = 3, + Uart2 = 0x200, /* COM3 */ + Uart2IRQ = 5, UartFREQ = 1843200, }; @@ -121,7 +123,7 @@ typedef struct Ctlr { extern PhysUart i8250physuart; -static Ctlr i8250ctlr[2] = { +static Ctlr i8250ctlr[3] = { { .io = Uart0, .irq = Uart0IRQ, .tbdf = BUSUNKNOWN, }, @@ -129,9 +131,13 @@ static Ctlr i8250ctlr[2] = { { .io = Uart1, .irq = Uart1IRQ, .tbdf = BUSUNKNOWN, }, + +{ .io = Uart2, + .irq = Uart2IRQ, + .tbdf = BUSUNKNOWN, }, }; -static Uart i8250uart[2] = { +static Uart i8250uart[3] = { { .regs = &i8250ctlr[0], .name = "COM1", .freq = UartFREQ, @@ -144,6 +150,13 @@ static Uart i8250uart[2] = { .freq = UartFREQ, .phys = &i8250physuart, .special= 0, + .next = &i8250uart[2], }, + +{ .regs = &i8250ctlr[2], + .name = "COM3", + .freq = UartFREQ, + .phys = &i8250physuart, + .special= 0, .next = nil, }, }; @@ -701,7 +714,10 @@ i8250console(void) break; case 1: uart = &i8250uart[1]; - break; + break; + case 2: + uart = &i8250uart[2]; + break; } (*uart->phys->enable)(uart, 0); |