board-dt.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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/clk/mvebu.h>
  13. #include <linux/of.h>
  14. #include <linux/of_platform.h>
  15. #include <linux/platform_data/usb-ehci-orion.h>
  16. #include <asm/hardware/cache-tauros2.h>
  17. #include <asm/mach/arch.h>
  18. #include <mach/pm.h>
  19. #include <plat/common.h>
  20. #include <plat/irq.h>
  21. #include "common.h"
  22. /*
  23. * There are still devices that doesn't even know about DT,
  24. * get clock gates here and add a clock lookup.
  25. */
  26. static void __init dove_legacy_clk_init(void)
  27. {
  28. struct device_node *np = of_find_compatible_node(NULL, NULL,
  29. "marvell,dove-gating-clock");
  30. struct of_phandle_args clkspec;
  31. clkspec.np = np;
  32. clkspec.args_count = 1;
  33. clkspec.args[0] = CLOCK_GATING_BIT_USB0;
  34. orion_clkdev_add(NULL, "orion-ehci.0",
  35. of_clk_get_from_provider(&clkspec));
  36. clkspec.args[0] = CLOCK_GATING_BIT_USB1;
  37. orion_clkdev_add(NULL, "orion-ehci.1",
  38. of_clk_get_from_provider(&clkspec));
  39. clkspec.args[0] = CLOCK_GATING_BIT_GBE;
  40. orion_clkdev_add(NULL, "mv643xx_eth_port.0",
  41. of_clk_get_from_provider(&clkspec));
  42. clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
  43. orion_clkdev_add("0", "pcie",
  44. of_clk_get_from_provider(&clkspec));
  45. clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
  46. orion_clkdev_add("1", "pcie",
  47. of_clk_get_from_provider(&clkspec));
  48. }
  49. static void __init dove_of_clk_init(void)
  50. {
  51. mvebu_clocks_init();
  52. dove_legacy_clk_init();
  53. }
  54. static struct mv643xx_eth_platform_data dove_dt_ge00_data = {
  55. .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
  56. };
  57. static void __init dove_dt_init(void)
  58. {
  59. pr_info("Dove 88AP510 SoC\n");
  60. #ifdef CONFIG_CACHE_TAUROS2
  61. tauros2_init(0);
  62. #endif
  63. dove_setup_cpu_mbus();
  64. /* Setup root of clk tree */
  65. dove_of_clk_init();
  66. /* Internal devices not ported to DT yet */
  67. dove_ge00_init(&dove_dt_ge00_data);
  68. dove_ehci0_init();
  69. dove_ehci1_init();
  70. dove_pcie_init(1, 1);
  71. of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  72. }
  73. static const char * const dove_dt_board_compat[] = {
  74. "marvell,dove",
  75. NULL
  76. };
  77. DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
  78. .map_io = dove_map_io,
  79. .init_early = dove_init_early,
  80. .init_irq = orion_dt_init_irq,
  81. .init_time = dove_timer_init,
  82. .init_machine = dove_dt_init,
  83. .restart = dove_restart,
  84. .dt_compat = dove_dt_board_compat,
  85. MACHINE_END