diff options
author | Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | 2012-08-15 13:07:33 -0400 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2012-09-21 13:07:22 -0400 |
commit | 81d2ef7c40eceb7189872ecea5964f2041118d4a (patch) | |
tree | 84d167e70c40eb08ba156b486efdd1fe15f836bb | |
parent | 624d0b52758d312ce1339bc88d23e6ef7ba980ee (diff) |
ARM: dove: add device tree based machine descriptor
This adds a generic DT_MACHINE for mach-dove. As with other orion based
SoCs there still is some glue code required to make all internal devices
work, i.e. auxdata is provided to pass clocks to corresponding device
drivers.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
-rw-r--r-- | arch/arm/mach-dove/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm/mach-dove/common.c | 67 |
2 files changed, 74 insertions, 0 deletions
diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig index dd937c526a45..00154e74ce6b 100644 --- a/arch/arm/mach-dove/Kconfig +++ b/arch/arm/mach-dove/Kconfig | |||
@@ -15,6 +15,13 @@ config MACH_CM_A510 | |||
15 | Say 'Y' here if you want your kernel to support the | 15 | Say 'Y' here if you want your kernel to support the |
16 | CompuLab CM-A510 Board. | 16 | CompuLab CM-A510 Board. |
17 | 17 | ||
18 | config MACH_DOVE_DT | ||
19 | bool "Marvell Dove Flattened Device Tree" | ||
20 | select USE_OF | ||
21 | help | ||
22 | Say 'Y' here if you want your kernel to support the | ||
23 | Marvell Dove using flattened device tree. | ||
24 | |||
18 | endmenu | 25 | endmenu |
19 | 26 | ||
20 | endif | 27 | endif |
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c index d5de814c52a3..b12d11a5f2d0 100644 --- a/arch/arm/mach-dove/common.c +++ b/arch/arm/mach-dove/common.c | |||
@@ -16,6 +16,8 @@ | |||
16 | #include <linux/clk-provider.h> | 16 | #include <linux/clk-provider.h> |
17 | #include <linux/ata_platform.h> | 17 | #include <linux/ata_platform.h> |
18 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
19 | #include <linux/of.h> | ||
20 | #include <linux/of_platform.h> | ||
19 | #include <asm/page.h> | 21 | #include <asm/page.h> |
20 | #include <asm/setup.h> | 22 | #include <asm/setup.h> |
21 | #include <asm/timex.h> | 23 | #include <asm/timex.h> |
@@ -29,6 +31,7 @@ | |||
29 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
30 | #include <linux/irq.h> | 32 | #include <linux/irq.h> |
31 | #include <plat/time.h> | 33 | #include <plat/time.h> |
34 | #include <plat/irq.h> | ||
32 | #include <plat/ehci-orion.h> | 35 | #include <plat/ehci-orion.h> |
33 | #include <plat/common.h> | 36 | #include <plat/common.h> |
34 | #include <plat/addr-map.h> | 37 | #include <plat/addr-map.h> |
@@ -380,3 +383,67 @@ void dove_restart(char mode, const char *cmd) | |||
380 | while (1) | 383 | while (1) |
381 | ; | 384 | ; |
382 | } | 385 | } |
386 | |||
387 | #if defined(CONFIG_MACH_DOVE_DT) | ||
388 | /* | ||
389 | * Auxdata required until real OF clock provider | ||
390 | */ | ||
391 | struct of_dev_auxdata dove_auxdata_lookup[] __initdata = { | ||
392 | OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL), | ||
393 | OF_DEV_AUXDATA("marvell,orion-spi", 0xf1014600, "orion_spi.1", NULL), | ||
394 | OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), | ||
395 | OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0", | ||
396 | NULL), | ||
397 | OF_DEV_AUXDATA("marvell,orion-sata", 0xf10a0000, "sata_mv.0", NULL), | ||
398 | OF_DEV_AUXDATA("marvell,dove-sdhci", 0xf1092000, "sdhci-dove.0", NULL), | ||
399 | OF_DEV_AUXDATA("marvell,dove-sdhci", 0xf1090000, "sdhci-dove.1", NULL), | ||
400 | {}, | ||
401 | }; | ||
402 | |||
403 | static struct mv643xx_eth_platform_data dove_dt_ge00_data = { | ||
404 | .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT, | ||
405 | }; | ||
406 | |||
407 | static void __init dove_dt_init(void) | ||
408 | { | ||
409 | pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n", | ||
410 | (dove_tclk + 499999) / 1000000); | ||
411 | |||
412 | #ifdef CONFIG_CACHE_TAUROS2 | ||
413 | tauros2_init(); | ||
414 | #endif | ||
415 | dove_setup_cpu_mbus(); | ||
416 | |||
417 | /* Setup root of clk tree */ | ||
418 | dove_clk_init(); | ||
419 | |||
420 | /* Internal devices not ported to DT yet */ | ||
421 | dove_rtc_init(); | ||
422 | dove_xor0_init(); | ||
423 | dove_xor1_init(); | ||
424 | |||
425 | dove_ge00_init(&dove_dt_ge00_data); | ||
426 | dove_ehci0_init(); | ||
427 | dove_ehci1_init(); | ||
428 | dove_pcie_init(1, 1); | ||
429 | dove_crypto_init(); | ||
430 | |||
431 | of_platform_populate(NULL, of_default_bus_match_table, | ||
432 | dove_auxdata_lookup, NULL); | ||
433 | } | ||
434 | |||
435 | static const char * const dove_dt_board_compat[] = { | ||
436 | "marvell,dove", | ||
437 | NULL | ||
438 | }; | ||
439 | |||
440 | DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)") | ||
441 | .map_io = dove_map_io, | ||
442 | .init_early = dove_init_early, | ||
443 | .init_irq = orion_dt_init_irq, | ||
444 | .timer = &dove_timer, | ||
445 | .init_machine = dove_dt_init, | ||
446 | .restart = dove_restart, | ||
447 | .dt_compat = dove_dt_board_compat, | ||
448 | MACHINE_END | ||
449 | #endif | ||