linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ppopov@linux-mips.org
Date: Sat, 06 Aug 2005 00:22:31 +0100
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ppopov@ftp.linux-mips.org       05/08/06 00:22:24

Modified files:
        arch/mips/philips/pnx8550/common: gdb_hook.c prom.c setup.c 
        include/asm-mips/mach-pnx8550: uart.h 
        include/linux  : serial_ip3106.h 

Log message:
        Further ip3106 serial driver cleanup.

diff -urN linux/arch/mips/philips/pnx8550/common/gdb_hook.c 
linux/arch/mips/philips/pnx8550/common/gdb_hook.c
--- linux/arch/mips/philips/pnx8550/common/gdb_hook.c   2005/08/05 01:14:41     
1.3
+++ linux/arch/mips/philips/pnx8550/common/gdb_hook.c   2005/08/05 23:22:24     
1.4
@@ -51,27 +51,27 @@
         * Clear all interrupts
         */
        /* Clear all the transmitter FIFO counters (pointer and status) */
-       IP3106_UART_LCR(tty_no) |= IP3106_UART_LCR_TX_RST;
+       ip3106_lcr(UART_BASE, tty_no) |= IP3106_UART_LCR_TX_RST;
        /* Clear all the receiver FIFO counters (pointer and status) */
-       IP3106_UART_LCR(tty_no) |= IP3106_UART_LCR_RX_RST;
+       ip3106_lcr(UART_BASE, tty_no) |= IP3106_UART_LCR_RX_RST;
        /* Clear all interrupts */
-       IP3106_UART_ICLR(tty_no) = IP3106_UART_INT_ALLRX |
+       ip3106_iclr(UART_BASE, tty_no) = IP3106_UART_INT_ALLRX | 
                IP3106_UART_INT_ALLTX;
 
        /*
         * Now, initialize the UART
         */
-       IP3106_UART_LCR(tty_no) = IP3106_UART_LCR_8BIT;
-       IP3106_UART_BAUD(tty_no) = 5; // 38400 Baud
+       ip3106_lcr(UART_BASE, tty_no) = IP3106_UART_LCR_8BIT;
+       ip3106_baud(UART_BASE, tty_no) = 5; // 38400 Baud
 }
 
 int putDebugChar(char c)
 {
        /* Wait until FIFO not full */
-       while (((IP3106_UART_FIFO(kdb_port_info.port) & 
IP3106_UART_FIFO_TXFIFO) >> 16) >= 16)
+       while (((ip3106_fifo(UART_BASE, kdb_port_info.port) & 
IP3106_UART_FIFO_TXFIFO) >> 16) >= 16)
                ;
        /* Send one char */
-       IP3106_UART_FIFO(kdb_port_info.port) = c;
+       ip3106_fifo(UART_BASE, kdb_port_info.port) = c;
 
        return 1;
 }
@@ -81,29 +81,30 @@
        char ch;
 
        /* Wait until there is a char in the FIFO */
