Skip to content

Commit

Permalink
MIPS: Octeon: Serial port fixes for OCTEON simulator.
Browse files Browse the repository at this point in the history
For the simulator, fake a slow clock to get fast output.

In prom_putchar we have to mask the value so the simulator doesn't
ASSERT when printing non-ASCII characters.

Signed-off-by: David Daney <[email protected]>
To: [email protected]
Patchwork: http://patchwork.linux-mips.org/patch/1255/
Signed-off-by: Ralf Baechle <[email protected]>
  • Loading branch information
David Daney authored and ralfbaechle committed May 21, 2010
1 parent 1dd5216 commit 606c958
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion arch/mips/cavium-octeon/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ static void __init octeon_uart_set_common(struct plat_serial8250_port *p)
p->type = PORT_OCTEON;
p->iotype = UPIO_MEM;
p->regshift = 3; /* I/O addresses are every 8 bytes */
p->uartclk = mips_hpt_frequency;
if (octeon_is_simulation())
/* Make simulator output fast*/
p->uartclk = 115200 * 16;
else
p->uartclk = mips_hpt_frequency;
p->serial_in = octeon_serial_in;
p->serial_out = octeon_serial_out;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/cavium-octeon/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ int prom_putchar(char c)
} while ((lsrval & 0x20) == 0);

/* Write the byte */
cvmx_write_csr(CVMX_MIO_UARTX_THR(octeon_uart), c);
cvmx_write_csr(CVMX_MIO_UARTX_THR(octeon_uart), c & 0xffull);
return 1;
}

Expand Down

0 comments on commit 606c958

Please sign in to comment.