board-dt.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * arch/arm/mach-dove/board-dt.c
  3. *
  4. * Marvell Dove 88AP510 System On Chip FDT Board
  5. *
  6. * This file is licensed under the terms of the GNU General Public
  7. * License version 2. This program is licensed "as is" without any
  8. * warranty of any kind, whether express or implied.
  9. */
  10. #include <linux/init.h>
  11. #include <linux/clk-provider.h>
  12. #include <linux/clocksource.h>
  13. #include <linux/irqchip.h>
  14. #include <linux/of.h>
  15. #include <linux/of_platform.h>
  16. #include <linux/platform_data/usb-ehci-orion.h>
  17. #include <asm/hardware/cache-tauros2.h>
  18. #include <asm/mach/arch.h>
  19. #include <mach/dove.h>
  20. #include <mach/pm.h>
  21. #include <plat/common.h>
  22. #include <plat/irq.h>
  23. #include "common.h"
  24. /*
  25. * There are still devices that doesn't even know about DT,
  26. * get clock gates here and add a clock lookup.
  27. */
  28. static void __init dove_legacy_clk_init(void)
  29. {
  30. struct device_node *np = of_find_compatible_node(NULL, NULL,
  31. "marvell,dove-gating-clock");
  32. struct of_phandle_args clkspec;
  33. clkspec.np = np;
  34. clkspec.args_count = 1;
  35. clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
  36. orion_clkdev_add("0", "pcie",
  37. of_clk_get_from_provider(&clkspec));
  38. clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
  39. orion_clkdev_add("1", "pcie",
  40. of_clk_get_from_provider(&clkspec));
  41. }
  42. static void __init dove_dt_time_init(void)
  43. {
  44. of_clk_init(NULL);
  45. clocksource_of_init();
  46. }
  47. static void __init dove_dt_init_early(void)
  48. {
  49. mvebu_mbus_init("marvell,dove-mbus",
  50. BRIDGE_WINS_BASE, BRIDGE_WINS_SZ,
  51. DOVE_MC_WINS_BASE, DOVE_MC_WINS_SZ);
  52. }
  53. static void __init dove_dt_init(void)
  54. {
  55. pr_info("Dove 88AP510 SoC\n");
  56. #ifdef CONFIG_CACHE_TAUROS2
  57. tauros2_init(0);
  58. #endif
  59. dove_setup_cpu_wins();
  60. /* Setup clocks for legacy devices */
  61. dove_legacy_clk_init();
  62. /* Internal devices not ported to DT yet */
  63. dove_pcie_init(1, 1);
  64. of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  65. }
  66. static const char * const dove_dt_board_compat[] = {
  67. "marvell,dove",
  68. NULL
  69. };
  70. DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
  71. .map_io = dove_map_io,
  72. .init_early = dove_dt_init_early,
  73. .init_time = dove_dt_time_init,
  74. .init_machine = dove_dt_init,
  75. .restart = dove_restart,
  76. .dt_compat = dove_dt_board_compat,
  77. MACHINE_END