|
@@ -95,7 +95,7 @@ static int pl01x_generic_serial_init(struct pl01x_regs *regs,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static int set_line_control(struct pl01x_regs *regs)
|
|
|
|
|
|
+static int pl011_set_line_control(struct pl01x_regs *regs)
|
|
{
|
|
{
|
|
unsigned int lcr;
|
|
unsigned int lcr;
|
|
/*
|
|
/*
|
|
@@ -129,6 +129,9 @@ static int pl01x_generic_setbrg(struct pl01x_regs *regs, enum pl01x_type type,
|
|
case TYPE_PL010: {
|
|
case TYPE_PL010: {
|
|
unsigned int divisor;
|
|
unsigned int divisor;
|
|
|
|
|
|
|
|
+ /* disable everything */
|
|
|
|
+ writel(0, ®s->pl010_cr);
|
|
|
|
+
|
|
switch (baudrate) {
|
|
switch (baudrate) {
|
|
case 9600:
|
|
case 9600:
|
|
divisor = UART_PL010_BAUD_9600;
|
|
divisor = UART_PL010_BAUD_9600;
|
|
@@ -152,6 +155,12 @@ static int pl01x_generic_setbrg(struct pl01x_regs *regs, enum pl01x_type type,
|
|
writel((divisor & 0xf00) >> 8, ®s->pl010_lcrm);
|
|
writel((divisor & 0xf00) >> 8, ®s->pl010_lcrm);
|
|
writel(divisor & 0xff, ®s->pl010_lcrl);
|
|
writel(divisor & 0xff, ®s->pl010_lcrl);
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * Set line control for the PL010 to be 8 bits, 1 stop bit,
|
|
|
|
+ * no parity, fifo enabled
|
|
|
|
+ */
|
|
|
|
+ writel(UART_PL010_LCRH_WLEN_8 | UART_PL010_LCRH_FEN,
|
|
|
|
+ ®s->pl010_lcrh);
|
|
/* Finally, enable the UART */
|
|
/* Finally, enable the UART */
|
|
writel(UART_PL010_CR_UARTEN, ®s->pl010_cr);
|
|
writel(UART_PL010_CR_UARTEN, ®s->pl010_cr);
|
|
break;
|
|
break;
|
|
@@ -178,7 +187,7 @@ static int pl01x_generic_setbrg(struct pl01x_regs *regs, enum pl01x_type type,
|
|
writel(divider, ®s->pl011_ibrd);
|
|
writel(divider, ®s->pl011_ibrd);
|
|
writel(fraction, ®s->pl011_fbrd);
|
|
writel(fraction, ®s->pl011_fbrd);
|
|
|
|
|
|
- set_line_control(regs);
|
|
|
|
|
|
+ pl011_set_line_control(regs);
|
|
/* Finally, enable the UART */
|
|
/* Finally, enable the UART */
|
|
writel(UART_PL011_CR_UARTEN | UART_PL011_CR_TXE |
|
|
writel(UART_PL011_CR_UARTEN | UART_PL011_CR_TXE |
|
|
UART_PL011_CR_RXE | UART_PL011_CR_RTS, ®s->pl011_cr);
|
|
UART_PL011_CR_RXE | UART_PL011_CR_RTS, ®s->pl011_cr);
|