add Uart2 for serial tablets
This commit is contained in:
parent
62d6def842
commit
863411f3b0
1 changed files with 19 additions and 3 deletions
|
@ -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, },
|
||||
};
|
||||
|
||||
|
@ -702,6 +715,9 @@ i8250console(void)
|
|||
case 1:
|
||||
uart = &i8250uart[1];
|
||||
break;
|
||||
case 2:
|
||||
uart = &i8250uart[2];
|
||||
break;
|
||||
}
|
||||
|
||||
(*uart->phys->enable)(uart, 0);
|
||||
|
|
Loading…
Reference in a new issue