board-dt.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 <asm/hardware/cache-tauros2.h>
  15. #include <asm/mach/arch.h>
  16. #include <mach/dove.h>
  17. #include <mach/pm.h>
  18. #include <plat/common.h>
  19. #include "common.h"
  20. /*
  21. * There are still devices that doesn't even know about DT,
  22. * get clock gates here and add a clock lookup.
  23. */
  24. static void __init dove_legacy_clk_init(void)
  25. {
  26. struct device_node *np = of_find_compatible_node(NULL, NULL,
  27. "marvell,dove-gating-clock");
  28. struct of_phandle_args clkspec;
  29. clkspec.np = np;
  30. clkspec.args_count = 1;
  31. clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
  32. orion_clkdev_add("0", "pcie",
  33. of_clk_get_from_provider(&clkspec));
  34. clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
  35. orion_clkdev_add("1", "pcie",
  36. of_clk_get_from_provider(&clkspec));
  37. }
  38. static void __init dove_dt_init_early(void)
  39. {
  40. mvebu_mbus_init("marvell,dove-mbus",
  41. BRIDGE_WINS_BASE, BRIDGE_WINS_SZ,
  42. DOVE_MC_WINS_BASE, DOVE_MC_WINS_SZ);
  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 clocks for legacy devices */
  52. dove_legacy_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_dt_init_early,
  64. .init_machine = dove_dt_init,
  65. .restart = dove_restart,
  66. .dt_compat = dove_dt_board_compat,
  67. MACHINE_END