diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-08-03 10:09:35 -0400 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-09-27 09:46:29 -0400 |
commit | a8a05b855291defb1d97a1c3681480e4ca330254 (patch) | |
tree | 387aa9909aa1b08ed56eccafe2ade13e3d2778e1 /arch/arm/plat-mxc | |
parent | 68b5e858dde8dcb0413b7c1d699c1056ecc0934d (diff) |
ARM: mx51: use IMX_IO_ADDRESS to define MX51_IO_ADDRESS
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mx51.h | 53 |
1 files changed, 11 insertions, 42 deletions
diff --git a/arch/arm/plat-mxc/include/mach/mx51.h b/arch/arm/plat-mxc/include/mach/mx51.h index d0fda396adf2..f6026506c5ef 100644 --- a/arch/arm/plat-mxc/include/mach/mx51.h +++ b/arch/arm/plat-mxc/include/mach/mx51.h | |||
@@ -163,6 +163,17 @@ | |||
163 | #define MX51_GPU2D_BASE_ADDR 0xd0000000 | 163 | #define MX51_GPU2D_BASE_ADDR 0xd0000000 |
164 | #define MX51_TZIC_BASE_ADDR 0xe0000000 | 164 | #define MX51_TZIC_BASE_ADDR 0xe0000000 |
165 | 165 | ||
166 | #define MX51_IO_ADDRESS(x) ( \ | ||
167 | IMX_IO_ADDRESS(x, MX51_IRAM) ?: \ | ||
168 | IMX_IO_ADDRESS(x, MX51_DEBUG) ?: \ | ||
169 | IMX_IO_ADDRESS(x, MX51_SPBA0) ?: \ | ||
170 | IMX_IO_ADDRESS(x, MX51_AIPS1) ?: \ | ||
171 | IMX_IO_ADDRESS(x, MX51_AIPS2)) | ||
172 | |||
173 | /* This is currently used in <mach/debug-macro.S>, but should go away */ | ||
174 | #define MX51_AIPS1_IO_ADDRESS(x) \ | ||
175 | (((x) - MX51_AIPS1_BASE_ADDR) + MX51_AIPS1_BASE_ADDR_VIRT) | ||
176 | |||
166 | /* | 177 | /* |
167 | * defines for SPBA modules | 178 | * defines for SPBA modules |
168 | */ | 179 | */ |
@@ -210,48 +221,6 @@ | |||
210 | #define MX51_MXC_DMA_CHANNEL_ATA_TX MXC_DMA_DYNAMIC_CHANNEL | 221 | #define MX51_MXC_DMA_CHANNEL_ATA_TX MXC_DMA_DYNAMIC_CHANNEL |
211 | #define MX51_MXC_DMA_CHANNEL_MEMORY MXC_DMA_DYNAMIC_CHANNEL | 222 | #define MX51_MXC_DMA_CHANNEL_MEMORY MXC_DMA_DYNAMIC_CHANNEL |
212 | 223 | ||
213 | /* Does given address belongs to the specified memory region? */ | ||
214 | #define ADDRESS_IN_REGION(addr, start, size) \ | ||
215 | (((addr) >= (start)) && ((addr) < (start)+(size))) | ||
216 | |||
217 | /* Does given address belongs to the specified named `module'? */ | ||
218 | #define MX51_IS_MODULE(addr, module) \ | ||
219 | ADDRESS_IN_REGION(addr, MX51_ ## module ## _BASE_ADDR, \ | ||
220 | MX51_ ## module ## _SIZE) | ||
221 | /* | ||
222 | * This macro defines the physical to virtual address mapping for all the | ||
223 | * peripheral modules. It is used by passing in the physical address as x | ||
224 | * and returning the virtual address. If the physical address is not mapped, | ||
225 | * it returns 0xdeadbeef | ||
226 | */ | ||
227 | |||
228 | #define MX51_IO_ADDRESS(x) \ | ||
229 | (void __iomem *) \ | ||
230 | (MX51_IS_MODULE(x, IRAM) ? MX51_IRAM_IO_ADDRESS(x) : \ | ||
231 | MX51_IS_MODULE(x, DEBUG) ? MX51_DEBUG_IO_ADDRESS(x) : \ | ||
232 | MX51_IS_MODULE(x, SPBA0) ? MX51_SPBA0_IO_ADDRESS(x) : \ | ||
233 | MX51_IS_MODULE(x, AIPS1) ? MX51_AIPS1_IO_ADDRESS(x) : \ | ||
234 | MX51_IS_MODULE(x, AIPS2) ? MX51_AIPS2_IO_ADDRESS(x) : \ | ||
235 | 0xdeadbeef) | ||
236 | |||
237 | /* | ||
238 | * define the address mapping macros: in physical address order | ||
239 | */ | ||
240 | #define MX51_IRAM_IO_ADDRESS(x) \ | ||
241 | (((x) - MX51_IRAM_BASE_ADDR) + MX51_IRAM_BASE_ADDR_VIRT) | ||
242 | |||
243 | #define MX51_DEBUG_IO_ADDRESS(x) \ | ||
244 | (((x) - MX51_DEBUG_BASE_ADDR) + MX51_DEBUG_BASE_ADDR_VIRT) | ||
245 | |||
246 | #define MX51_SPBA0_IO_ADDRESS(x) \ | ||
247 | (((x) - MX51_SPBA0_BASE_ADDR) + MX51_SPBA0_BASE_ADDR_VIRT) | ||
248 | |||
249 | #define MX51_AIPS1_IO_ADDRESS(x) \ | ||
250 | (((x) - MX51_AIPS1_BASE_ADDR) + MX51_AIPS1_BASE_ADDR_VIRT) | ||
251 | |||
252 | #define MX51_AIPS2_IO_ADDRESS(x) \ | ||
253 | (((x) - MX51_AIPS2_BASE_ADDR) + MX51_AIPS2_BASE_ADDR_VIRT) | ||
254 | |||
255 | #define MX51_IS_MEM_DEVICE_NONSHARED(x) 0 | 224 | #define MX51_IS_MEM_DEVICE_NONSHARED(x) 0 |
256 | 225 | ||
257 | /* | 226 | /* |