]> err.no Git - linux-2.6/blobdiff - drivers/serial/cpm_uart/cpm_uart_cpm2.c
[PATCH] s2io: netpoll support
[linux-2.6] / drivers / serial / cpm_uart / cpm_uart_cpm2.c
index 15ad58d94889f431bfc4899dea71a65b1d2f7e86..cdba128250a96e5f2f98a07c5dcbf2318c65ff92 100644 (file)
@@ -3,11 +3,13 @@
  *
  *  Driver for CPM (SCC/SMC) serial ports; CPM2 definitions
  *
- *  Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2)
+ *  Maintainer: Kumar Gala (galak@kernel.crashing.org) (CPM2)
  *              Pantelis Antoniou (panto@intracom.gr) (CPM1)
  * 
  *  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
@@ -142,21 +144,12 @@ void scc2_lineif(struct uart_cpm_port *pinfo)
         * be supported in a sane fashion.
         */
 #ifndef CONFIG_STX_GP3
-#ifdef CONFIG_MPC8560_ADS
-       volatile iop_cpm2_t *io = &cpm2_immr->im_ioport;
-       io->iop_ppard |= 0x00000018;
-       io->iop_psord &= ~0x00000008;   /* Rx */
-       io->iop_psord &= ~0x00000010;   /* Tx */
-       io->iop_pdird &= ~0x00000008;   /* Rx */
-       io->iop_pdird |= 0x00000010;    /* Tx */
-#else
        volatile iop_cpm2_t *io = &cpm2_immr->im_ioport;
        io->iop_pparb |= 0x008b0000;
        io->iop_pdirb |= 0x00880000;
        io->iop_psorb |= 0x00880000;
        io->iop_pdirb &= ~0x00030000;
        io->iop_psorb &= ~0x00030000;
-#endif
 #endif
        cpm2_immr->im_cpmux.cmx_scr &= 0xff00ffff;
        cpm2_immr->im_cpmux.cmx_scr |= 0x00090000;
@@ -218,8 +211,10 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
 
        memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) +
            L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize);
-       if (is_con)
+       if (is_con) {
                mem_addr = alloc_bootmem(memsz);
+               dma_addr = virt_to_bus(mem_addr);
+       }
        else
                mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr,
                                              GFP_KERNEL);
@@ -234,6 +229,7 @@ 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_size = memsz;
 
        pinfo->rx_buf = mem_addr;
        pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos