Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Versatile Express V2M Motherboard Support |
| 3 | */ |
| 4 | #include <linux/device.h> |
| 5 | #include <linux/amba/bus.h> |
| 6 | #include <linux/amba/mmci.h> |
| 7 | #include <linux/io.h> |
| 8 | #include <linux/init.h> |
| 9 | #include <linux/platform_device.h> |
Nick Bowler | 95c34f8 | 2011-01-21 15:51:06 +0100 | [diff] [blame] | 10 | #include <linux/ata_platform.h> |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 11 | #include <linux/smsc911x.h> |
| 12 | #include <linux/spinlock.h> |
| 13 | #include <linux/sysdev.h> |
| 14 | #include <linux/usb/isp1760.h> |
Jean-Christop PLAGNIOL-VILLARD | 6d803ba | 2010-11-17 10:04:33 +0100 | [diff] [blame] | 15 | #include <linux/clkdev.h> |
Marc Zyngier | 0f71fd4 | 2011-05-18 10:51:51 +0100 | [diff] [blame] | 16 | #include <linux/mtd/physmap.h> |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 17 | |
Will Deacon | 80b5efbd | 2011-02-28 17:01:04 +0100 | [diff] [blame] | 18 | #include <asm/mach-types.h> |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 19 | #include <asm/sizes.h> |
Will Deacon | 80b5efbd | 2011-02-28 17:01:04 +0100 | [diff] [blame] | 20 | #include <asm/mach/arch.h> |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 21 | #include <asm/mach/map.h> |
| 22 | #include <asm/mach/time.h> |
| 23 | #include <asm/hardware/arm_timer.h> |
Russell King | 58daf18 | 2011-01-05 18:09:03 +0000 | [diff] [blame] | 24 | #include <asm/hardware/timer-sp.h> |
Pawel Moll | baaece2 | 2011-01-25 15:53:03 +0100 | [diff] [blame] | 25 | #include <asm/hardware/sp810.h> |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 26 | |
Will Deacon | 80b5efbd | 2011-02-28 17:01:04 +0100 | [diff] [blame] | 27 | #include <mach/ct-ca9x4.h> |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 28 | #include <mach/motherboard.h> |
| 29 | |
Russell King | 0af85dd | 2010-12-15 21:58:50 +0000 | [diff] [blame] | 30 | #include <plat/sched_clock.h> |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 31 | |
| 32 | #include "core.h" |
| 33 | |
| 34 | #define V2M_PA_CS0 0x40000000 |
| 35 | #define V2M_PA_CS1 0x44000000 |
| 36 | #define V2M_PA_CS2 0x48000000 |
| 37 | #define V2M_PA_CS3 0x4c000000 |
| 38 | #define V2M_PA_CS7 0x10000000 |
| 39 | |
| 40 | static struct map_desc v2m_io_desc[] __initdata = { |
| 41 | { |
| 42 | .virtual = __MMIO_P2V(V2M_PA_CS7), |
| 43 | .pfn = __phys_to_pfn(V2M_PA_CS7), |
| 44 | .length = SZ_128K, |
| 45 | .type = MT_DEVICE, |
| 46 | }, |
| 47 | }; |
| 48 | |
Russell King | cdaf9a2 | 2010-10-05 11:29:28 +0100 | [diff] [blame] | 49 | static void __init v2m_timer_init(void) |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 50 | { |
Pawel Moll | baaece2 | 2011-01-25 15:53:03 +0100 | [diff] [blame] | 51 | u32 scctrl; |
| 52 | |
Pawel Moll | baaece2 | 2011-01-25 15:53:03 +0100 | [diff] [blame] | 53 | /* Select 1MHz TIMCLK as the reference clock for SP804 timers */ |
| 54 | scctrl = readl(MMIO_P2V(V2M_SYSCTL + SCCTRL)); |
| 55 | scctrl |= SCCTRL_TIMEREN0SEL_TIMCLK; |
| 56 | scctrl |= SCCTRL_TIMEREN1SEL_TIMCLK; |
| 57 | writel(scctrl, MMIO_P2V(V2M_SYSCTL + SCCTRL)); |
| 58 | |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 59 | writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL); |
| 60 | writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL); |
| 61 | |
Russell King | fb593cf | 2011-05-12 12:08:23 +0100 | [diff] [blame] | 62 | sp804_clocksource_init(MMIO_P2V(V2M_TIMER1), "v2m-timer1"); |
Russell King | 57cc4f7 | 2011-05-12 15:31:13 +0100 | [diff] [blame] | 63 | sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0, |
| 64 | "v2m-timer0"); |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 65 | } |
| 66 | |
Will Deacon | 80b5efbd | 2011-02-28 17:01:04 +0100 | [diff] [blame] | 67 | static struct sys_timer v2m_timer = { |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 68 | .init = v2m_timer_init, |
| 69 | }; |
| 70 | |
| 71 | |
| 72 | static DEFINE_SPINLOCK(v2m_cfg_lock); |
| 73 | |
| 74 | int v2m_cfg_write(u32 devfn, u32 data) |
| 75 | { |
| 76 | /* Configuration interface broken? */ |
| 77 | u32 val; |
| 78 | |
| 79 | printk("%s: writing %08x to %08x\n", __func__, data, devfn); |
| 80 | |
| 81 | devfn |= SYS_CFG_START | SYS_CFG_WRITE; |
| 82 | |
| 83 | spin_lock(&v2m_cfg_lock); |
| 84 | val = readl(MMIO_P2V(V2M_SYS_CFGSTAT)); |
| 85 | writel(val & ~SYS_CFG_COMPLETE, MMIO_P2V(V2M_SYS_CFGSTAT)); |
| 86 | |
| 87 | writel(data, MMIO_P2V(V2M_SYS_CFGDATA)); |
| 88 | writel(devfn, MMIO_P2V(V2M_SYS_CFGCTRL)); |
| 89 | |
| 90 | do { |
| 91 | val = readl(MMIO_P2V(V2M_SYS_CFGSTAT)); |
| 92 | } while (val == 0); |
| 93 | spin_unlock(&v2m_cfg_lock); |
| 94 | |
| 95 | return !!(val & SYS_CFG_ERR); |
| 96 | } |
| 97 | |
| 98 | int v2m_cfg_read(u32 devfn, u32 *data) |
| 99 | { |
| 100 | u32 val; |
| 101 | |
| 102 | devfn |= SYS_CFG_START; |
| 103 | |
| 104 | spin_lock(&v2m_cfg_lock); |
| 105 | writel(0, MMIO_P2V(V2M_SYS_CFGSTAT)); |
| 106 | writel(devfn, MMIO_P2V(V2M_SYS_CFGCTRL)); |
| 107 | |
| 108 | mb(); |
| 109 | |
| 110 | do { |
| 111 | cpu_relax(); |
| 112 | val = readl(MMIO_P2V(V2M_SYS_CFGSTAT)); |
| 113 | } while (val == 0); |
| 114 | |
| 115 | *data = readl(MMIO_P2V(V2M_SYS_CFGDATA)); |
| 116 | spin_unlock(&v2m_cfg_lock); |
| 117 | |
| 118 | return !!(val & SYS_CFG_ERR); |
| 119 | } |
| 120 | |
| 121 | |
| 122 | static struct resource v2m_pcie_i2c_resource = { |
| 123 | .start = V2M_SERIAL_BUS_PCI, |
| 124 | .end = V2M_SERIAL_BUS_PCI + SZ_4K - 1, |
| 125 | .flags = IORESOURCE_MEM, |
| 126 | }; |
| 127 | |
| 128 | static struct platform_device v2m_pcie_i2c_device = { |
| 129 | .name = "versatile-i2c", |
| 130 | .id = 0, |
| 131 | .num_resources = 1, |
| 132 | .resource = &v2m_pcie_i2c_resource, |
| 133 | }; |
| 134 | |
| 135 | static struct resource v2m_ddc_i2c_resource = { |
| 136 | .start = V2M_SERIAL_BUS_DVI, |
| 137 | .end = V2M_SERIAL_BUS_DVI + SZ_4K - 1, |
| 138 | .flags = IORESOURCE_MEM, |
| 139 | }; |
| 140 | |
| 141 | static struct platform_device v2m_ddc_i2c_device = { |
| 142 | .name = "versatile-i2c", |
| 143 | .id = 1, |
| 144 | .num_resources = 1, |
| 145 | .resource = &v2m_ddc_i2c_resource, |
| 146 | }; |
| 147 | |
| 148 | static struct resource v2m_eth_resources[] = { |
| 149 | { |
| 150 | .start = V2M_LAN9118, |
| 151 | .end = V2M_LAN9118 + SZ_64K - 1, |
| 152 | .flags = IORESOURCE_MEM, |
| 153 | }, { |
| 154 | .start = IRQ_V2M_LAN9118, |
| 155 | .end = IRQ_V2M_LAN9118, |
| 156 | .flags = IORESOURCE_IRQ, |
| 157 | }, |
| 158 | }; |
| 159 | |
| 160 | static struct smsc911x_platform_config v2m_eth_config = { |
| 161 | .flags = SMSC911X_USE_32BIT, |
| 162 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH, |
| 163 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, |
| 164 | .phy_interface = PHY_INTERFACE_MODE_MII, |
| 165 | }; |
| 166 | |
| 167 | static struct platform_device v2m_eth_device = { |
| 168 | .name = "smsc911x", |
| 169 | .id = -1, |
| 170 | .resource = v2m_eth_resources, |
| 171 | .num_resources = ARRAY_SIZE(v2m_eth_resources), |
| 172 | .dev.platform_data = &v2m_eth_config, |
| 173 | }; |
| 174 | |
| 175 | static struct resource v2m_usb_resources[] = { |
| 176 | { |
| 177 | .start = V2M_ISP1761, |
| 178 | .end = V2M_ISP1761 + SZ_128K - 1, |
| 179 | .flags = IORESOURCE_MEM, |
| 180 | }, { |
| 181 | .start = IRQ_V2M_ISP1761, |
| 182 | .end = IRQ_V2M_ISP1761, |
| 183 | .flags = IORESOURCE_IRQ, |
| 184 | }, |
| 185 | }; |
| 186 | |
| 187 | static struct isp1760_platform_data v2m_usb_config = { |
| 188 | .is_isp1761 = true, |
| 189 | .bus_width_16 = false, |
| 190 | .port1_otg = true, |
| 191 | .analog_oc = false, |
| 192 | .dack_polarity_high = false, |
| 193 | .dreq_polarity_high = false, |
| 194 | }; |
| 195 | |
| 196 | static struct platform_device v2m_usb_device = { |
| 197 | .name = "isp1760", |
| 198 | .id = -1, |
| 199 | .resource = v2m_usb_resources, |
| 200 | .num_resources = ARRAY_SIZE(v2m_usb_resources), |
| 201 | .dev.platform_data = &v2m_usb_config, |
| 202 | }; |
| 203 | |
Marc Zyngier | 667f390 | 2011-05-18 10:51:55 +0100 | [diff] [blame] | 204 | static void v2m_flash_set_vpp(struct platform_device *pdev, int on) |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 205 | { |
| 206 | writel(on != 0, MMIO_P2V(V2M_SYS_FLASH)); |
| 207 | } |
| 208 | |
Marc Zyngier | 0f71fd4 | 2011-05-18 10:51:51 +0100 | [diff] [blame] | 209 | static struct physmap_flash_data v2m_flash_data = { |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 210 | .width = 4, |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 211 | .set_vpp = v2m_flash_set_vpp, |
| 212 | }; |
| 213 | |
| 214 | static struct resource v2m_flash_resources[] = { |
| 215 | { |
| 216 | .start = V2M_NOR0, |
| 217 | .end = V2M_NOR0 + SZ_64M - 1, |
| 218 | .flags = IORESOURCE_MEM, |
| 219 | }, { |
| 220 | .start = V2M_NOR1, |
| 221 | .end = V2M_NOR1 + SZ_64M - 1, |
| 222 | .flags = IORESOURCE_MEM, |
| 223 | }, |
| 224 | }; |
| 225 | |
| 226 | static struct platform_device v2m_flash_device = { |
Marc Zyngier | 0f71fd4 | 2011-05-18 10:51:51 +0100 | [diff] [blame] | 227 | .name = "physmap-flash", |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 228 | .id = -1, |
| 229 | .resource = v2m_flash_resources, |
| 230 | .num_resources = ARRAY_SIZE(v2m_flash_resources), |
| 231 | .dev.platform_data = &v2m_flash_data, |
| 232 | }; |
| 233 | |
Nick Bowler | 95c34f8 | 2011-01-21 15:51:06 +0100 | [diff] [blame] | 234 | static struct pata_platform_info v2m_pata_data = { |
| 235 | .ioport_shift = 2, |
| 236 | }; |
| 237 | |
| 238 | static struct resource v2m_pata_resources[] = { |
| 239 | { |
| 240 | .start = V2M_CF, |
| 241 | .end = V2M_CF + 0xff, |
| 242 | .flags = IORESOURCE_MEM, |
| 243 | }, { |
| 244 | .start = V2M_CF + 0x100, |
| 245 | .end = V2M_CF + SZ_4K - 1, |
| 246 | .flags = IORESOURCE_MEM, |
| 247 | }, |
| 248 | }; |
| 249 | |
| 250 | static struct platform_device v2m_cf_device = { |
| 251 | .name = "pata_platform", |
| 252 | .id = -1, |
| 253 | .resource = v2m_pata_resources, |
| 254 | .num_resources = ARRAY_SIZE(v2m_pata_resources), |
| 255 | .dev.platform_data = &v2m_pata_data, |
| 256 | }; |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 257 | |
| 258 | static unsigned int v2m_mmci_status(struct device *dev) |
| 259 | { |
Russell King | 74bc809 | 2010-07-29 15:58:59 +0100 | [diff] [blame] | 260 | return readl(MMIO_P2V(V2M_SYS_MCI)) & (1 << 0); |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 261 | } |
| 262 | |
| 263 | static struct mmci_platform_data v2m_mmci_data = { |
| 264 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
| 265 | .status = v2m_mmci_status, |
| 266 | }; |
| 267 | |
| 268 | static AMBA_DEVICE(aaci, "mb:aaci", V2M_AACI, NULL); |
| 269 | static AMBA_DEVICE(mmci, "mb:mmci", V2M_MMCI, &v2m_mmci_data); |
| 270 | static AMBA_DEVICE(kmi0, "mb:kmi0", V2M_KMI0, NULL); |
| 271 | static AMBA_DEVICE(kmi1, "mb:kmi1", V2M_KMI1, NULL); |
| 272 | static AMBA_DEVICE(uart0, "mb:uart0", V2M_UART0, NULL); |
| 273 | static AMBA_DEVICE(uart1, "mb:uart1", V2M_UART1, NULL); |
| 274 | static AMBA_DEVICE(uart2, "mb:uart2", V2M_UART2, NULL); |
| 275 | static AMBA_DEVICE(uart3, "mb:uart3", V2M_UART3, NULL); |
| 276 | static AMBA_DEVICE(wdt, "mb:wdt", V2M_WDT, NULL); |
| 277 | static AMBA_DEVICE(rtc, "mb:rtc", V2M_RTC, NULL); |
| 278 | |
| 279 | static struct amba_device *v2m_amba_devs[] __initdata = { |
| 280 | &aaci_device, |
| 281 | &mmci_device, |
| 282 | &kmi0_device, |
| 283 | &kmi1_device, |
| 284 | &uart0_device, |
| 285 | &uart1_device, |
| 286 | &uart2_device, |
| 287 | &uart3_device, |
| 288 | &wdt_device, |
| 289 | &rtc_device, |
| 290 | }; |
| 291 | |
| 292 | |
| 293 | static long v2m_osc_round(struct clk *clk, unsigned long rate) |
| 294 | { |
| 295 | return rate; |
| 296 | } |
| 297 | |
| 298 | static int v2m_osc1_set(struct clk *clk, unsigned long rate) |
| 299 | { |
| 300 | return v2m_cfg_write(SYS_CFG_OSC | SYS_CFG_SITE_MB | 1, rate); |
| 301 | } |
| 302 | |
| 303 | static const struct clk_ops osc1_clk_ops = { |
| 304 | .round = v2m_osc_round, |
| 305 | .set = v2m_osc1_set, |
| 306 | }; |
| 307 | |
| 308 | static struct clk osc1_clk = { |
| 309 | .ops = &osc1_clk_ops, |
| 310 | .rate = 24000000, |
| 311 | }; |
| 312 | |
| 313 | static struct clk osc2_clk = { |
| 314 | .rate = 24000000, |
| 315 | }; |
| 316 | |
Russell King | 7ff550d | 2011-05-12 13:31:48 +0100 | [diff] [blame] | 317 | static struct clk v2m_sp804_clk = { |
| 318 | .rate = 1000000, |
| 319 | }; |
| 320 | |
Nick Bowler | 0ebb962 | 2011-07-20 15:43:42 +0100 | [diff] [blame] | 321 | static struct clk v2m_ref_clk = { |
| 322 | .rate = 32768, |
| 323 | }; |
| 324 | |
Russell King | 3126c7b | 2010-07-15 11:01:17 +0100 | [diff] [blame] | 325 | static struct clk dummy_apb_pclk; |
| 326 | |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 327 | static struct clk_lookup v2m_lookups[] = { |
Russell King | 3126c7b | 2010-07-15 11:01:17 +0100 | [diff] [blame] | 328 | { /* AMBA bus clock */ |
| 329 | .con_id = "apb_pclk", |
| 330 | .clk = &dummy_apb_pclk, |
| 331 | }, { /* UART0 */ |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 332 | .dev_id = "mb:uart0", |
| 333 | .clk = &osc2_clk, |
| 334 | }, { /* UART1 */ |
| 335 | .dev_id = "mb:uart1", |
| 336 | .clk = &osc2_clk, |
| 337 | }, { /* UART2 */ |
| 338 | .dev_id = "mb:uart2", |
| 339 | .clk = &osc2_clk, |
| 340 | }, { /* UART3 */ |
| 341 | .dev_id = "mb:uart3", |
| 342 | .clk = &osc2_clk, |
| 343 | }, { /* KMI0 */ |
| 344 | .dev_id = "mb:kmi0", |
| 345 | .clk = &osc2_clk, |
| 346 | }, { /* KMI1 */ |
| 347 | .dev_id = "mb:kmi1", |
| 348 | .clk = &osc2_clk, |
| 349 | }, { /* MMC0 */ |
| 350 | .dev_id = "mb:mmci", |
| 351 | .clk = &osc2_clk, |
| 352 | }, { /* CLCD */ |
| 353 | .dev_id = "mb:clcd", |
| 354 | .clk = &osc1_clk, |
Nick Bowler | 0ebb962 | 2011-07-20 15:43:42 +0100 | [diff] [blame] | 355 | }, { /* SP805 WDT */ |
| 356 | .dev_id = "mb:wdt", |
| 357 | .clk = &v2m_ref_clk, |
Russell King | 7ff550d | 2011-05-12 13:31:48 +0100 | [diff] [blame] | 358 | }, { /* SP804 timers */ |
| 359 | .dev_id = "sp804", |
Russell King | 23828a7 | 2011-05-12 15:45:16 +0100 | [diff] [blame] | 360 | .con_id = "v2m-timer0", |
| 361 | .clk = &v2m_sp804_clk, |
| 362 | }, { /* SP804 timers */ |
| 363 | .dev_id = "sp804", |
Russell King | 7ff550d | 2011-05-12 13:31:48 +0100 | [diff] [blame] | 364 | .con_id = "v2m-timer1", |
| 365 | .clk = &v2m_sp804_clk, |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 366 | }, |
| 367 | }; |
| 368 | |
Rob Herring | 2fdf999 | 2011-05-30 19:44:22 +0100 | [diff] [blame] | 369 | static void __init v2m_init_early(void) |
| 370 | { |
| 371 | ct_desc->init_early(); |
| 372 | clkdev_add_table(v2m_lookups, ARRAY_SIZE(v2m_lookups)); |
| 373 | versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000); |
| 374 | } |
| 375 | |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 376 | static void v2m_power_off(void) |
| 377 | { |
| 378 | if (v2m_cfg_write(SYS_CFG_SHUTDOWN | SYS_CFG_SITE_MB, 0)) |
| 379 | printk(KERN_EMERG "Unable to shutdown\n"); |
| 380 | } |
| 381 | |
| 382 | static void v2m_restart(char str, const char *cmd) |
| 383 | { |
| 384 | if (v2m_cfg_write(SYS_CFG_REBOOT | SYS_CFG_SITE_MB, 0)) |
| 385 | printk(KERN_EMERG "Unable to reboot\n"); |
| 386 | } |
| 387 | |
Will Deacon | 80b5efbd | 2011-02-28 17:01:04 +0100 | [diff] [blame] | 388 | struct ct_desc *ct_desc; |
| 389 | |
| 390 | static struct ct_desc *ct_descs[] __initdata = { |
| 391 | #ifdef CONFIG_ARCH_VEXPRESS_CA9X4 |
| 392 | &ct_ca9x4_desc, |
| 393 | #endif |
| 394 | }; |
| 395 | |
| 396 | static void __init v2m_populate_ct_desc(void) |
| 397 | { |
| 398 | int i; |
| 399 | u32 current_tile_id; |
| 400 | |
| 401 | ct_desc = NULL; |
| 402 | current_tile_id = readl(MMIO_P2V(V2M_SYS_PROCID0)) & V2M_CT_ID_MASK; |
| 403 | |
| 404 | for (i = 0; i < ARRAY_SIZE(ct_descs) && !ct_desc; ++i) |
| 405 | if (ct_descs[i]->id == current_tile_id) |
| 406 | ct_desc = ct_descs[i]; |
| 407 | |
| 408 | if (!ct_desc) |
| 409 | panic("vexpress: failed to populate core tile description " |
| 410 | "for tile ID 0x%8x\n", current_tile_id); |
| 411 | } |
| 412 | |
| 413 | static void __init v2m_map_io(void) |
| 414 | { |
| 415 | iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc)); |
| 416 | v2m_populate_ct_desc(); |
| 417 | ct_desc->map_io(); |
| 418 | } |
| 419 | |
| 420 | static void __init v2m_init_irq(void) |
| 421 | { |
| 422 | ct_desc->init_irq(); |
| 423 | } |
| 424 | |
| 425 | static void __init v2m_init(void) |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 426 | { |
| 427 | int i; |
| 428 | |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 429 | platform_device_register(&v2m_pcie_i2c_device); |
| 430 | platform_device_register(&v2m_ddc_i2c_device); |
| 431 | platform_device_register(&v2m_flash_device); |
Nick Bowler | 95c34f8 | 2011-01-21 15:51:06 +0100 | [diff] [blame] | 432 | platform_device_register(&v2m_cf_device); |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 433 | platform_device_register(&v2m_eth_device); |
| 434 | platform_device_register(&v2m_usb_device); |
| 435 | |
| 436 | for (i = 0; i < ARRAY_SIZE(v2m_amba_devs); i++) |
| 437 | amba_device_register(v2m_amba_devs[i], &iomem_resource); |
| 438 | |
| 439 | pm_power_off = v2m_power_off; |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 440 | |
Will Deacon | 80b5efbd | 2011-02-28 17:01:04 +0100 | [diff] [blame] | 441 | ct_desc->init_tile(); |
Russell King | ceade89 | 2010-02-11 21:44:53 +0000 | [diff] [blame] | 442 | } |
Will Deacon | 80b5efbd | 2011-02-28 17:01:04 +0100 | [diff] [blame] | 443 | |
| 444 | MACHINE_START(VEXPRESS, "ARM-Versatile Express") |
Nicolas Pitre | e9ce8e5 | 2011-07-05 22:38:18 -0400 | [diff] [blame] | 445 | .atag_offset = 0x100, |
Will Deacon | 80b5efbd | 2011-02-28 17:01:04 +0100 | [diff] [blame] | 446 | .map_io = v2m_map_io, |
| 447 | .init_early = v2m_init_early, |
| 448 | .init_irq = v2m_init_irq, |
| 449 | .timer = &v2m_timer, |
| 450 | .init_machine = v2m_init, |
Russell King | f5733a1 | 2011-11-04 15:47:50 +0000 | [diff] [blame^] | 451 | .restart = v2m_restart, |
Will Deacon | 80b5efbd | 2011-02-28 17:01:04 +0100 | [diff] [blame] | 452 | MACHINE_END |