summaryrefslogtreecommitdiff
path: root/sys/src/9/bcm/uartmini.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-10-30 20:13:44 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2014-10-30 20:13:44 +0100
commit4bfa18a5d173dc3b9615153e54b95a6178150a49 (patch)
tree11c74162ac61f67b0b4479c72343a9e292cbd7b6 /sys/src/9/bcm/uartmini.c
parent678db0fbb1c201417047c7f4a33609549ab54ffe (diff)
bcm: fix baudrate setting for serial console (thanks to aap and hiro)
the uartmini enable function used to override the baud register so the effecive baudrate was always set to 115200 baud. now the default baudrate of 9600 is set correctly and can be changed in the console= boot parameter. thanks aap and hiro for debugging, pizza and beer :)
Diffstat (limited to 'sys/src/9/bcm/uartmini.c')
-rw-r--r--sys/src/9/bcm/uartmini.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/src/9/bcm/uartmini.c b/sys/src/9/bcm/uartmini.c
index aa9b87f13..11e542f55 100644
--- a/sys/src/9/bcm/uartmini.c
+++ b/sys/src/9/bcm/uartmini.c
@@ -165,9 +165,7 @@ enable(Uart *uart, int ie)
gpiopulloff(RxPin);
ap[Enables] |= UartEn;
ap[MuIir] = 6;
- ap[MuLcr] = Bits8;
ap[MuCntl] = TxEn|RxEn;
- ap[MuBaud] = 250000000 / (115200 * 8) - 1;
if(ie){
intrenable(IRQaux, interrupt, uart, 0, "uart");
ap[MuIer] = RxIen|TxIen;
@@ -372,12 +370,13 @@ uartconsinit(void)
break;
}
- if(!uart->enabled)
- (*uart->phys->enable)(uart, 0);
uartctl(uart, "b9600 l8 pn s1");
if(*cmd != '\0')
uartctl(uart, cmd);
+ if(!uart->enabled)
+ (*uart->phys->enable)(uart, 0);
+
consuart = uart;
uart->console = 1;
}