changelog shortlog tags branches changeset file revisions annotate raw help

Mercurial > hg > plan9front / sys/src/9/bcm/uartmini.c

revision 7153: 7048df8bc401
parent 7152: e93129fc35e7
child 7312: 4dbf2522f668
     1.1--- a/sys/src/9/bcm/uartmini.c
     1.2+++ b/sys/src/9/bcm/uartmini.c
     1.3@@ -47,7 +47,7 @@ extern PhysUart miniphysuart;
     1.4 
     1.5 static Uart miniuart = {
     1.6 	.regs	= (u32int*)AUXREGS,
     1.7-	.name	= "uart0",
     1.8+	.name	= "uart1",
     1.9 	.freq	= 250000000,
    1.10 	.baud	= 115200,
    1.11 	.phys	= &miniphysuart,
    1.12@@ -100,7 +100,7 @@ enable(Uart *uart, int ie)
    1.13 	ap[MuCntl] = TxEn|RxEn;
    1.14 	baud(uart, uart->baud);
    1.15 	if(ie){
    1.16-		intrenable(IRQaux, interrupt, uart, 0, "uart");
    1.17+		intrenable(IRQaux, interrupt, uart, 0, uart->name);
    1.18 		ap[MuIer] = RxIen|TxIen;
    1.19 	}else
    1.20 		ap[MuIer] = 0;
    1.21@@ -259,7 +259,7 @@ donothing(Uart*, int)
    1.22 {
    1.23 }
    1.24 
    1.25-void
    1.26+static void
    1.27 putc(Uart*, int c)
    1.28 {
    1.29 	u32int *ap;
    1.30@@ -272,7 +272,7 @@ putc(Uart*, int c)
    1.31 		;
    1.32 }
    1.33 
    1.34-int
    1.35+static int
    1.36 getc(Uart*)
    1.37 {
    1.38 	u32int *ap;
    1.39@@ -283,38 +283,8 @@ getc(Uart*)
    1.40 	return ap[MuIo] & 0xFF;
    1.41 }
    1.42 
    1.43-void
    1.44-uartconsinit(void)
    1.45-{
    1.46-	Uart *uart;
    1.47-	int n;
    1.48-	char *p, *cmd;
    1.49-
    1.50-	if((p = getconf("console")) == nil)
    1.51-		return;
    1.52-	n = strtoul(p, &cmd, 0);
    1.53-	if(p == cmd)
    1.54-		return;
    1.55-	switch(n){
    1.56-	default:
    1.57-		return;
    1.58-	case 0:
    1.59-		uart = &miniuart;
    1.60-		break;
    1.61-	}
    1.62-
    1.63-	if(!uart->enabled)
    1.64-		(*uart->phys->enable)(uart, 0);
    1.65-	uartctl(uart, "l8 pn s1");
    1.66-	if(*cmd != '\0')
    1.67-		uartctl(uart, cmd);
    1.68-
    1.69-	consuart = uart;
    1.70-	uart->console = 1;
    1.71-}
    1.72-
    1.73 PhysUart miniphysuart = {
    1.74-	.name		= "miniuart",
    1.75+	.name		= "mini",
    1.76 	.pnp		= pnp,
    1.77 	.enable		= enable,
    1.78 	.disable	= disable,