Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

POWERPC: Get rid of remapping the whole immr

The stuff below cleans up the code attempting to remap the whole cpm2_immr
early, as well as places happily assuming that fact. This is more like the 2.4
legacy stuff, and is at least confusing and unclear now.

To keep the world comfortable, a new mechanism is introduced: before accessing
specific immr register/register set, one needs to map it, using cpm2_map(<reg>),
for instance, access to CPM command register will look like
volatile cpm_cpm2_t *cp = cpm2_map(im_cpm);
keeping the code clear, yet without "already defined somewhere" cpm2_immr.

So far, unmapping code is not implemented, but it's not a big deal to add it,
if the whole idea makes sense.

Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>

+148 -67
+14 -5
arch/powerpc/sysdev/cpm2_common.c
··· 51 51 * the communication processor devices. 52 52 */ 53 53 cpm2_map_t *cpm2_immr; 54 + intctl_cpm2_t *cpm2_intctl; 54 55 55 56 #define CPM_MAP_SIZE (0x40000) /* 256k - the PQ3 reserve this amount 56 57 of space for CPM as it is larger ··· 61 60 cpm2_reset(void) 62 61 { 63 62 cpm2_immr = (cpm2_map_t *)ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE); 63 + cpm2_intctl = cpm2_map(im_intctl); 64 64 65 65 /* Reclaim the DP memory for our use. 66 66 */ ··· 96 94 /* This is good enough to get SMCs running..... 97 95 */ 98 96 if (brg < 4) { 99 - bp = (uint *)&cpm2_immr->im_brgc1; 97 + bp = cpm2_map_size(im_brgc1, 16); 100 98 } else { 101 - bp = (uint *)&cpm2_immr->im_brgc5; 99 + bp = cpm2_map_size(im_brgc5, 16); 102 100 brg -= 4; 103 101 } 104 102 bp += brg; 105 103 *bp = ((BRG_UART_CLK / rate) << 1) | CPM_BRG_EN; 104 + 105 + cpm2_unmap(bp); 106 106 } 107 107 108 108 /* This function is used to set high speed synchronous baud rate ··· 116 112 volatile uint *bp; 117 113 118 114 if (brg < 4) { 119 - bp = (uint *)&cpm2_immr->im_brgc1; 115 + bp = cpm2_map_size(im_brgc1, 16); 120 116 } 121 117 else { 122 - bp = (uint *)&cpm2_immr->im_brgc5; 118 + bp = cpm2_map_size(im_brgc5, 16); 123 119 brg -= 4; 124 120 } 125 121 bp += brg; 126 122 *bp = ((BRG_INT_CLK / rate) << 1) | CPM_BRG_EN; 127 123 if (div16) 128 124 *bp |= CPM_BRG_DIV16; 125 + 126 + cpm2_unmap(bp); 129 127 } 130 128 131 129 /* ··· 138 132 * until the memory subsystem goes up... */ 139 133 static rh_block_t cpm_boot_dpmem_rh_block[16]; 140 134 static rh_info_t cpm_dpmem_info; 135 + static u8* im_dprambase; 141 136 142 137 static void cpm2_dpinit(void) 143 138 { 144 139 spin_lock_init(&cpm_dpmem_lock); 140 + 141 + im_dprambase = ioremap(CPM_MAP_ADDR, CPM_DATAONLY_BASE + CPM_DATAONLY_SIZE); 145 142 146 143 /* initialize the info header */ 147 144 rh_init(&cpm_dpmem_info, 1, ··· 214 205 215 206 void *cpm_dpram_addr(uint offset) 216 207 { 217 - return (void *)&cpm2_immr->im_dprambase[offset]; 208 + return (void *)(im_dprambase + offset); 218 209 } 219 210 EXPORT_SYMBOL(cpm_dpram_addr);
+17 -17
arch/powerpc/sysdev/cpm2_pic.c
··· 78 78 bit = irq_to_siubit[irq_nr]; 79 79 word = irq_to_siureg[irq_nr]; 80 80 81 - simr = &(cpm2_immr->im_intctl.ic_simrh); 81 + simr = &(cpm2_intctl->ic_simrh); 82 82 ppc_cached_irq_mask[word] &= ~(1 << bit); 83 83 simr[word] = ppc_cached_irq_mask[word]; 84 84 } ··· 93 93 bit = irq_to_siubit[irq_nr]; 94 94 word = irq_to_siureg[irq_nr]; 95 95 96 - simr = &(cpm2_immr->im_intctl.ic_simrh); 96 + simr = &(cpm2_intctl->ic_simrh); 97 97 ppc_cached_irq_mask[word] |= 1 << bit; 98 98 simr[word] = ppc_cached_irq_mask[word]; 99 99 } ··· 108 108 bit = irq_to_siubit[irq_nr]; 109 109 word = irq_to_siureg[irq_nr]; 110 110 111 - simr = &(cpm2_immr->im_intctl.ic_simrh); 112 - sipnr = &(cpm2_immr->im_intctl.ic_sipnrh); 111 + simr = &(cpm2_intctl->ic_simrh); 112 + sipnr = &(cpm2_intctl->ic_sipnrh); 113 113 ppc_cached_irq_mask[word] &= ~(1 << bit); 114 114 simr[word] = ppc_cached_irq_mask[word]; 115 115 sipnr[word] = 1 << bit; ··· 127 127 bit = irq_to_siubit[irq_nr]; 128 128 word = irq_to_siureg[irq_nr]; 129 129 130 - simr = &(cpm2_immr->im_intctl.ic_simrh); 130 + simr = &(cpm2_intctl->ic_simrh); 131 131 ppc_cached_irq_mask[word] |= 1 << bit; 132 132 simr[word] = ppc_cached_irq_mask[word]; 133 133 /* ··· 152 152 int irq; 153 153 unsigned long bits; 154 154 155 - /* For CPM2, read the SIVEC register and shift the bits down 156 - * to get the irq number.*/ 157 - bits = cpm2_immr->im_intctl.ic_sivec; 158 - irq = bits >> 26; 155 + /* For CPM2, read the SIVEC register and shift the bits down 156 + * to get the irq number. */ 157 + bits = cpm2_intctl->ic_sivec; 158 + irq = bits >> 26; 159 159 160 160 if (irq == 0) 161 161 return(-1); ··· 223 223 224 224 /* Mask out everything */ 225 225 226 - cpm2_immr->im_intctl.ic_simrh = 0x00000000; 227 - cpm2_immr->im_intctl.ic_simrl = 0x00000000; 226 + cpm2_intctl->ic_simrh = 0x00000000; 227 + cpm2_intctl->ic_simrl = 0x00000000; 228 228 229 229 wmb(); 230 230 231 231 /* Ack everything */ 232 - cpm2_immr->im_intctl.ic_sipnrh = 0xffffffff; 233 - cpm2_immr->im_intctl.ic_sipnrl = 0xffffffff; 232 + cpm2_intctl->ic_sipnrh = 0xffffffff; 233 + cpm2_intctl->ic_sipnrl = 0xffffffff; 234 234 wmb(); 235 235 236 236 /* Dummy read of the vector */ 237 - i = cpm2_immr->im_intctl.ic_sivec; 237 + i = cpm2_intctl->ic_sivec; 238 238 rmb(); 239 239 240 240 /* Initialize the default interrupt mapping priorities, 241 241 * in case the boot rom changed something on us. 242 242 */ 243 - cpm2_immr->im_intctl.ic_sicr = 0; 244 - cpm2_immr->im_intctl.ic_scprrh = 0x05309770; 245 - cpm2_immr->im_intctl.ic_scprrl = 0x05309770; 243 + cpm2_intctl->ic_sicr = 0; 244 + cpm2_intctl->ic_scprrh = 0x05309770; 245 + cpm2_intctl->ic_scprrl = 0x05309770; 246 246 247 247 /* create a legacy host */ 248 248 if (node)
+2
arch/powerpc/sysdev/cpm2_pic.h
··· 1 1 #ifndef _PPC_KERNEL_CPM2_H 2 2 #define _PPC_KERNEL_CPM2_H 3 3 4 + extern intctl_cpm2_t *cpm2_intctl; 5 + 4 6 extern int cpm2_get_irq(struct pt_regs *regs); 5 7 6 8 extern void cpm2_pic_init(struct device_node*);
+1 -1
arch/powerpc/sysdev/fsl_soc.c
··· 633 633 if (strstr(model, "FCC")) { 634 634 int fcc_index = fs_get_fcc_index(*id); 635 635 636 - fs_enet_data.dpram_offset = (u32)cpm2_immr->im_dprambase; 636 + fs_enet_data.dpram_offset = (u32)cpm_dpram_addr(0); 637 637 fs_enet_data.rx_ring = 32; 638 638 fs_enet_data.tx_ring = 32; 639 639 fs_enet_data.rx_copybreak = 240;
+87 -43
drivers/serial/cpm_uart/cpm_uart_cpm2.c
··· 51 51 52 52 void cpm_line_cr_cmd(int line, int cmd) 53 53 { 54 - volatile cpm_cpm2_t *cp = cpmp; 55 54 ulong val; 55 + volatile cpm_cpm2_t *cp = cpm2_map(im_cpm); 56 + 56 57 57 58 switch (line) { 58 59 case UART_SMC1: ··· 86 85 } 87 86 cp->cp_cpcr = val; 88 87 while (cp->cp_cpcr & CPM_CR_FLG) ; 88 + 89 + cpm2_unmap(cp); 89 90 } 90 91 91 92 void smc1_lineif(struct uart_cpm_port *pinfo) 92 93 { 93 - volatile iop_cpm2_t *io = &cpm2_immr->im_ioport; 94 + volatile iop_cpm2_t *io = cpm2_map(im_ioport); 95 + volatile cpmux_t *cpmux = cpm2_map(im_cpmux); 94 96 95 97 /* SMC1 is only on port D */ 96 98 io->iop_ppard |= 0x00c00000; ··· 102 98 io->iop_psord &= ~0x00c00000; 103 99 104 100 /* Wire BRG1 to SMC1 */ 105 - cpm2_immr->im_cpmux.cmx_smr &= 0x0f; 101 + cpmux->cmx_smr &= 0x0f; 106 102 pinfo->brg = 1; 103 + 104 + cpm2_unmap(cpmux); 105 + cpm2_unmap(io); 107 106 } 108 107 109 108 void smc2_lineif(struct uart_cpm_port *pinfo) 110 109 { 111 - volatile iop_cpm2_t *io = &cpm2_immr->im_ioport; 110 + volatile iop_cpm2_t *io = cpm2_map(im_ioport); 111 + volatile cpmux_t *cpmux = cpm2_map(im_cpmux); 112 112 113 113 /* SMC2 is only on port A */ 114 114 io->iop_ppara |= 0x00c00000; ··· 121 113 io->iop_psora &= ~0x00c00000; 122 114 123 115 /* Wire BRG2 to SMC2 */ 124 - cpm2_immr->im_cpmux.cmx_smr &= 0xf0; 116 + cpmux->cmx_smr &= 0xf0; 125 117 pinfo->brg = 2; 118 + 119 + cpm2_unmap(cpmux); 120 + cpm2_unmap(io); 126 121 } 127 122 128 123 void scc1_lineif(struct uart_cpm_port *pinfo) 129 124 { 130 - volatile iop_cpm2_t *io = &cpm2_immr->im_ioport; 125 + volatile iop_cpm2_t *io = cpm2_map(im_ioport); 126 + volatile cpmux_t *cpmux = cpm2_map(im_cpmux); 131 127 132 128 /* Use Port D for SCC1 instead of other functions. */ 133 129 io->iop_ppard |= 0x00000003; ··· 141 129 io->iop_pdird |= 0x00000002; /* Tx */ 142 130 143 131 /* Wire BRG1 to SCC1 */ 144 - cpm2_immr->im_cpmux.cmx_scr &= 0x00ffffff; 145 - cpm2_immr->im_cpmux.cmx_scr |= 0x00000000; 132 + cpmux->cmx_scr &= 0x00ffffff; 133 + cpmux->cmx_scr |= 0x00000000; 146 134 pinfo->brg = 1; 135 + 136 + cpm2_unmap(cpmux); 137 + cpm2_unmap(io); 147 138 } 148 139 149 140 void scc2_lineif(struct uart_cpm_port *pinfo) ··· 159 144 * be supported in a sane fashion. 160 145 */ 161 146 #ifndef CONFIG_STX_GP3 162 - volatile iop_cpm2_t *io = &cpm2_immr->im_ioport; 147 + volatile iop_cpm2_t *io = cpm2_map(im_ioport); 148 + volatile cpmux_t *cpmux = cpm2_map(im_cpmux); 149 + 163 150 io->iop_pparb |= 0x008b0000; 164 151 io->iop_pdirb |= 0x00880000; 165 152 io->iop_psorb |= 0x00880000; 166 153 io->iop_pdirb &= ~0x00030000; 167 154 io->iop_psorb &= ~0x00030000; 168 155 #endif 169 - cpm2_immr->im_cpmux.cmx_scr &= 0xff00ffff; 170 - cpm2_immr->im_cpmux.cmx_scr |= 0x00090000; 156 + cpmux->cmx_scr &= 0xff00ffff; 157 + cpmux->cmx_scr |= 0x00090000; 171 158 pinfo->brg = 2; 159 + 160 + cpm2_unmap(cpmux); 161 + cpm2_unmap(io); 172 162 } 173 163 174 164 void scc3_lineif(struct uart_cpm_port *pinfo) 175 165 { 176 - volatile iop_cpm2_t *io = &cpm2_immr->im_ioport; 166 + volatile iop_cpm2_t *io = cpm2_map(im_ioport); 167 + volatile cpmux_t *cpmux = cpm2_map(im_cpmux); 168 + 177 169 io->iop_pparb |= 0x008b0000; 178 170 io->iop_pdirb |= 0x00880000; 179 171 io->iop_psorb |= 0x00880000; 180 172 io->iop_pdirb &= ~0x00030000; 181 173 io->iop_psorb &= ~0x00030000; 182 - cpm2_immr->im_cpmux.cmx_scr &= 0xffff00ff; 183 - cpm2_immr->im_cpmux.cmx_scr |= 0x00001200; 174 + cpmux->cmx_scr &= 0xffff00ff; 175 + cpmux->cmx_scr |= 0x00001200; 184 176 pinfo->brg = 3; 177 + 178 + cpm2_unmap(cpmux); 179 + cpm2_unmap(io); 185 180 } 186 181 187 182 void scc4_lineif(struct uart_cpm_port *pinfo) 188 183 { 189 - volatile iop_cpm2_t *io = &cpm2_immr->im_ioport; 184 + volatile iop_cpm2_t *io = cpm2_map(im_ioport); 185 + volatile cpmux_t *cpmux = cpm2_map(im_cpmux); 190 186 191 187 io->iop_ppard |= 0x00000600; 192 188 io->iop_psord &= ~0x00000600; /* Tx/Rx */ 193 189 io->iop_pdird &= ~0x00000200; /* Rx */ 194 190 io->iop_pdird |= 0x00000400; /* Tx */ 195 191 196 - cpm2_immr->im_cpmux.cmx_scr &= 0xffffff00; 197 - cpm2_immr->im_cpmux.cmx_scr |= 0x0000001b; 192 + cpmux->cmx_scr &= 0xffffff00; 193 + cpmux->cmx_scr |= 0x0000001b; 198 194 pinfo->brg = 4; 195 + 196 + cpm2_unmap(cpmux); 197 + cpm2_unmap(io); 199 198 } 200 199 201 200 /* ··· 284 255 /* Setup any dynamic params in the uart desc */ 285 256 int cpm_uart_init_portdesc(void) 286 257 { 258 + #if defined(CONFIG_SERIAL_CPM_SMC1) || defined(CONFIG_SERIAL_CPM_SMC2) 259 + u32 addr; 260 + #endif 287 261 pr_debug("CPM uart[-]:init portdesc\n"); 288 262 289 263 cpm_uart_nr = 0; 290 264 #ifdef CONFIG_SERIAL_CPM_SMC1 291 - cpm_uart_ports[UART_SMC1].smcp = (smc_t *) & cpm2_immr->im_smc[0]; 292 - cpm_uart_ports[UART_SMC1].smcup = 293 - (smc_uart_t *) & cpm2_immr->im_dprambase[PROFF_SMC1]; 294 - *(u16 *)(&cpm2_immr->im_dprambase[PROFF_SMC1_BASE]) = PROFF_SMC1; 265 + cpm_uart_ports[UART_SMC1].smcp = (smc_t *) cpm2_map(im_smc[0]); 295 266 cpm_uart_ports[UART_SMC1].port.mapbase = 296 - (unsigned long)&cpm2_immr->im_smc[0]; 267 + (unsigned long)cpm_uart_ports[UART_SMC1].smcp; 268 + 269 + cpm_uart_ports[UART_SMC1].smcup = 270 + (smc_uart_t *) cpm2_map_size(im_dprambase[PROFF_SMC1], PROFF_SMC_SIZE); 271 + addr = (u16 *)cpm2_map_size(im_dprambase[PROFF_SMC1_BASE], 2); 272 + *addr = PROFF_SMC1; 273 + cpm2_unmap(addr); 274 + 297 275 cpm_uart_ports[UART_SMC1].smcp->smc_smcm |= (SMCM_RX | SMCM_TX); 298 276 cpm_uart_ports[UART_SMC1].smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); 299 277 cpm_uart_ports[UART_SMC1].port.uartclk = uart_clock(); ··· 308 272 #endif 309 273 310 274 #ifdef CONFIG_SERIAL_CPM_SMC2 311 - cpm_uart_ports[UART_SMC2].smcp = (smc_t *) & cpm2_immr->im_smc[1]; 312 - cpm_uart_ports[UART_SMC2].smcup = 313 - (smc_uart_t *) & cpm2_immr->im_dprambase[PROFF_SMC2]; 314 - *(u16 *)(&cpm2_immr->im_dprambase[PROFF_SMC2_BASE]) = PROFF_SMC2; 275 + cpm_uart_ports[UART_SMC2].smcp = (smc_t *) cpm2_map(im_smc[1]); 315 276 cpm_uart_ports[UART_SMC2].port.mapbase = 316 - (unsigned long)&cpm2_immr->im_smc[1]; 277 + (unsigned long)cpm_uart_ports[UART_SMC2].smcp; 278 + 279 + cpm_uart_ports[UART_SMC2].smcup = 280 + (smc_uart_t *) cpm2_map_size(im_dprambase[PROFF_SMC2], PROFF_SMC_SIZE); 281 + addr = (u16 *)cpm2_map_size(im_dprambase[PROFF_SMC2_BASE], 2); 282 + *addr = PROFF_SMC2; 283 + cpm2_unmap(addr); 284 + 317 285 cpm_uart_ports[UART_SMC2].smcp->smc_smcm |= (SMCM_RX | SMCM_TX); 318 286 cpm_uart_ports[UART_SMC2].smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); 319 287 cpm_uart_ports[UART_SMC2].port.uartclk = uart_clock(); ··· 325 285 #endif 326 286 327 287 #ifdef CONFIG_SERIAL_CPM_SCC1 328 - cpm_uart_ports[UART_SCC1].sccp = (scc_t *) & cpm2_immr->im_scc[0]; 329 - cpm_uart_ports[UART_SCC1].sccup = 330 - (scc_uart_t *) & cpm2_immr->im_dprambase[PROFF_SCC1]; 288 + cpm_uart_ports[UART_SCC1].sccp = (scc_t *) cpm2_map(im_scc[0]); 331 289 cpm_uart_ports[UART_SCC1].port.mapbase = 332 - (unsigned long)&cpm2_immr->im_scc[0]; 290 + (unsigned long)cpm_uart_ports[UART_SCC1].sccp; 291 + cpm_uart_ports[UART_SCC1].sccup = 292 + (scc_uart_t *) cpm2_map_size(im_dprambase[PROFF_SCC1], PROFF_SCC_SIZE); 293 + 333 294 cpm_uart_ports[UART_SCC1].sccp->scc_sccm &= 334 295 ~(UART_SCCM_TX | UART_SCCM_RX); 335 296 cpm_uart_ports[UART_SCC1].sccp->scc_gsmrl &= ··· 340 299 #endif 341 300 342 301 #ifdef CONFIG_SERIAL_CPM_SCC2 343 - cpm_uart_ports[UART_SCC2].sccp = (scc_t *) & cpm2_immr->im_scc[1]; 344 - cpm_uart_ports[UART_SCC2].sccup = 345 - (scc_uart_t *) & cpm2_immr->im_dprambase[PROFF_SCC2]; 302 + cpm_uart_ports[UART_SCC2].sccp = (scc_t *) cpm2_map(im_scc[1]); 346 303 cpm_uart_ports[UART_SCC2].port.mapbase = 347 - (unsigned long)&cpm2_immr->im_scc[1]; 304 + (unsigned long)cpm_uart_ports[UART_SCC2].sccp; 305 + cpm_uart_ports[UART_SCC2].sccup = 306 + (scc_uart_t *) cpm2_map_size(im_dprambase[PROFF_SCC2], PROFF_SCC_SIZE); 307 + 348 308 cpm_uart_ports[UART_SCC2].sccp->scc_sccm &= 349 309 ~(UART_SCCM_TX | UART_SCCM_RX); 350 310 cpm_uart_ports[UART_SCC2].sccp->scc_gsmrl &= ··· 355 313 #endif 356 314 357 315 #ifdef CONFIG_SERIAL_CPM_SCC3 358 - cpm_uart_ports[UART_SCC3].sccp = (scc_t *) & cpm2_immr->im_scc[2]; 359 - cpm_uart_ports[UART_SCC3].sccup = 360 - (scc_uart_t *) & cpm2_immr->im_dprambase[PROFF_SCC3]; 316 + cpm_uart_ports[UART_SCC3].sccp = (scc_t *) cpm2_map(im_scc[2]); 361 317 cpm_uart_ports[UART_SCC3].port.mapbase = 362 - (unsigned long)&cpm2_immr->im_scc[2]; 318 + (unsigned long)cpm_uart_ports[UART_SCC3].sccp; 319 + cpm_uart_ports[UART_SCC3].sccup = 320 + (scc_uart_t *) cpm2_map_size(im_dprambase[PROFF_SCC3], PROFF_SCC_SIZE); 321 + 363 322 cpm_uart_ports[UART_SCC3].sccp->scc_sccm &= 364 323 ~(UART_SCCM_TX | UART_SCCM_RX); 365 324 cpm_uart_ports[UART_SCC3].sccp->scc_gsmrl &= ··· 370 327 #endif 371 328 372 329 #ifdef CONFIG_SERIAL_CPM_SCC4 373 - cpm_uart_ports[UART_SCC4].sccp = (scc_t *) & cpm2_immr->im_scc[3]; 374 - cpm_uart_ports[UART_SCC4].sccup = 375 - (scc_uart_t *) & cpm2_immr->im_dprambase[PROFF_SCC4]; 330 + cpm_uart_ports[UART_SCC4].sccp = (scc_t *) cpm2_map(im_scc[3]); 376 331 cpm_uart_ports[UART_SCC4].port.mapbase = 377 - (unsigned long)&cpm2_immr->im_scc[3]; 332 + (unsigned long)cpm_uart_ports[UART_SCC4].sccp; 333 + cpm_uart_ports[UART_SCC4].sccup = 334 + (scc_uart_t *) cpm2_map_size(im_dprambase[PROFF_SCC4], PROFF_SCC_SIZE); 335 + 378 336 cpm_uart_ports[UART_SCC4].sccp->scc_sccm &= 379 337 ~(UART_SCCM_TX | UART_SCCM_RX); 380 338 cpm_uart_ports[UART_SCC4].sccp->scc_gsmrl &=
+1 -1
drivers/serial/cpm_uart/cpm_uart_cpm2.h
··· 40 40 up->smc_tfcr = CPMFCR_GBL | CPMFCR_EB; 41 41 } 42 42 43 - #define DPRAM_BASE ((unsigned char *)&cpm2_immr->im_dprambase[0]) 43 + #define DPRAM_BASE ((unsigned char *)cpm_dpram_addr(0)) 44 44 45 45 #endif
+18
include/asm-powerpc/fs_pd.h
··· 11 11 12 12 #ifndef FS_PD_H 13 13 #define FS_PD_H 14 + #include <asm/cpm2.h> 14 15 #include <sysdev/fsl_soc.h> 15 16 #include <asm/time.h> 16 17 ··· 24 23 { 25 24 return ppc_proc_freq; 26 25 } 26 + 27 + #define cpm2_map(member) \ 28 + ({ \ 29 + u32 offset = offsetof(cpm2_map_t, member); \ 30 + void *addr = ioremap (CPM_MAP_ADDR + offset, \ 31 + sizeof( ((cpm2_map_t*)0)->member)); \ 32 + addr; \ 33 + }) 34 + 35 + #define cpm2_map_size(member, size) \ 36 + ({ \ 37 + u32 offset = offsetof(cpm2_map_t, member); \ 38 + void *addr = ioremap (CPM_MAP_ADDR + offset, size); \ 39 + addr; \ 40 + }) 41 + 42 + #define cpm2_unmap(addr) iounmap(addr) 27 43 28 44 #endif
+4
include/asm-ppc/cpm2.h
··· 177 177 #define PROFF_I2C_BASE ((uint)0x8afc) 178 178 #define PROFF_IDMA4_BASE ((uint)0x8afe) 179 179 180 + #define PROFF_SCC_SIZE ((uint)0x100) 181 + #define PROFF_FCC_SIZE ((uint)0x100) 182 + #define PROFF_SMC_SIZE ((uint)64) 183 + 180 184 /* The SMCs are relocated to any of the first eight DPRAM pages. 181 185 * We will fix these at the first locations of DPRAM, until we 182 186 * get some microcode patches :-).
+4
include/asm-ppc/fs_pd.h
··· 29 29 return (((bd_t *) __res)->bi_intfreq); 30 30 } 31 31 32 + #define cpm2_map(member) (&cpm2_immr->member) 33 + #define cpm2_map_size(member, size) (&cpm2_immr->member) 34 + #define cpm2_unmap(addr) do {} while(0) 35 + 32 36 #endif