linux-mips
[Top] [All Lists]

[PATCH 2/2] MIPS: Octeon: Serial port fixes for OCTEON simulator.

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH 2/2] MIPS: Octeon: Serial port fixes for OCTEON simulator.
From: David Daney <ddaney@caviumnetworks.com>
Date: Wed, 19 May 2010 14:16:32 -0700
Cc: David Daney <ddaney@caviumnetworks.com>
In-reply-to: <1274303792-10190-1-git-send-email-ddaney@caviumnetworks.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1274303792-10190-1-git-send-email-ddaney@caviumnetworks.com>
Sender: linux-mips-bounce@linux-mips.org
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 <ddaney@caviumnetworks.com>
---
 arch/mips/cavium-octeon/serial.c |    6 +++++-
 arch/mips/cavium-octeon/setup.c  |    2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/mips/cavium-octeon/serial.c b/arch/mips/cavium-octeon/serial.c
index 2110e68..9c7a8c6 100644
--- a/arch/mips/cavium-octeon/serial.c
+++ b/arch/mips/cavium-octeon/serial.c
@@ -114,7 +114,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;
 }
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c
index 8640af3..9fb5336 100644
--- a/arch/mips/cavium-octeon/setup.c
+++ b/arch/mips/cavium-octeon/setup.c
@@ -707,7 +707,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;
 }
 
-- 
1.6.6.1


<Prev in Thread] Current Thread [Next in Thread>