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 :)
This commit is contained in:
cinap_lenrek 2014-10-30 20:13:44 +01:00
parent 678db0fbb1
commit 4bfa18a5d1

View file

@ -165,9 +165,7 @@ enable(Uart *uart, int ie)
gpiopulloff(RxPin); gpiopulloff(RxPin);
ap[Enables] |= UartEn; ap[Enables] |= UartEn;
ap[MuIir] = 6; ap[MuIir] = 6;
ap[MuLcr] = Bits8;
ap[MuCntl] = TxEn|RxEn; ap[MuCntl] = TxEn|RxEn;
ap[MuBaud] = 250000000 / (115200 * 8) - 1;
if(ie){ if(ie){
intrenable(IRQaux, interrupt, uart, 0, "uart"); intrenable(IRQaux, interrupt, uart, 0, "uart");
ap[MuIer] = RxIen|TxIen; ap[MuIer] = RxIen|TxIen;
@ -372,12 +370,13 @@ uartconsinit(void)
break; break;
} }
if(!uart->enabled)
(*uart->phys->enable)(uart, 0);
uartctl(uart, "b9600 l8 pn s1"); uartctl(uart, "b9600 l8 pn s1");
if(*cmd != '\0') if(*cmd != '\0')
uartctl(uart, cmd); uartctl(uart, cmd);
if(!uart->enabled)
(*uart->phys->enable)(uart, 0);
consuart = uart; consuart = uart;
uart->console = 1; uart->console = 1;
} }