diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-05-02 14:33:57 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-05-02 14:33:57 -0400 |
commit | 1fb5fef9b80d9a3b5368e22031627afd1585487b (patch) | |
tree | 54f07a532b5b2622b8642156bbcaeca637fcdb8f /drivers/serial/cpm_uart/cpm_uart_cpm1.c | |
parent | 1a2e8a6f8ec0a068911a882a19e0912a0c89be6e (diff) | |
parent | 330ab71619bacc4d4494227a6cfc9b7f5500403d (diff) |
Merge branch 'master' into upstream
Diffstat (limited to 'drivers/serial/cpm_uart/cpm_uart_cpm1.c')
-rw-r--r-- | drivers/serial/cpm_uart/cpm_uart_cpm1.c | 54 |
1 files changed, 4 insertions, 50 deletions
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c index d789ee55cbb7..a5a30622637a 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c | |||
@@ -81,58 +81,11 @@ void cpm_line_cr_cmd(int line, int cmd) | |||
81 | 81 | ||
82 | void smc1_lineif(struct uart_cpm_port *pinfo) | 82 | void smc1_lineif(struct uart_cpm_port *pinfo) |
83 | { | 83 | { |
84 | volatile cpm8xx_t *cp = cpmp; | ||
85 | |||
86 | (void)cp; /* fix warning */ | ||
87 | #if defined (CONFIG_MPC885ADS) | ||
88 | /* Enable SMC1 transceivers */ | ||
89 | { | ||
90 | cp->cp_pepar |= 0x000000c0; | ||
91 | cp->cp_pedir &= ~0x000000c0; | ||
92 | cp->cp_peso &= ~0x00000040; | ||
93 | cp->cp_peso |= 0x00000080; | ||
94 | } | ||
95 | #elif defined (CONFIG_MPC86XADS) | ||
96 | unsigned int iobits = 0x000000c0; | ||
97 | |||
98 | if (!pinfo->is_portb) { | ||
99 | cp->cp_pbpar |= iobits; | ||
100 | cp->cp_pbdir &= ~iobits; | ||
101 | cp->cp_pbodr &= ~iobits; | ||
102 | } else { | ||
103 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_papar |= iobits; | ||
104 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits; | ||
105 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; | ||
106 | } | ||
107 | #endif | ||
108 | pinfo->brg = 1; | 84 | pinfo->brg = 1; |
109 | } | 85 | } |
110 | 86 | ||
111 | void smc2_lineif(struct uart_cpm_port *pinfo) | 87 | void smc2_lineif(struct uart_cpm_port *pinfo) |
112 | { | 88 | { |
113 | volatile cpm8xx_t *cp = cpmp; | ||
114 | |||
115 | (void)cp; /* fix warning */ | ||
116 | #if defined (CONFIG_MPC885ADS) | ||
117 | cp->cp_pepar |= 0x00000c00; | ||
118 | cp->cp_pedir &= ~0x00000c00; | ||
119 | cp->cp_peso &= ~0x00000400; | ||
120 | cp->cp_peso |= 0x00000800; | ||
121 | #elif defined (CONFIG_MPC86XADS) | ||
122 | unsigned int iobits = 0x00000c00; | ||
123 | |||
124 | if (!pinfo->is_portb) { | ||
125 | cp->cp_pbpar |= iobits; | ||
126 | cp->cp_pbdir &= ~iobits; | ||
127 | cp->cp_pbodr &= ~iobits; | ||
128 | } else { | ||
129 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_papar |= iobits; | ||
130 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits; | ||
131 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; | ||
132 | } | ||
133 | |||
134 | #endif | ||
135 | |||
136 | pinfo->brg = 2; | 89 | pinfo->brg = 2; |
137 | } | 90 | } |
138 | 91 | ||
@@ -191,7 +144,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) | |||
191 | /* was hostalloc but changed cause it blows away the */ | 144 | /* was hostalloc but changed cause it blows away the */ |
192 | /* large tlb mapping when pinning the kernel area */ | 145 | /* large tlb mapping when pinning the kernel area */ |
193 | mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8)); | 146 | mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8)); |
194 | dma_addr = 0; | 147 | dma_addr = (u32)mem_addr; |
195 | } else | 148 | } else |
196 | mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr, | 149 | mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr, |
197 | GFP_KERNEL); | 150 | GFP_KERNEL); |
@@ -204,8 +157,9 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) | |||
204 | } | 157 | } |
205 | 158 | ||
206 | pinfo->dp_addr = dp_offset; | 159 | pinfo->dp_addr = dp_offset; |
207 | pinfo->mem_addr = mem_addr; | 160 | pinfo->mem_addr = mem_addr; /* virtual address*/ |
208 | pinfo->dma_addr = dma_addr; | 161 | pinfo->dma_addr = dma_addr; /* physical address*/ |
162 | pinfo->mem_size = memsz; | ||
209 | 163 | ||
210 | pinfo->rx_buf = mem_addr; | 164 | pinfo->rx_buf = mem_addr; |
211 | pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos | 165 | pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos |