board-dt.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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_PCIE0;
  33. orion_clkdev_add("0", "pcie",
  34. of_clk_get_from_provider(&clkspec));
  35. clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
  36. orion_clkdev_add("1", "pcie",
  37. of_clk_get_from_provider(&clkspec));
  38. }
  39. static void __init dove_of_clk_init(void)
  40. {
  41. of_clk_init(NULL);
  42. dove_legacy_clk_init();
  43. }
  44. static void __init dove_dt_init(void)
  45. {
  46. pr_info("Dove 88AP510 SoC\n");
  47. #ifdef CONFIG_CACHE_TAUROS2
  48. tauros2_init(0);
  49. #endif
  50. dove_setup_cpu_wins();
  51. /* Setup root of clk tree */
  52. dove_of_clk_init();
  53. /* Internal devices not ported to DT yet */
  54. dove_pcie_init(1, 1);
  55. of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  56. }
  57. static const char * const dove_dt_board_compat[] = {
  58. "marvell,dove",
  59. NULL
  60. };
  61. DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
  62. .map_io = dove_map_io,
  63. .init_early = dove_init_early,
  64. .init_irq = orion_dt_init_irq,
  65. .init_time = dove_timer_init,
  66. .init_machine = dove_dt_init,
  67. .restart = dove_restart,
  68. .dt_compat = dove_dt_board_compat,
  69. MACHINE_END