Skip to content
Snippets Groups Projects
Commit eb8a4fe0 authored by Vikas Manocha's avatar Vikas Manocha Committed by Tom Rini
Browse files

serial: pl01x: avoid pl01x type check two times

parent f7e517b4
No related branches found
No related tags found
No related merge requests found
...@@ -72,22 +72,19 @@ static int pl01x_tstc(struct pl01x_regs *regs) ...@@ -72,22 +72,19 @@ static int pl01x_tstc(struct pl01x_regs *regs)
static int pl01x_generic_serial_init(struct pl01x_regs *regs, static int pl01x_generic_serial_init(struct pl01x_regs *regs,
enum pl01x_type type) enum pl01x_type type)
{ {
switch (type) {
case TYPE_PL010:
/* disable everything */
writel(0, &regs->pl010_cr);
break;
case TYPE_PL011:
#ifdef CONFIG_PL011_SERIAL_FLUSH_ON_INIT #ifdef CONFIG_PL011_SERIAL_FLUSH_ON_INIT
if (type == TYPE_PL011) {
/* Empty RX fifo if necessary */ /* Empty RX fifo if necessary */
if (readl(&regs->pl011_cr) & UART_PL011_CR_UARTEN) { if (readl(&regs->pl011_cr) & UART_PL011_CR_UARTEN) {
while (!(readl(&regs->fr) & UART_PL01x_FR_RXFE)) while (!(readl(&regs->fr) & UART_PL01x_FR_RXFE))
readl(&regs->dr); readl(&regs->dr);
} }
}
#endif #endif
switch (type) {
case TYPE_PL010:
/* disable everything */
writel(0, &regs->pl010_cr);
break;
case TYPE_PL011:
/* disable everything */ /* disable everything */
writel(0, &regs->pl011_cr); writel(0, &regs->pl011_cr);
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment