diff options
| author | Catalin Marinas <catalin.marinas@arm.com> | 2008-02-04 11:36:59 -0500 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-02-04 12:52:23 -0500 |
| commit | 0fc2a1616f37175ff0cf54b99e9b76f7717a3f10 (patch) | |
| tree | 1fa8ed4649854a628292b2f4c8a0e14e086822b4 | |
| parent | 356cb470b84bda67738ba320a75629acae70e5fa (diff) | |
[ARM] 4817/1: RealView: Move the AMBA resource definitions to realview_eb.c
This patch moves the IRQ and DMA definitions from core.h into
realview_eb.c since they are platform-specific. It adds a
realview_eb11mp_fixup function to adjust the IRQ numbers if the
ARM11MPCore tile is fitted. The realview_smc91x_device is also moved
from core.c into realview_eb.c.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| -rw-r--r-- | arch/arm/mach-realview/core.c | 20 | ||||
| -rw-r--r-- | arch/arm/mach-realview/core.h | 63 | ||||
| -rw-r--r-- | arch/arm/mach-realview/realview_eb.c | 123 |
3 files changed, 123 insertions, 83 deletions
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 8cabfec31da2..046d31ce27b0 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
| @@ -123,26 +123,6 @@ struct platform_device realview_flash_device = { | |||
| 123 | .resource = &realview_flash_resource, | 123 | .resource = &realview_flash_resource, |
| 124 | }; | 124 | }; |
| 125 | 125 | ||
| 126 | static struct resource realview_smc91x_resources[] = { | ||
| 127 | [0] = { | ||
| 128 | .start = REALVIEW_ETH_BASE, | ||
| 129 | .end = REALVIEW_ETH_BASE + SZ_64K - 1, | ||
| 130 | .flags = IORESOURCE_MEM, | ||
| 131 | }, | ||
| 132 | [1] = { | ||
| 133 | .start = IRQ_ETH, | ||
| 134 | .end = IRQ_ETH, | ||
| 135 | .flags = IORESOURCE_IRQ, | ||
| 136 | }, | ||
| 137 | }; | ||
| 138 | |||
| 139 | struct platform_device realview_smc91x_device = { | ||
| 140 | .name = "smc91x", | ||
| 141 | .id = 0, | ||
| 142 | .num_resources = ARRAY_SIZE(realview_smc91x_resources), | ||
| 143 | .resource = realview_smc91x_resources, | ||
| 144 | }; | ||
| 145 | |||
| 146 | static struct resource realview_i2c_resource = { | 126 | static struct resource realview_i2c_resource = { |
| 147 | .start = REALVIEW_I2C_BASE, | 127 | .start = REALVIEW_I2C_BASE, |
| 148 | .end = REALVIEW_I2C_BASE + SZ_4K - 1, | 128 | .end = REALVIEW_I2C_BASE + SZ_4K - 1, |
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h index 2b53420f9c1b..9206db7b80bc 100644 --- a/arch/arm/mach-realview/core.h +++ b/arch/arm/mach-realview/core.h | |||
| @@ -38,7 +38,7 @@ static struct amba_device name##_device = { \ | |||
| 38 | }, \ | 38 | }, \ |
| 39 | .res = { \ | 39 | .res = { \ |
| 40 | .start = REALVIEW_##base##_BASE, \ | 40 | .start = REALVIEW_##base##_BASE, \ |
| 41 | .end = (REALVIEW_##base##_BASE) + SZ_4K - 1,\ | 41 | .end = (REALVIEW_##base##_BASE) + SZ_4K - 1, \ |
| 42 | .flags = IORESOURCE_MEM, \ | 42 | .flags = IORESOURCE_MEM, \ |
| 43 | }, \ | 43 | }, \ |
| 44 | .dma_mask = ~0, \ | 44 | .dma_mask = ~0, \ |
| @@ -46,68 +46,7 @@ static struct amba_device name##_device = { \ | |||
| 46 | /* .dma = base##_DMA,*/ \ | 46 | /* .dma = base##_DMA,*/ \ |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | /* | ||
| 50 | * These devices are connected via the core APB bridge | ||
| 51 | */ | ||
| 52 | #define GPIO2_IRQ { IRQ_GPIOINT2, NO_IRQ } | ||
| 53 | #define GPIO2_DMA { 0, 0 } | ||
| 54 | #define GPIO3_IRQ { IRQ_GPIOINT3, NO_IRQ } | ||
| 55 | #define GPIO3_DMA { 0, 0 } | ||
| 56 | |||
| 57 | #define AACI_IRQ { IRQ_AACI, NO_IRQ } | ||
| 58 | #define AACI_DMA { 0x80, 0x81 } | ||
| 59 | #define MMCI0_IRQ { IRQ_MMCI0A,IRQ_MMCI0B } | ||
| 60 | #define MMCI0_DMA { 0x84, 0 } | ||
| 61 | #define KMI0_IRQ { IRQ_KMI0, NO_IRQ } | ||
| 62 | #define KMI0_DMA { 0, 0 } | ||
| 63 | #define KMI1_IRQ { IRQ_KMI1, NO_IRQ } | ||
| 64 | #define KMI1_DMA { 0, 0 } | ||
| 65 | |||
| 66 | /* | ||
| 67 | * These devices are connected directly to the multi-layer AHB switch | ||
| 68 | */ | ||
| 69 | #define SMC_IRQ { NO_IRQ, NO_IRQ } | ||
| 70 | #define SMC_DMA { 0, 0 } | ||
| 71 | #define MPMC_IRQ { NO_IRQ, NO_IRQ } | ||
| 72 | #define MPMC_DMA { 0, 0 } | ||
| 73 | #define CLCD_IRQ { IRQ_CLCDINT, NO_IRQ } | ||
| 74 | #define CLCD_DMA { 0, 0 } | ||
| 75 | #define DMAC_IRQ { IRQ_DMAINT, NO_IRQ } | ||
| 76 | #define DMAC_DMA { 0, 0 } | ||
| 77 | |||
| 78 | /* | ||
| 79 | * These devices are connected via the core APB bridge | ||
| 80 | */ | ||
| 81 | #define SCTL_IRQ { NO_IRQ, NO_IRQ } | ||
| 82 | #define SCTL_DMA { 0, 0 } | ||
| 83 | #define WATCHDOG_IRQ { IRQ_WDOGINT, NO_IRQ } | ||
| 84 | #define WATCHDOG_DMA { 0, 0 } | ||
| 85 | #define GPIO0_IRQ { IRQ_GPIOINT0, NO_IRQ } | ||
| 86 | #define GPIO0_DMA { 0, 0 } | ||
| 87 | #define GPIO1_IRQ { IRQ_GPIOINT1, NO_IRQ } | ||
| 88 | #define GPIO1_DMA { 0, 0 } | ||
| 89 | #define RTC_IRQ { IRQ_RTCINT, NO_IRQ } | ||
| 90 | #define RTC_DMA { 0, 0 } | ||
| 91 | |||
| 92 | /* | ||
| 93 | * These devices are connected via the DMA APB bridge | ||
| 94 | */ | ||
| 95 | #define SCI_IRQ { IRQ_SCIINT, NO_IRQ } | ||
| 96 | #define SCI_DMA { 7, 6 } | ||
| 97 | #define UART0_IRQ { IRQ_UARTINT0, NO_IRQ } | ||
| 98 | #define UART0_DMA { 15, 14 } | ||
| 99 | #define UART1_IRQ { IRQ_UARTINT1, NO_IRQ } | ||
| 100 | #define UART1_DMA { 13, 12 } | ||
| 101 | #define UART2_IRQ { IRQ_UARTINT2, NO_IRQ } | ||
| 102 | #define UART2_DMA { 11, 10 } | ||
| 103 | #define UART3_IRQ { IRQ_UART3, NO_IRQ } | ||
| 104 | #define UART3_DMA { 0x86, 0x87 } | ||
| 105 | #define SSP_IRQ { IRQ_SSPINT, NO_IRQ } | ||
| 106 | #define SSP_DMA { 9, 8 } | ||
| 107 | |||
| 108 | |||
| 109 | extern struct platform_device realview_flash_device; | 49 | extern struct platform_device realview_flash_device; |
| 110 | extern struct platform_device realview_smc91x_device; | ||
| 111 | extern struct platform_device realview_i2c_device; | 50 | extern struct platform_device realview_i2c_device; |
| 112 | extern struct mmc_platform_data realview_mmc0_plat_data; | 51 | extern struct mmc_platform_data realview_mmc0_plat_data; |
| 113 | extern struct mmc_platform_data realview_mmc1_plat_data; | 52 | extern struct mmc_platform_data realview_mmc1_plat_data; |
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index 9c992568ee40..afcf27ceac57 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c | |||
| @@ -109,6 +109,69 @@ static void __init realview_eb_map_io(void) | |||
| 109 | iotable_init(realview_eb_io_desc, ARRAY_SIZE(realview_eb_io_desc)); | 109 | iotable_init(realview_eb_io_desc, ARRAY_SIZE(realview_eb_io_desc)); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | /* | ||
| 113 | * RealView EB AMBA devices | ||
| 114 | */ | ||
| 115 | |||
| 116 | /* | ||
| 117 | * These devices are connected via the core APB bridge | ||
| 118 | */ | ||
| 119 | #define GPIO2_IRQ { IRQ_EB_GPIO2, NO_IRQ } | ||
| 120 | #define GPIO2_DMA { 0, 0 } | ||
| 121 | #define GPIO3_IRQ { IRQ_EB_GPIO3, NO_IRQ } | ||
| 122 | #define GPIO3_DMA { 0, 0 } | ||
| 123 | |||
| 124 | #define AACI_IRQ { IRQ_EB_AACI, NO_IRQ } | ||
| 125 | #define AACI_DMA { 0x80, 0x81 } | ||
| 126 | #define MMCI0_IRQ { IRQ_EB_MMCI0A, IRQ_EB_MMCI0B } | ||
| 127 | #define MMCI0_DMA { 0x84, 0 } | ||
| 128 | #define KMI0_IRQ { IRQ_EB_KMI0, NO_IRQ } | ||
| 129 | #define KMI0_DMA { 0, 0 } | ||
| 130 | #define KMI1_IRQ { IRQ_EB_KMI1, NO_IRQ } | ||
| 131 | #define KMI1_DMA { 0, 0 } | ||
| 132 | |||
| 133 | /* | ||
| 134 | * These devices are connected directly to the multi-layer AHB switch | ||
| 135 | */ | ||
| 136 | #define SMC_IRQ { NO_IRQ, NO_IRQ } | ||
| 137 | #define SMC_DMA { 0, 0 } | ||
| 138 | #define MPMC_IRQ { NO_IRQ, NO_IRQ } | ||
| 139 | #define MPMC_DMA { 0, 0 } | ||
| 140 | #define CLCD_IRQ { IRQ_EB_CLCD, NO_IRQ } | ||
| 141 | #define CLCD_DMA { 0, 0 } | ||
| 142 | #define DMAC_IRQ { IRQ_EB_DMA, NO_IRQ } | ||
| 143 | #define DMAC_DMA { 0, 0 } | ||
| 144 | |||
| 145 | /* | ||
| 146 | * These devices are connected via the core APB bridge | ||
| 147 | */ | ||
| 148 | #define SCTL_IRQ { NO_IRQ, NO_IRQ } | ||
| 149 | #define SCTL_DMA { 0, 0 } | ||
| 150 | #define WATCHDOG_IRQ { IRQ_EB_WDOG, NO_IRQ } | ||
| 151 | #define WATCHDOG_DMA { 0, 0 } | ||
| 152 | #define GPIO0_IRQ { IRQ_EB_GPIO0, NO_IRQ } | ||
| 153 | #define GPIO0_DMA { 0, 0 } | ||
| 154 | #define GPIO1_IRQ { IRQ_EB_GPIO1, NO_IRQ } | ||
| 155 | #define GPIO1_DMA { 0, 0 } | ||
| 156 | #define RTC_IRQ { IRQ_EB_RTC, NO_IRQ } | ||
| 157 | #define RTC_DMA { 0, 0 } | ||
| 158 | |||
| 159 | /* | ||
| 160 | * These devices are connected via the DMA APB bridge | ||
| 161 | */ | ||
| 162 | #define SCI_IRQ { IRQ_EB_SCI, NO_IRQ } | ||
| 163 | #define SCI_DMA { 7, 6 } | ||
| 164 | #define UART0_IRQ { IRQ_EB_UART0, NO_IRQ } | ||
| 165 | #define UART0_DMA { 15, 14 } | ||
| 166 | #define UART1_IRQ { IRQ_EB_UART1, NO_IRQ } | ||
| 167 | #define UART1_DMA { 13, 12 } | ||
| 168 | #define UART2_IRQ { IRQ_EB_UART2, NO_IRQ } | ||
| 169 | #define UART2_DMA { 11, 10 } | ||
| 170 | #define UART3_IRQ { IRQ_EB_UART3, NO_IRQ } | ||
| 171 | #define UART3_DMA { 0x86, 0x87 } | ||
| 172 | #define SSP_IRQ { IRQ_EB_SSP, NO_IRQ } | ||
| 173 | #define SSP_DMA { 9, 8 } | ||
| 174 | |||
| 112 | /* FPGA Primecells */ | 175 | /* FPGA Primecells */ |
| 113 | AMBA_DEVICE(aaci, "fpga:04", AACI, NULL); | 176 | AMBA_DEVICE(aaci, "fpga:04", AACI, NULL); |
| 114 | AMBA_DEVICE(mmc0, "fpga:05", MMCI0, &realview_mmc0_plat_data); | 177 | AMBA_DEVICE(mmc0, "fpga:05", MMCI0, &realview_mmc0_plat_data); |
| @@ -154,6 +217,30 @@ static struct amba_device *amba_devs[] __initdata = { | |||
| 154 | &kmi1_device, | 217 | &kmi1_device, |
| 155 | }; | 218 | }; |
| 156 | 219 | ||
| 220 | /* | ||
| 221 | * RealView EB platform devices | ||
| 222 | */ | ||
| 223 | |||
| 224 | static struct resource realview_eb_smc91x_resources[] = { | ||
| 225 | [0] = { | ||
| 226 | .start = REALVIEW_ETH_BASE, | ||
| 227 | .end = REALVIEW_ETH_BASE + SZ_64K - 1, | ||
| 228 | .flags = IORESOURCE_MEM, | ||
| 229 | }, | ||
| 230 | [1] = { | ||
| 231 | .start = IRQ_EB_ETH, | ||
| 232 | .end = IRQ_EB_ETH, | ||
| 233 | .flags = IORESOURCE_IRQ, | ||
| 234 | }, | ||
| 235 | }; | ||
| 236 | |||
| 237 | static struct platform_device realview_eb_smc91x_device = { | ||
| 238 | .name = "smc91x", | ||
| 239 | .id = 0, | ||
| 240 | .num_resources = ARRAY_SIZE(realview_eb_smc91x_resources), | ||
| 241 | .resource = realview_eb_smc91x_resources, | ||
| 242 | }; | ||
| 243 | |||
| 157 | static void __init gic_init_irq(void) | 244 | static void __init gic_init_irq(void) |
| 158 | { | 245 | { |
| 159 | #ifdef CONFIG_REALVIEW_MPCORE | 246 | #ifdef CONFIG_REALVIEW_MPCORE |
| @@ -173,11 +260,45 @@ static void __init gic_init_irq(void) | |||
| 173 | #endif | 260 | #endif |
| 174 | } | 261 | } |
| 175 | 262 | ||
| 263 | #ifdef CONFIG_REALVIEW_MPCORE | ||
| 264 | /* | ||
| 265 | * Fix up the IRQ numbers for the RealView EB/ARM11MPCore tile | ||
| 266 | */ | ||
| 267 | static void realview_eb11mp_fixup(void) | ||
| 268 | { | ||
| 269 | /* AMBA devices */ | ||
| 270 | dmac_device.irq[0] = IRQ_EB11MP_DMA; | ||
| 271 | uart0_device.irq[0] = IRQ_EB11MP_UART0; | ||
| 272 | uart1_device.irq[0] = IRQ_EB11MP_UART1; | ||
| 273 | uart2_device.irq[0] = IRQ_EB11MP_UART2; | ||
| 274 | uart3_device.irq[0] = IRQ_EB11MP_UART3; | ||
| 275 | clcd_device.irq[0] = IRQ_EB11MP_CLCD; | ||
| 276 | wdog_device.irq[0] = IRQ_EB11MP_WDOG; | ||
| 277 | gpio0_device.irq[0] = IRQ_EB11MP_GPIO0; | ||
| 278 | gpio1_device.irq[0] = IRQ_EB11MP_GPIO1; | ||
| 279 | gpio2_device.irq[0] = IRQ_EB11MP_GPIO2; | ||
| 280 | rtc_device.irq[0] = IRQ_EB11MP_RTC; | ||
| 281 | sci0_device.irq[0] = IRQ_EB11MP_SCI; | ||
| 282 | ssp0_device.irq[0] = IRQ_EB11MP_SSP; | ||
| 283 | aaci_device.irq[0] = IRQ_EB11MP_AACI; | ||
| 284 | mmc0_device.irq[0] = IRQ_EB11MP_MMCI0A; | ||
| 285 | mmc0_device.irq[1] = IRQ_EB11MP_MMCI0B; | ||
| 286 | kmi0_device.irq[0] = IRQ_EB11MP_KMI0; | ||
| 287 | kmi1_device.irq[0] = IRQ_EB11MP_KMI1; | ||
| 288 | |||
| 289 | /* platform devices */ | ||
| 290 | realview_eb_smc91x_resources[1].start = IRQ_EB11MP_ETH; | ||
| 291 | realview_eb_smc91x_resources[1].end = IRQ_EB11MP_ETH; | ||
| 292 | } | ||
| 293 | #endif | ||
| 294 | |||
| 176 | static void __init realview_eb_init(void) | 295 | static void __init realview_eb_init(void) |
| 177 | { | 296 | { |
| 178 | int i; | 297 | int i; |
| 179 | 298 | ||
| 180 | #ifdef CONFIG_REALVIEW_MPCORE | 299 | #ifdef CONFIG_REALVIEW_MPCORE |
| 300 | realview_eb11mp_fixup(); | ||
| 301 | |||
| 181 | /* 1MB (128KB/way), 8-way associativity, evmon/parity/share enabled | 302 | /* 1MB (128KB/way), 8-way associativity, evmon/parity/share enabled |
| 182 | * Bits: .... ...0 0111 1001 0000 .... .... .... */ | 303 | * Bits: .... ...0 0111 1001 0000 .... .... .... */ |
| 183 | l2x0_init(__io_address(REALVIEW_MPCORE_L220_BASE), 0x00790000, 0xfe000fff); | 304 | l2x0_init(__io_address(REALVIEW_MPCORE_L220_BASE), 0x00790000, 0xfe000fff); |
| @@ -185,7 +306,7 @@ static void __init realview_eb_init(void) | |||
| 185 | clk_register(&realview_clcd_clk); | 306 | clk_register(&realview_clcd_clk); |
| 186 | 307 | ||
| 187 | platform_device_register(&realview_flash_device); | 308 | platform_device_register(&realview_flash_device); |
| 188 | platform_device_register(&realview_smc91x_device); | 309 | platform_device_register(&realview_eb_smc91x_device); |
| 189 | platform_device_register(&realview_i2c_device); | 310 | platform_device_register(&realview_i2c_device); |
| 190 | 311 | ||
| 191 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 312 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { |
