changelog shortlog tags branches changeset file revisions annotate raw help

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

revision 7153: 7048df8bc401
parent 7152: e93129fc35e7
child 7339: 199b0742c609
     1.1--- a/sys/src/9/bcm/devarch.c
     1.2+++ b/sys/src/9/bcm/devarch.c
     1.3@@ -174,6 +174,34 @@ archinit(void)
     1.4 }
     1.5 
     1.6 void
     1.7+uartconsinit(void)
     1.8+{
     1.9+	extern PhysUart *physuart[];
    1.10+	char *p, *cmd;
    1.11+	Uart *uart;
    1.12+	int i, n;
    1.13+
    1.14+	if((p = getconf("console")) == nil)
    1.15+		return;
    1.16+	i = strtoul(p, &cmd, 0);
    1.17+	if(p == cmd)
    1.18+		return;
    1.19+	/* we only have two possible uarts, the pl011 and aux */
    1.20+	for(n = 0; physuart[n] != nil; n++)
    1.21+		;
    1.22+	if(i < 0 || i >= n)
    1.23+		return;
    1.24+	uart = physuart[i]->pnp();
    1.25+	if(!uart->enabled)
    1.26+		(*uart->phys->enable)(uart, 0);
    1.27+	uartctl(uart, "l8 pn s1");
    1.28+	if(*cmd != '\0')
    1.29+		uartctl(uart, cmd);
    1.30+	consuart = uart;
    1.31+	uart->console = 1;
    1.32+}
    1.33+
    1.34+void
    1.35 okay(int on)
    1.36 {
    1.37 	static int first;