linux-mips
[Top] [All Lists]

[PATCH] yosemite serial support

To: linux-mips@linux-mips.org
Subject: [PATCH] yosemite serial support
From: Thomas Koeller <thomas.koeller@baslerweb.com>
Date: Fri, 6 Aug 2004 18:36:24 +0200
Organization: Basler AG
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: KMail/1.6.2
Hi,

the patch below adds support for the second serial
port on the PMC-Sierra Yosemite board.

tk

--- linux-mips/arch/mips/pmc-sierra/yosemite/setup.c    2004-07-20 
11:43:44.000000000 +0200
+++ linux-mips-work/arch/mips/pmc-sierra/yosemite/setup.c       2004-08-06 
18:30:55.518022384 +0200
@@ -156,11 +156,13 @@
 #define TITAN_UART_CLK         3686400
 #define TITAN_SERIAL_BASE_BAUD (TITAN_UART_CLK / 16)
 #define TITAN_SERIAL_IRQ       4
-#define TITAN_SERIAL_BASE      0xfd000008UL
+#define TITAN_SERIAL_BASE      0xfd000000UL
+#define TITAN_SERIAL_REG_SIZE  8

 static void __init py_map_ocd(void)
 {
-        struct uart_port up;
+       struct uart_port up;
+       static const char serr[] = KERN_ERR "Early serial init of port %u 
failed\n";

        /*
         * Not specifically interrupt stuff but in case of SMP core_send_ipi
@@ -171,20 +173,26 @@
                panic("Mapping OCD failed - game over.  Your score is 0.");

        /*
-        * Register to interrupt zero because we share the interrupt with
-        * the serial driver which we don't properly support yet.
+        * Set up serial port #1. Do not use autodetection; the result is
+        * not what we want.
         */
        memset(&up, 0, sizeof(up));
-       up.membase      = (unsigned char *) ioremap(TITAN_SERIAL_BASE, 8);
+       up.membase      = (unsigned char *) ioremap(TITAN_SERIAL_BASE, 
TITAN_SERIAL_REG_SIZE * 2);
        up.irq          = TITAN_SERIAL_IRQ;
        up.uartclk      = TITAN_UART_CLK;
        up.regshift     = 0;
        up.iotype       = UPIO_MEM;
-       up.flags        = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
-       up.line         = 0;
+       up.flags        = UPF_SHARE_IRQ;
+       up.line         = 1;
+       up.type         = PORT_16550A;
+       if (!up.membase || early_serial_setup(&up))
+               printk(serr, up.line);

+       /* And now for port #0. */
+       up.membase      += TITAN_SERIAL_REG_SIZE;
+       up.line         = 0;
        if (early_serial_setup(&up))
-               printk(KERN_ERR "Early serial init of port 0 failed\n");
+               printk(serr, up.line);
 }

 static int __init pmc_yosemite_setup(void)

-- 
--------------------------------------------------

Thomas Koeller, Software Development
Basler Vision Technologies

thomas dot koeller at baslerweb dot com
http://www.baslerweb.com

==============================

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] yosemite serial support, Thomas Koeller <=