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