Skip to content
Snippets Groups Projects
Commit 1d568c76 authored by Alexey Brodkin's avatar Alexey Brodkin Committed by Tom Rini
Browse files

serial/serial_arc: add work-around of ISS bug


Explanation is in in-lined comment.

Signed-off-by: default avatarAlexey Brodkin <abrodkin@synopsys.com>

Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Noam Camus <noamc@ezchip.com>
Cc: Tom Rini <trini@ti.com>
parent 6853e6aa
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,23 @@ static void arc_serial_setbrg(void) ...@@ -39,7 +39,23 @@ static void arc_serial_setbrg(void)
arc_console_baud = gd->cpu_clk / (gd->baudrate * 4) - 1; arc_console_baud = gd->cpu_clk / (gd->baudrate * 4) - 1;
writel(arc_console_baud & 0xff, &regs->baudl); writel(arc_console_baud & 0xff, &regs->baudl);
#ifdef CONFIG_ARC
/*
* UART ISS(Instruction Set simulator) emulation has a subtle bug:
* A existing value of Baudh = 0 is used as a indication to startup
* it's internal state machine.
* Thus if baudh is set to 0, 2 times, it chokes.
* This happens with BAUD=115200 and the formaula above
* Until that is fixed, when running on ISS, we will set baudh to !0
*/
if (gd->arch.running_on_hw)
writel((arc_console_baud & 0xff00) >> 8, &regs->baudh);
else
writel(1, &regs->baudh);
#else
writel((arc_console_baud & 0xff00) >> 8, &regs->baudh); writel((arc_console_baud & 0xff00) >> 8, &regs->baudh);
#endif
} }
static int arc_serial_init(void) static int arc_serial_init(void)
......
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