Commit 311c4627 authored by Kumar Gala's avatar Kumar Gala Committed by Linus Torvalds

[PATCH] cpm_uart: Fix dpram allocation and non-console uarts

* Makes dpram allocations work
* Makes non-console UART work on both 8xx and 82xx
* Fixed whitespace in files that were touched
Signed-off-by: default avatarVitaly Bordug <vbordug@ru.mvista.com>
Signed-off-by: default avatarPantelis Antoniou <panto@intracom.gr>
Signed-off-by: default avatarKumar Gala <kumar.gala@freescale.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3077a260
...@@ -40,13 +40,15 @@ ...@@ -40,13 +40,15 @@
#define TX_NUM_FIFO 4 #define TX_NUM_FIFO 4
#define TX_BUF_SIZE 32 #define TX_BUF_SIZE 32
#define SCC_WAIT_CLOSING 100
struct uart_cpm_port { struct uart_cpm_port {
struct uart_port port; struct uart_port port;
u16 rx_nrfifos; u16 rx_nrfifos;
u16 rx_fifosize; u16 rx_fifosize;
u16 tx_nrfifos; u16 tx_nrfifos;
u16 tx_fifosize; u16 tx_fifosize;
smc_t *smcp; smc_t *smcp;
smc_uart_t *smcup; smc_uart_t *smcup;
scc_t *sccp; scc_t *sccp;
scc_uart_t *sccup; scc_uart_t *sccup;
...@@ -67,6 +69,8 @@ struct uart_cpm_port { ...@@ -67,6 +69,8 @@ struct uart_cpm_port {
int bits; int bits;
/* Keep track of 'odd' SMC2 wirings */ /* Keep track of 'odd' SMC2 wirings */
int is_portb; int is_portb;
/* wait on close if needed */
int wait_closing;
}; };
extern int cpm_uart_port_map[UART_NR]; extern int cpm_uart_port_map[UART_NR];
......
This diff is collapsed.
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2)
* Pantelis Antoniou (panto@intracom.gr) (CPM1) * Pantelis Antoniou (panto@intracom.gr) (CPM1)
* *
* Copyright (C) 2004 Freescale Semiconductor, Inc. * Copyright (C) 2004 Freescale Semiconductor, Inc.
* (C) 2004 Intracom, S.A. * (C) 2004 Intracom, S.A.
* *
...@@ -82,6 +82,17 @@ void cpm_line_cr_cmd(int line, int cmd) ...@@ -82,6 +82,17 @@ void cpm_line_cr_cmd(int line, int cmd)
void smc1_lineif(struct uart_cpm_port *pinfo) void smc1_lineif(struct uart_cpm_port *pinfo)
{ {
volatile cpm8xx_t *cp = cpmp; 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; unsigned int iobits = 0x000000c0;
if (!pinfo->is_portb) { if (!pinfo->is_portb) {
...@@ -93,41 +104,33 @@ void smc1_lineif(struct uart_cpm_port *pinfo) ...@@ -93,41 +104,33 @@ void smc1_lineif(struct uart_cpm_port *pinfo)
((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits; ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits;
((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits;
} }
#ifdef CONFIG_MPC885ADS
/* Enable SMC1 transceivers */
{
volatile uint __iomem *bcsr1 = ioremap(BCSR1, 4);
uint tmp;
tmp = in_be32(bcsr1);
tmp &= ~BCSR1_RS232EN_1;
out_be32(bcsr1, tmp);
iounmap(bcsr1);
}
#endif #endif
pinfo->brg = 1; pinfo->brg = 1;
} }
void smc2_lineif(struct uart_cpm_port *pinfo) void smc2_lineif(struct uart_cpm_port *pinfo)
{ {
#ifdef CONFIG_MPC885ADS
volatile cpm8xx_t *cp = cpmp; volatile cpm8xx_t *cp = cpmp;
volatile uint __iomem *bcsr1;
uint tmp;
(void)cp; /* fix warning */
#if defined (CONFIG_MPC885ADS)
cp->cp_pepar |= 0x00000c00; cp->cp_pepar |= 0x00000c00;
cp->cp_pedir &= ~0x00000c00; cp->cp_pedir &= ~0x00000c00;
cp->cp_peso &= ~0x00000400; cp->cp_peso &= ~0x00000400;
cp->cp_peso |= 0x00000800; 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;
}
/* Enable SMC2 transceivers */
bcsr1 = ioremap(BCSR1, 4);
tmp = in_be32(bcsr1);
tmp &= ~BCSR1_RS232EN_2;
out_be32(bcsr1, tmp);
iounmap(bcsr1);
#endif #endif
pinfo->brg = 2; pinfo->brg = 2;
...@@ -158,7 +161,7 @@ void scc4_lineif(struct uart_cpm_port *pinfo) ...@@ -158,7 +161,7 @@ void scc4_lineif(struct uart_cpm_port *pinfo)
} }
/* /*
* Allocate DP-Ram and memory buffers. We need to allocate a transmit and * Allocate DP-Ram and memory buffers. We need to allocate a transmit and
* receive buffer descriptors from dual port ram, and a character * receive buffer descriptors from dual port ram, and a character
* buffer area from host mem. If we are allocating for the console we need * buffer area from host mem. If we are allocating for the console we need
* to do it from bootmem * to do it from bootmem
...@@ -185,6 +188,8 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) ...@@ -185,6 +188,8 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) +
L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize);
if (is_con) { if (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)); mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8));
dma_addr = 0; dma_addr = 0;
} else } else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment