fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / serial / cpm_uart / cpm_uart_cpm1.c
index d789ee5..08e55fd 100644 (file)
@@ -8,6 +8,8 @@
  *
  *  Copyright (C) 2004 Freescale Semiconductor, Inc.
  *            (C) 2004 Intracom, S.A.
+ *            (C) 2006 MontaVista Software, Inc.
+ *             Vitaly Bordug <vbordug@ru.mvista.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -25,7 +27,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/ioport.h>
@@ -81,58 +82,11 @@ void cpm_line_cr_cmd(int line, int cmd)
 
 void smc1_lineif(struct uart_cpm_port *pinfo)
 {
-       volatile cpm8xx_t *cp = cpmp;
-
-       (void)cp;       /* fix warning */
-#if defined (CONFIG_MPC885ADS)
-       /* Enable SMC1 transceivers */
-       {
-               cp->cp_pepar |= 0x000000c0;
-               cp->cp_pedir &= ~0x000000c0;
-               cp->cp_peso &= ~0x00000040;
-               cp->cp_peso |= 0x00000080;
-       }
-#elif defined (CONFIG_MPC86XADS)
-       unsigned int iobits = 0x000000c0;
-
-       if (!pinfo->is_portb) {
-               cp->cp_pbpar |= iobits;
-               cp->cp_pbdir &= ~iobits;
-               cp->cp_pbodr &= ~iobits;
-       } else {
-               ((immap_t *)IMAP_ADDR)->im_ioport.iop_papar |= iobits;
-               ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits;
-               ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits;
-       }
-#endif
        pinfo->brg = 1;
 }
 
 void smc2_lineif(struct uart_cpm_port *pinfo)
 {
-       volatile cpm8xx_t *cp = cpmp;
-
-       (void)cp;       /* fix warning */
-#if defined (CONFIG_MPC885ADS)
-       cp->cp_pepar |= 0x00000c00;
-       cp->cp_pedir &= ~0x00000c00;
-       cp->cp_peso &= ~0x00000400;
-       cp->cp_peso |= 0x00000800;
-#elif defined (CONFIG_MPC86XADS)
-       unsigned int iobits = 0x00000c00;
-
-       if (!pinfo->is_portb) {
-               cp->cp_pbpar |= iobits;
-               cp->cp_pbdir &= ~iobits;
-               cp->cp_pbodr &= ~iobits;
-       } else {
-               ((immap_t *)IMAP_ADDR)->im_ioport.iop_papar |= iobits;
-               ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits;
-               ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits;
-       }
-
-#endif
-
        pinfo->brg = 2;
 }
 
@@ -191,7 +145,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
                /* was hostalloc but changed cause it blows away the */
                /* large tlb mapping when pinning the kernel area    */
                mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8));
-               dma_addr = 0;
+               dma_addr = (u32)mem_addr;
        } else
                mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr,
                                              GFP_KERNEL);
@@ -204,8 +158,9 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
        }
 
        pinfo->dp_addr = dp_offset;
-       pinfo->mem_addr = mem_addr;
-       pinfo->dma_addr = dma_addr;
+       pinfo->mem_addr = mem_addr;             /*  virtual address*/
+       pinfo->dma_addr = dma_addr;             /*  physical address*/
+       pinfo->mem_size = memsz;
 
        pinfo->rx_buf = mem_addr;
        pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos
@@ -229,7 +184,7 @@ void cpm_uart_freebuf(struct uart_cpm_port *pinfo)
 }
 
 /* Setup any dynamic params in the uart desc */
-int cpm_uart_init_portdesc(void)
+int __init cpm_uart_init_portdesc(void)
 {
        pr_debug("CPM uart[-]:init portdesc\n");