diff options
Diffstat (limited to 'arch/arm/mach-vexpress/v2m.c')
-rw-r--r-- | arch/arm/mach-vexpress/v2m.c | 82 |
1 files changed, 10 insertions, 72 deletions
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c index 4f8b8cb17ff5..38f4f6f37770 100644 --- a/arch/arm/mach-vexpress/v2m.c +++ b/arch/arm/mach-vexpress/v2m.c | |||
@@ -201,8 +201,9 @@ static struct platform_device v2m_cf_device = { | |||
201 | 201 | ||
202 | static struct mmci_platform_data v2m_mmci_data = { | 202 | static struct mmci_platform_data v2m_mmci_data = { |
203 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 203 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
204 | .gpio_wp = VEXPRESS_GPIO_MMC_WPROT, | 204 | .status = vexpress_get_mci_cardin, |
205 | .gpio_cd = VEXPRESS_GPIO_MMC_CARDIN, | 205 | .gpio_cd = -1, |
206 | .gpio_wp = -1, | ||
206 | }; | 207 | }; |
207 | 208 | ||
208 | static struct resource v2m_sysreg_resources[] = { | 209 | static struct resource v2m_sysreg_resources[] = { |
@@ -340,11 +341,6 @@ static void __init v2m_init(void) | |||
340 | regulator_register_fixed(0, v2m_eth_supplies, | 341 | regulator_register_fixed(0, v2m_eth_supplies, |
341 | ARRAY_SIZE(v2m_eth_supplies)); | 342 | ARRAY_SIZE(v2m_eth_supplies)); |
342 | 343 | ||
343 | platform_device_register(&v2m_muxfpga_device); | ||
344 | platform_device_register(&v2m_shutdown_device); | ||
345 | platform_device_register(&v2m_reboot_device); | ||
346 | platform_device_register(&v2m_dvimode_device); | ||
347 | |||
348 | platform_device_register(&v2m_sysreg_device); | 344 | platform_device_register(&v2m_sysreg_device); |
349 | platform_device_register(&v2m_pcie_i2c_device); | 345 | platform_device_register(&v2m_pcie_i2c_device); |
350 | platform_device_register(&v2m_ddc_i2c_device); | 346 | platform_device_register(&v2m_ddc_i2c_device); |
@@ -356,6 +352,11 @@ static void __init v2m_init(void) | |||
356 | for (i = 0; i < ARRAY_SIZE(v2m_amba_devs); i++) | 352 | for (i = 0; i < ARRAY_SIZE(v2m_amba_devs); i++) |
357 | amba_device_register(v2m_amba_devs[i], &iomem_resource); | 353 | amba_device_register(v2m_amba_devs[i], &iomem_resource); |
358 | 354 | ||
355 | vexpress_syscfg_device_register(&v2m_muxfpga_device); | ||
356 | vexpress_syscfg_device_register(&v2m_shutdown_device); | ||
357 | vexpress_syscfg_device_register(&v2m_reboot_device); | ||
358 | vexpress_syscfg_device_register(&v2m_dvimode_device); | ||
359 | |||
359 | ct_desc->init_tile(); | 360 | ct_desc->init_tile(); |
360 | } | 361 | } |
361 | 362 | ||
@@ -369,71 +370,10 @@ MACHINE_START(VEXPRESS, "ARM-Versatile Express") | |||
369 | .init_machine = v2m_init, | 370 | .init_machine = v2m_init, |
370 | MACHINE_END | 371 | MACHINE_END |
371 | 372 | ||
372 | static struct map_desc v2m_rs1_io_desc __initdata = { | ||
373 | .virtual = V2M_PERIPH, | ||
374 | .pfn = __phys_to_pfn(0x1c000000), | ||
375 | .length = SZ_2M, | ||
376 | .type = MT_DEVICE, | ||
377 | }; | ||
378 | |||
379 | static int __init v2m_dt_scan_memory_map(unsigned long node, const char *uname, | ||
380 | int depth, void *data) | ||
381 | { | ||
382 | const char **map = data; | ||
383 | |||
384 | if (strcmp(uname, "motherboard") != 0) | ||
385 | return 0; | ||
386 | |||
387 | *map = of_get_flat_dt_prop(node, "arm,v2m-memory-map", NULL); | ||
388 | |||
389 | return 1; | ||
390 | } | ||
391 | |||
392 | void __init v2m_dt_map_io(void) | ||
393 | { | ||
394 | const char *map = NULL; | ||
395 | |||
396 | of_scan_flat_dt(v2m_dt_scan_memory_map, &map); | ||
397 | |||
398 | if (map && strcmp(map, "rs1") == 0) | ||
399 | iotable_init(&v2m_rs1_io_desc, 1); | ||
400 | else | ||
401 | iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc)); | ||
402 | |||
403 | #if defined(CONFIG_SMP) | ||
404 | vexpress_dt_smp_map_io(); | ||
405 | #endif | ||
406 | } | ||
407 | |||
408 | void __init v2m_dt_init_early(void) | ||
409 | { | ||
410 | u32 dt_hbi; | ||
411 | |||
412 | vexpress_sysreg_of_early_init(); | ||
413 | |||
414 | /* Confirm board type against DT property, if available */ | ||
415 | if (of_property_read_u32(of_allnodes, "arm,hbi", &dt_hbi) == 0) { | ||
416 | u32 hbi = vexpress_get_hbi(VEXPRESS_SITE_MASTER); | ||
417 | |||
418 | if (WARN_ON(dt_hbi != hbi)) | ||
419 | pr_warning("vexpress: DT HBI (%x) is not matching " | ||
420 | "hardware (%x)!\n", dt_hbi, hbi); | ||
421 | } | ||
422 | |||
423 | versatile_sched_clock_init(vexpress_get_24mhz_clock_base(), 24000000); | ||
424 | } | ||
425 | |||
426 | static const struct of_device_id v2m_dt_bus_match[] __initconst = { | ||
427 | { .compatible = "simple-bus", }, | ||
428 | { .compatible = "arm,amba-bus", }, | ||
429 | { .compatible = "arm,vexpress,config-bus", }, | ||
430 | {} | ||
431 | }; | ||
432 | |||
433 | static void __init v2m_dt_init(void) | 373 | static void __init v2m_dt_init(void) |
434 | { | 374 | { |
435 | l2x0_of_init(0x00400000, 0xfe0fffff); | 375 | l2x0_of_init(0x00400000, 0xfe0fffff); |
436 | of_platform_populate(NULL, v2m_dt_bus_match, NULL, NULL); | 376 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
437 | } | 377 | } |
438 | 378 | ||
439 | static const char * const v2m_dt_match[] __initconst = { | 379 | static const char * const v2m_dt_match[] __initconst = { |
@@ -443,9 +383,7 @@ static const char * const v2m_dt_match[] __initconst = { | |||
443 | 383 | ||
444 | DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express") | 384 | DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express") |
445 | .dt_compat = v2m_dt_match, | 385 | .dt_compat = v2m_dt_match, |
446 | .smp = smp_ops(vexpress_smp_ops), | 386 | .smp = smp_ops(vexpress_smp_dt_ops), |
447 | .smp_init = smp_init_ops(vexpress_smp_init_ops), | 387 | .smp_init = smp_init_ops(vexpress_smp_init_ops), |
448 | .map_io = v2m_dt_map_io, | ||
449 | .init_early = v2m_dt_init_early, | ||
450 | .init_machine = v2m_dt_init, | 388 | .init_machine = v2m_dt_init, |
451 | MACHINE_END | 389 | MACHINE_END |