-       while (!((IP3106_UART_FIFO(kdb_port_info.port) &
+       while (!((ip3106_fifo(UART_BASE, kdb_port_info.port) & 
                                        IP3106_UART_FIFO_RXFIFO) >> 8))
                ;
        /* Read one char */
-       ch = IP3106_UART_FIFO(kdb_port_info.port) & IP3106_UART_FIFO_RBRTHR;
+       ch = ip3106_fifo(UART_BASE, kdb_port_info.port) & 
+               IP3106_UART_FIFO_RBRTHR;
        /* Advance the RX FIFO read pointer */
-       IP3106_UART_LCR(kdb_port_info.port) |= IP3106_UART_LCR_RX_NEXT;
+       ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_RX_NEXT;
        return (ch);
 }
 
 void rs_disable_debug_interrupts(void)
 {
-       IP3106_UART_IEN(kdb_port_info.port) = 0; /* Disable all interrupts */
+       ip3106_ien(UART_BASE, kdb_port_info.port) = 0; /* Disable all 
interrupts */
 }
 
 void rs_enable_debug_interrupts(void)
 {
        /* Clear all the transmitter FIFO counters (pointer and status) */
-       IP3106_UART_LCR(kdb_port_info.port) |= IP3106_UART_LCR_TX_RST;
+       ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_TX_RST;
        /* Clear all the receiver FIFO counters (pointer and status) */
-       IP3106_UART_LCR(kdb_port_info.port) |= IP3106_UART_LCR_RX_RST;
+       ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_RX_RST;
        /* Clear all interrupts */
-       IP3106_UART_ICLR(kdb_port_info.port) = IP3106_UART_INT_ALLRX |
+       ip3106_iclr(UART_BASE, kdb_port_info.port) = IP3106_UART_INT_ALLRX |
                IP3106_UART_INT_ALLTX;
-       IP3106_UART_IEN(kdb_port_info.port)  = IP3106_UART_INT_ALLRX;   /* 
Enable RX interrupts */
+       ip3106_ien(UART_BASE, kdb_port_info.port)  = IP3106_UART_INT_ALLRX; /* 
Enable RX interrupts */
 }
diff -urN linux/arch/mips/philips/pnx8550/common/prom.c 
linux/arch/mips/philips/pnx8550/common/prom.c
--- linux/arch/mips/philips/pnx8550/common/prom.c       2005/08/05 01:14:41     
1.3
+++ linux/arch/mips/philips/pnx8550/common/prom.c       2005/08/05 23:22:24     
1.4
@@ -126,11 +126,10 @@
 {
        if (pnx8550_console_port != -1) {
                /* Wait until FIFO not full */
-               while( ((IP3106_UART_FIFO(1)
-                       & IP3106_UART_FIFO_TXFIFO) >> 16) >= 16)
+               while( ((ip3106_fifo(UART_BASE, pnx8550_console_port) & 
IP3106_UART_FIFO_TXFIFO) >> 16) >= 16)
                        ;
                /* Send one char */
-               IP3106_UART_FIFO(1) = c;
+               ip3106_fifo(UART_BASE, pnx8550_console_port) = c;
        }
 }
 
diff -urN linux/arch/mips/philips/pnx8550/common/setup.c 
linux/arch/mips/philips/pnx8550/common/setup.c
--- linux/arch/mips/philips/pnx8550/common/setup.c      2005/08/05 01:14:41     
1.3
+++ linux/arch/mips/philips/pnx8550/common/setup.c      2005/08/05 23:22:24     
1.4
@@ -129,8 +129,9 @@
 
                /* We must initialize the UART (console) before prom_printf */
                /* Set LCR to 8-bit and BAUD to 38400 (no 5)                */
-               IP3106_UART_LCR(pnx8550_console_port) = IP3106_UART_LCR_8BIT;
-               IP3106_UART_BAUD(pnx8550_console_port) = 5;
+               ip3106_lcr(UART_BASE, pnx8550_console_port) = 
+                       IP3106_UART_LCR_8BIT;
+               ip3106_baud(UART_BASE, pnx8550_console_port) = 5;
        }
 
 #ifdef CONFIG_KGDB
diff -urN linux/include/asm-mips/mach-pnx8550/uart.h 
linux/include/asm-mips/mach-pnx8550/uart.h
--- linux/include/asm-mips/mach-pnx8550/uart.h  2005/08/05 01:14:41     1.2
+++ linux/include/asm-mips/mach-pnx8550/uart.h  2005/08/05 23:22:24     1.3
@@ -10,18 +10,6 @@
 #define PNX8550_UART_PORT0     (UART_BASE)
 #define PNX8550_UART_PORT1     (UART_BASE + 0x1000)
 
-#define IP3106_UART_LCR(x)     *(volatile u32 *)(UART_BASE+(x*0x1000) + 0x000)
-#define IP3106_UART_MCR(x)     *(volatile u32 *)(UART_BASE+(x*0x1000) + 0x004)
-#define IP3106_UART_BAUD(x)    *(volatile u32 *)(UART_BASE+(x*0x1000) + 0x008)
-#define IP3106_UART_CFG(x)     *(volatile u32 *)(UART_BASE+(x*0x1000) + 0x00C)
-#define IP3106_UART_FIFO(x)    *(volatile u32 *)(UART_BASE+(x*0x1000) + 0x028)
-#define IP3106_UART_ISTAT(x)   *(volatile u32 *)(UART_BASE+(x*0x1000) + 0xFE0)
-#define IP3106_UART_IEN(x)     *(volatile u32 *)(UART_BASE+(x*0x1000) + 0xFE4)
-#define IP3106_UART_ICLR(x)    *(volatile u32 *)(UART_BASE+(x*0x1000) + 0xFE8)
-#define IP3106_UART_ISET(x)    *(volatile u32 *)(UART_BASE+(x*0x1000) + 0xFEC)
-#define IP3106_UART_PD(x)      *(volatile u32 *)(UART_BASE+(x*0x1000) + 0xFF4)
-#define IP3106_UART_MID(x)     *(volatile u32 *)(UART_BASE+(x*0x1000) + 0xFFC)
-
 #define PNX8550_UART_INT(x)            (PNX8550_INT_GIC_MIN+19+x)
 #define IRQ_TO_UART(x)                 (x-PNX8550_INT_GIC_MIN-19)
 
diff -urN linux/include/linux/serial_ip3106.h 
linux/include/linux/serial_ip3106.h
--- linux/include/linux/serial_ip3106.h 2005/08/05 01:14:41     1.1
+++ linux/include/linux/serial_ip3106.h 2005/08/05 23:22:24     1.2
@@ -78,4 +78,16 @@
 #define IP3106_UART_FIFO_RXFIFO                0x00001F00
 #define IP3106_UART_FIFO_RBRTHR                0x000000FF
 
+#define ip3106_lcr(base,port)    *(volatile u32 *)(base+(port*0x1000) + 0x000)
+#define ip3106_mcr(base, port)   *(volatile u32 *)(base+(port*0x1000) + 0x004)
+#define ip3106_baud(base, port)  *(volatile u32 *)(base+(port*0x1000) + 0x008)
+#define ip3106_cfg(base, port)   *(volatile u32 *)(base+(port*0x1000) + 0x00C)
+#define ip3106_fifo(base, port)         *(volatile u32 *)(base+(port*0x1000) + 
0x028)
+#define ip3106_istat(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFE0)
+#define ip3106_ien(base, port)   *(volatile u32 *)(base+(port*0x1000) + 0xFE4)
+#define ip3106_iclr(base, port)  *(volatile u32 *)(base+(port*0x1000) + 0xFE8)
+#define ip3106_iset(base, port)  *(volatile u32 *)(base+(port*0x1000) + 0xFEC)
+#define ip3106_pd(base, port)    *(volatile u32 *)(base+(port*0x1000) + 0xFF4)
+#define ip3106_mid(base, port)   *(volatile u32 *)(base+(port*0x1000) + 0xFFC)
+
 #endif

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