Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/mach-realview/realview_pbx.c |
| 3 | * |
| 4 | * Copyright (C) 2009 ARM Limited |
| 5 | * Copyright (C) 2000 Deep Blue Solutions Ltd |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | */ |
| 20 | |
| 21 | #include <linux/init.h> |
| 22 | #include <linux/platform_device.h> |
Kay Sievers | edbaa60 | 2011-12-21 16:26:03 -0800 | [diff] [blame] | 23 | #include <linux/device.h> |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 24 | #include <linux/amba/bus.h> |
Russell King | eb7fffa | 2009-07-05 22:41:31 +0100 | [diff] [blame] | 25 | #include <linux/amba/pl061.h> |
Linus Walleij | 6ef297f | 2009-09-22 14:29:36 +0100 | [diff] [blame] | 26 | #include <linux/amba/mmci.h> |
Linus Walleij | d6ada86 | 2010-07-14 23:58:38 +0100 | [diff] [blame] | 27 | #include <linux/amba/pl022.h> |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 28 | #include <linux/io.h> |
| 29 | |
| 30 | #include <asm/irq.h> |
| 31 | #include <asm/leds.h> |
| 32 | #include <asm/mach-types.h> |
Will Deacon | f417cba | 2010-04-15 10:16:26 +0100 | [diff] [blame] | 33 | #include <asm/pmu.h> |
Catalin Marinas | c3c2174 | 2009-06-19 11:28:48 +0100 | [diff] [blame] | 34 | #include <asm/smp_twd.h> |
Catalin Marinas | cc9897d | 2010-06-21 15:12:40 +0100 | [diff] [blame] | 35 | #include <asm/pgtable.h> |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 36 | #include <asm/hardware/gic.h> |
| 37 | #include <asm/hardware/cache-l2x0.h> |
| 38 | |
| 39 | #include <asm/mach/arch.h> |
| 40 | #include <asm/mach/map.h> |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 41 | #include <asm/mach/time.h> |
| 42 | |
| 43 | #include <mach/hardware.h> |
| 44 | #include <mach/board-pbx.h> |
| 45 | #include <mach/irqs.h> |
| 46 | |
| 47 | #include "core.h" |
| 48 | |
| 49 | static struct map_desc realview_pbx_io_desc[] __initdata = { |
| 50 | { |
| 51 | .virtual = IO_ADDRESS(REALVIEW_SYS_BASE), |
| 52 | .pfn = __phys_to_pfn(REALVIEW_SYS_BASE), |
| 53 | .length = SZ_4K, |
| 54 | .type = MT_DEVICE, |
| 55 | }, { |
| 56 | .virtual = IO_ADDRESS(REALVIEW_PBX_GIC_CPU_BASE), |
| 57 | .pfn = __phys_to_pfn(REALVIEW_PBX_GIC_CPU_BASE), |
| 58 | .length = SZ_4K, |
| 59 | .type = MT_DEVICE, |
| 60 | }, { |
| 61 | .virtual = IO_ADDRESS(REALVIEW_PBX_GIC_DIST_BASE), |
| 62 | .pfn = __phys_to_pfn(REALVIEW_PBX_GIC_DIST_BASE), |
| 63 | .length = SZ_4K, |
| 64 | .type = MT_DEVICE, |
| 65 | }, { |
| 66 | .virtual = IO_ADDRESS(REALVIEW_SCTL_BASE), |
| 67 | .pfn = __phys_to_pfn(REALVIEW_SCTL_BASE), |
| 68 | .length = SZ_4K, |
| 69 | .type = MT_DEVICE, |
| 70 | }, { |
| 71 | .virtual = IO_ADDRESS(REALVIEW_PBX_TIMER0_1_BASE), |
| 72 | .pfn = __phys_to_pfn(REALVIEW_PBX_TIMER0_1_BASE), |
| 73 | .length = SZ_4K, |
| 74 | .type = MT_DEVICE, |
| 75 | }, { |
| 76 | .virtual = IO_ADDRESS(REALVIEW_PBX_TIMER2_3_BASE), |
| 77 | .pfn = __phys_to_pfn(REALVIEW_PBX_TIMER2_3_BASE), |
| 78 | .length = SZ_4K, |
| 79 | .type = MT_DEVICE, |
| 80 | }, |
| 81 | #ifdef CONFIG_PCI |
| 82 | { |
| 83 | .virtual = PCIX_UNIT_BASE, |
| 84 | .pfn = __phys_to_pfn(REALVIEW_PBX_PCI_BASE), |
| 85 | .length = REALVIEW_PBX_PCI_BASE_SIZE, |
| 86 | .type = MT_DEVICE, |
| 87 | }, |
| 88 | #endif |
| 89 | #ifdef CONFIG_DEBUG_LL |
| 90 | { |
| 91 | .virtual = IO_ADDRESS(REALVIEW_PBX_UART0_BASE), |
| 92 | .pfn = __phys_to_pfn(REALVIEW_PBX_UART0_BASE), |
| 93 | .length = SZ_4K, |
| 94 | .type = MT_DEVICE, |
| 95 | }, |
| 96 | #endif |
| 97 | }; |
| 98 | |
| 99 | static struct map_desc realview_local_io_desc[] __initdata = { |
| 100 | { |
Rob Herring | 9ceceb6 | 2011-09-29 16:22:02 -0500 | [diff] [blame] | 101 | .virtual = IO_ADDRESS(REALVIEW_PBX_TILE_SCU_BASE), |
| 102 | .pfn = __phys_to_pfn(REALVIEW_PBX_TILE_SCU_BASE), |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 103 | .length = SZ_4K, |
| 104 | .type = MT_DEVICE, |
| 105 | }, { |
| 106 | .virtual = IO_ADDRESS(REALVIEW_PBX_TILE_GIC_DIST_BASE), |
| 107 | .pfn = __phys_to_pfn(REALVIEW_PBX_TILE_GIC_DIST_BASE), |
| 108 | .length = SZ_4K, |
| 109 | .type = MT_DEVICE, |
| 110 | }, { |
| 111 | .virtual = IO_ADDRESS(REALVIEW_PBX_TILE_L220_BASE), |
| 112 | .pfn = __phys_to_pfn(REALVIEW_PBX_TILE_L220_BASE), |
| 113 | .length = SZ_8K, |
| 114 | .type = MT_DEVICE, |
| 115 | } |
| 116 | }; |
| 117 | |
| 118 | static void __init realview_pbx_map_io(void) |
| 119 | { |
| 120 | iotable_init(realview_pbx_io_desc, ARRAY_SIZE(realview_pbx_io_desc)); |
| 121 | if (core_tile_pbx11mp() || core_tile_pbxa9mp()) |
| 122 | iotable_init(realview_local_io_desc, ARRAY_SIZE(realview_local_io_desc)); |
| 123 | } |
| 124 | |
Russell King | eb7fffa | 2009-07-05 22:41:31 +0100 | [diff] [blame] | 125 | static struct pl061_platform_data gpio0_plat_data = { |
| 126 | .gpio_base = 0, |
Russell King | eb7fffa | 2009-07-05 22:41:31 +0100 | [diff] [blame] | 127 | }; |
| 128 | |
| 129 | static struct pl061_platform_data gpio1_plat_data = { |
| 130 | .gpio_base = 8, |
Russell King | eb7fffa | 2009-07-05 22:41:31 +0100 | [diff] [blame] | 131 | }; |
| 132 | |
| 133 | static struct pl061_platform_data gpio2_plat_data = { |
| 134 | .gpio_base = 16, |
Russell King | eb7fffa | 2009-07-05 22:41:31 +0100 | [diff] [blame] | 135 | }; |
| 136 | |
Linus Walleij | d6ada86 | 2010-07-14 23:58:38 +0100 | [diff] [blame] | 137 | static struct pl022_ssp_controller ssp0_plat_data = { |
| 138 | .bus_id = 0, |
| 139 | .enable_dma = 0, |
| 140 | .num_chipselect = 1, |
| 141 | }; |
| 142 | |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 143 | /* |
| 144 | * RealView PBXCore AMBA devices |
| 145 | */ |
| 146 | |
Russell King | 0dada61 | 2011-12-18 11:40:46 +0000 | [diff] [blame] | 147 | #define GPIO2_IRQ { IRQ_PBX_GPIO2 } |
| 148 | #define GPIO3_IRQ { IRQ_PBX_GPIO3 } |
| 149 | #define AACI_IRQ { IRQ_PBX_AACI } |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 150 | #define MMCI0_IRQ { IRQ_PBX_MMCI0A, IRQ_PBX_MMCI0B } |
Russell King | 0dada61 | 2011-12-18 11:40:46 +0000 | [diff] [blame] | 151 | #define KMI0_IRQ { IRQ_PBX_KMI0 } |
| 152 | #define KMI1_IRQ { IRQ_PBX_KMI1 } |
| 153 | #define PBX_SMC_IRQ { } |
| 154 | #define MPMC_IRQ { } |
| 155 | #define PBX_CLCD_IRQ { IRQ_PBX_CLCD } |
| 156 | #define DMAC_IRQ { IRQ_PBX_DMAC } |
| 157 | #define SCTL_IRQ { } |
| 158 | #define PBX_WATCHDOG_IRQ { IRQ_PBX_WATCHDOG } |
| 159 | #define PBX_GPIO0_IRQ { IRQ_PBX_GPIO0 } |
| 160 | #define GPIO1_IRQ { IRQ_PBX_GPIO1 } |
| 161 | #define PBX_RTC_IRQ { IRQ_PBX_RTC } |
| 162 | #define SCI_IRQ { IRQ_PBX_SCI } |
| 163 | #define PBX_UART0_IRQ { IRQ_PBX_UART0 } |
| 164 | #define PBX_UART1_IRQ { IRQ_PBX_UART1 } |
| 165 | #define PBX_UART2_IRQ { IRQ_PBX_UART2 } |
| 166 | #define PBX_UART3_IRQ { IRQ_PBX_UART3 } |
| 167 | #define PBX_SSP_IRQ { IRQ_PBX_SSP } |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 168 | |
| 169 | /* FPGA Primecells */ |
Russell King | 9199340 | 2011-12-18 13:38:49 +0000 | [diff] [blame] | 170 | APB_DEVICE(aaci, "fpga:aaci", AACI, NULL); |
| 171 | APB_DEVICE(mmc0, "fpga:mmc0", MMCI0, &realview_mmc0_plat_data); |
| 172 | APB_DEVICE(kmi0, "fpga:kmi0", KMI0, NULL); |
| 173 | APB_DEVICE(kmi1, "fpga:kmi1", KMI1, NULL); |
| 174 | APB_DEVICE(uart3, "fpga:uart3", PBX_UART3, NULL); |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 175 | |
| 176 | /* DevChip Primecells */ |
Russell King | 9199340 | 2011-12-18 13:38:49 +0000 | [diff] [blame] | 177 | AHB_DEVICE(smc, "dev:smc", PBX_SMC, NULL); |
| 178 | AHB_DEVICE(sctl, "dev:sctl", SCTL, NULL); |
| 179 | APB_DEVICE(wdog, "dev:wdog", PBX_WATCHDOG, NULL); |
| 180 | APB_DEVICE(gpio0, "dev:gpio0", PBX_GPIO0, &gpio0_plat_data); |
| 181 | APB_DEVICE(gpio1, "dev:gpio1", GPIO1, &gpio1_plat_data); |
| 182 | APB_DEVICE(gpio2, "dev:gpio2", GPIO2, &gpio2_plat_data); |
| 183 | APB_DEVICE(rtc, "dev:rtc", PBX_RTC, NULL); |
| 184 | APB_DEVICE(sci0, "dev:sci0", SCI, NULL); |
| 185 | APB_DEVICE(uart0, "dev:uart0", PBX_UART0, NULL); |
| 186 | APB_DEVICE(uart1, "dev:uart1", PBX_UART1, NULL); |
| 187 | APB_DEVICE(uart2, "dev:uart2", PBX_UART2, NULL); |
| 188 | APB_DEVICE(ssp0, "dev:ssp0", PBX_SSP, &ssp0_plat_data); |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 189 | |
| 190 | /* Primecells on the NEC ISSP chip */ |
Russell King | 9199340 | 2011-12-18 13:38:49 +0000 | [diff] [blame] | 191 | AHB_DEVICE(clcd, "issp:clcd", PBX_CLCD, &clcd_plat_data); |
| 192 | AHB_DEVICE(dmac, "issp:dmac", DMAC, NULL); |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 193 | |
| 194 | static struct amba_device *amba_devs[] __initdata = { |
| 195 | &dmac_device, |
| 196 | &uart0_device, |
| 197 | &uart1_device, |
| 198 | &uart2_device, |
| 199 | &uart3_device, |
| 200 | &smc_device, |
| 201 | &clcd_device, |
| 202 | &sctl_device, |
| 203 | &wdog_device, |
| 204 | &gpio0_device, |
| 205 | &gpio1_device, |
| 206 | &gpio2_device, |
| 207 | &rtc_device, |
| 208 | &sci0_device, |
| 209 | &ssp0_device, |
| 210 | &aaci_device, |
| 211 | &mmc0_device, |
| 212 | &kmi0_device, |
| 213 | &kmi1_device, |
| 214 | }; |
| 215 | |
| 216 | /* |
| 217 | * RealView PB-X platform devices |
| 218 | */ |
| 219 | static struct resource realview_pbx_flash_resources[] = { |
| 220 | [0] = { |
| 221 | .start = REALVIEW_PBX_FLASH0_BASE, |
| 222 | .end = REALVIEW_PBX_FLASH0_BASE + REALVIEW_PBX_FLASH0_SIZE - 1, |
| 223 | .flags = IORESOURCE_MEM, |
| 224 | }, |
| 225 | [1] = { |
| 226 | .start = REALVIEW_PBX_FLASH1_BASE, |
| 227 | .end = REALVIEW_PBX_FLASH1_BASE + REALVIEW_PBX_FLASH1_SIZE - 1, |
| 228 | .flags = IORESOURCE_MEM, |
| 229 | }, |
| 230 | }; |
| 231 | |
| 232 | static struct resource realview_pbx_smsc911x_resources[] = { |
| 233 | [0] = { |
| 234 | .start = REALVIEW_PBX_ETH_BASE, |
| 235 | .end = REALVIEW_PBX_ETH_BASE + SZ_64K - 1, |
| 236 | .flags = IORESOURCE_MEM, |
| 237 | }, |
| 238 | [1] = { |
| 239 | .start = IRQ_PBX_ETH, |
| 240 | .end = IRQ_PBX_ETH, |
| 241 | .flags = IORESOURCE_IRQ, |
| 242 | }, |
| 243 | }; |
| 244 | |
| 245 | static struct resource realview_pbx_isp1761_resources[] = { |
| 246 | [0] = { |
| 247 | .start = REALVIEW_PBX_USB_BASE, |
| 248 | .end = REALVIEW_PBX_USB_BASE + SZ_128K - 1, |
| 249 | .flags = IORESOURCE_MEM, |
| 250 | }, |
| 251 | [1] = { |
| 252 | .start = IRQ_PBX_USB, |
| 253 | .end = IRQ_PBX_USB, |
| 254 | .flags = IORESOURCE_IRQ, |
| 255 | }, |
| 256 | }; |
| 257 | |
Will Deacon | f417cba | 2010-04-15 10:16:26 +0100 | [diff] [blame] | 258 | static struct resource pmu_resources[] = { |
| 259 | [0] = { |
| 260 | .start = IRQ_PBX_PMU_CPU0, |
| 261 | .end = IRQ_PBX_PMU_CPU0, |
| 262 | .flags = IORESOURCE_IRQ, |
| 263 | }, |
| 264 | [1] = { |
| 265 | .start = IRQ_PBX_PMU_CPU1, |
| 266 | .end = IRQ_PBX_PMU_CPU1, |
| 267 | .flags = IORESOURCE_IRQ, |
| 268 | }, |
| 269 | [2] = { |
| 270 | .start = IRQ_PBX_PMU_CPU2, |
| 271 | .end = IRQ_PBX_PMU_CPU2, |
| 272 | .flags = IORESOURCE_IRQ, |
| 273 | }, |
| 274 | [3] = { |
| 275 | .start = IRQ_PBX_PMU_CPU3, |
| 276 | .end = IRQ_PBX_PMU_CPU3, |
| 277 | .flags = IORESOURCE_IRQ, |
| 278 | }, |
| 279 | }; |
| 280 | |
| 281 | static struct platform_device pmu_device = { |
| 282 | .name = "arm-pmu", |
| 283 | .id = ARM_PMU_DEVICE_CPU, |
| 284 | .num_resources = ARRAY_SIZE(pmu_resources), |
| 285 | .resource = pmu_resources, |
| 286 | }; |
| 287 | |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 288 | static void __init gic_init_irq(void) |
| 289 | { |
| 290 | /* ARM PBX on-board GIC */ |
| 291 | if (core_tile_pbx11mp() || core_tile_pbxa9mp()) { |
Russell King | b580b89 | 2010-12-04 15:55:14 +0000 | [diff] [blame] | 292 | gic_init(0, 29, __io_address(REALVIEW_PBX_TILE_GIC_DIST_BASE), |
| 293 | __io_address(REALVIEW_PBX_TILE_GIC_CPU_BASE)); |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 294 | } else { |
Russell King | b580b89 | 2010-12-04 15:55:14 +0000 | [diff] [blame] | 295 | gic_init(0, IRQ_PBX_GIC_START, |
| 296 | __io_address(REALVIEW_PBX_GIC_DIST_BASE), |
| 297 | __io_address(REALVIEW_PBX_GIC_CPU_BASE)); |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 298 | } |
| 299 | } |
| 300 | |
Marc Zyngier | 7c380f2 | 2011-08-04 11:57:04 +0100 | [diff] [blame] | 301 | #ifdef CONFIG_HAVE_ARM_TWD |
| 302 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, |
| 303 | REALVIEW_PBX_TILE_TWD_BASE, |
| 304 | IRQ_LOCALTIMER); |
| 305 | |
| 306 | static void __init realview_pbx_twd_init(void) |
| 307 | { |
| 308 | int err = twd_local_timer_register(&twd_local_timer); |
| 309 | if (err) |
| 310 | pr_err("twd_local_timer_register failed %d\n", err); |
| 311 | } |
| 312 | #else |
| 313 | #define realview_pbx_twd_init() do { } while(0) |
| 314 | #endif |
| 315 | |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 316 | static void __init realview_pbx_timer_init(void) |
| 317 | { |
| 318 | timer0_va_base = __io_address(REALVIEW_PBX_TIMER0_1_BASE); |
| 319 | timer1_va_base = __io_address(REALVIEW_PBX_TIMER0_1_BASE) + 0x20; |
| 320 | timer2_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE); |
| 321 | timer3_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE) + 0x20; |
| 322 | |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 323 | realview_timer_init(IRQ_PBX_TIMER0_1); |
Marc Zyngier | 7c380f2 | 2011-08-04 11:57:04 +0100 | [diff] [blame] | 324 | realview_pbx_twd_init(); |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 325 | } |
| 326 | |
| 327 | static struct sys_timer realview_pbx_timer = { |
| 328 | .init = realview_pbx_timer_init, |
| 329 | }; |
| 330 | |
Russell King | 0744a3e | 2010-12-20 10:37:50 +0000 | [diff] [blame] | 331 | static void realview_pbx_fixup(struct tag *tags, char **from, |
| 332 | struct meminfo *meminfo) |
Catalin Marinas | c97c5aa | 2009-11-04 12:19:05 +0000 | [diff] [blame] | 333 | { |
| 334 | #ifdef CONFIG_SPARSEMEM |
| 335 | /* |
| 336 | * Memory configuration with SPARSEMEM enabled on RealView PBX (see |
| 337 | * asm/mach/memory.h for more information). |
| 338 | */ |
| 339 | meminfo->bank[0].start = 0; |
| 340 | meminfo->bank[0].size = SZ_256M; |
| 341 | meminfo->bank[1].start = 0x20000000; |
| 342 | meminfo->bank[1].size = SZ_512M; |
| 343 | meminfo->bank[2].start = 0x80000000; |
| 344 | meminfo->bank[2].size = SZ_256M; |
| 345 | meminfo->nr_banks = 3; |
| 346 | #else |
Russell King | 0744a3e | 2010-12-20 10:37:50 +0000 | [diff] [blame] | 347 | realview_fixup(tags, from, meminfo); |
Catalin Marinas | c97c5aa | 2009-11-04 12:19:05 +0000 | [diff] [blame] | 348 | #endif |
| 349 | } |
| 350 | |
Russell King | 47cacdd4 | 2011-11-03 14:00:13 +0000 | [diff] [blame] | 351 | static void realview_pbx_restart(char mode, const char *cmd) |
Colin Tuckley | 4c9f8be | 2010-01-11 11:09:15 +0100 | [diff] [blame] | 352 | { |
| 353 | void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); |
| 354 | void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK); |
| 355 | |
| 356 | /* |
| 357 | * To reset, we hit the on-board reset register |
| 358 | * in the system FPGA |
| 359 | */ |
| 360 | __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl); |
Colin Tuckley | df2e615 | 2010-01-29 12:52:55 +0100 | [diff] [blame] | 361 | __raw_writel(0x00F0, reset_ctrl); |
| 362 | __raw_writel(0x00F4, reset_ctrl); |
Russell King | 47cacdd4 | 2011-11-03 14:00:13 +0000 | [diff] [blame] | 363 | dsb(); |
Colin Tuckley | 4c9f8be | 2010-01-11 11:09:15 +0100 | [diff] [blame] | 364 | } |
| 365 | |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 366 | static void __init realview_pbx_init(void) |
| 367 | { |
| 368 | int i; |
| 369 | |
| 370 | #ifdef CONFIG_CACHE_L2X0 |
| 371 | if (core_tile_pbxa9mp()) { |
| 372 | void __iomem *l2x0_base = |
| 373 | __io_address(REALVIEW_PBX_TILE_L220_BASE); |
| 374 | |
| 375 | /* set RAM latencies to 1 cycle for eASIC */ |
| 376 | writel(0, l2x0_base + L2X0_TAG_LATENCY_CTRL); |
| 377 | writel(0, l2x0_base + L2X0_DATA_LATENCY_CTRL); |
| 378 | |
| 379 | /* 16KB way size, 8-way associativity, parity disabled |
| 380 | * Bits: .. 0 0 0 0 1 00 1 0 1 001 0 000 0 .... .... .... */ |
| 381 | l2x0_init(l2x0_base, 0x02520000, 0xc0000fff); |
Will Deacon | f417cba | 2010-04-15 10:16:26 +0100 | [diff] [blame] | 382 | platform_device_register(&pmu_device); |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 383 | } |
| 384 | #endif |
| 385 | |
| 386 | realview_flash_register(realview_pbx_flash_resources, |
| 387 | ARRAY_SIZE(realview_pbx_flash_resources)); |
| 388 | realview_eth_register(NULL, realview_pbx_smsc911x_resources); |
| 389 | platform_device_register(&realview_i2c_device); |
| 390 | platform_device_register(&realview_cf_device); |
| 391 | realview_usb_register(realview_pbx_isp1761_resources); |
| 392 | |
| 393 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { |
| 394 | struct amba_device *d = amba_devs[i]; |
| 395 | amba_device_register(d, &iomem_resource); |
| 396 | } |
| 397 | |
| 398 | #ifdef CONFIG_LEDS |
| 399 | leds_event = realview_leds_event; |
| 400 | #endif |
| 401 | } |
| 402 | |
| 403 | MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX") |
| 404 | /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ |
Nicolas Pitre | 9ddea57 | 2011-07-05 22:38:16 -0400 | [diff] [blame] | 405 | .atag_offset = 0x100, |
Catalin Marinas | c97c5aa | 2009-11-04 12:19:05 +0000 | [diff] [blame] | 406 | .fixup = realview_pbx_fixup, |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 407 | .map_io = realview_pbx_map_io, |
Russell King | 631e55f | 2011-01-11 13:05:01 +0000 | [diff] [blame] | 408 | .init_early = realview_init_early, |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 409 | .init_irq = gic_init_irq, |
| 410 | .timer = &realview_pbx_timer, |
Marc Zyngier | 1b99d9c | 2011-09-06 10:23:45 +0100 | [diff] [blame] | 411 | .handle_irq = gic_handle_irq, |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 412 | .init_machine = realview_pbx_init, |
Nicolas Pitre | 00e9125 | 2011-07-05 22:28:09 -0400 | [diff] [blame] | 413 | #ifdef CONFIG_ZONE_DMA |
| 414 | .dma_zone_size = SZ_256M, |
| 415 | #endif |
Russell King | 47cacdd4 | 2011-11-03 14:00:13 +0000 | [diff] [blame] | 416 | .restart = realview_pbx_restart, |
Colin Tuckley | 1b504bb | 2009-05-30 13:56:12 +0100 | [diff] [blame] | 417 | MACHINE_END |