board-marzen-reference.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * marzen board support - Reference DT implementation
  3. *
  4. * Copyright (C) 2011 Renesas Solutions Corp.
  5. * Copyright (C) 2011 Magnus Damm
  6. * Copyright (C) 2013 Simon Horman
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; version 2 of the License.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #include <linux/clk/shmobile.h>
  22. #include <linux/clocksource.h>
  23. #include <linux/of_platform.h>
  24. #include <asm/irq.h>
  25. #include <asm/mach/arch.h>
  26. #include "clock.h"
  27. #include "common.h"
  28. #include "irqs.h"
  29. #include "r8a7779.h"
  30. static void __init marzen_init_timer(void)
  31. {
  32. r8a7779_clocks_init(r8a7779_read_mode_pins());
  33. clocksource_of_init();
  34. }
  35. /*
  36. * This is a really crude hack to provide clkdev support to platform
  37. * devices until they get moved to DT.
  38. */
  39. static const struct clk_name clk_names[] __initconst = {
  40. { "tmu0", "fck", "sh-tmu.0" },
  41. };
  42. static void __init marzen_init(void)
  43. {
  44. shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
  45. r8a7779_add_standard_devices_dt();
  46. of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  47. r8a7779_init_irq_extpin_dt(1); /* IRQ1 as individual interrupt */
  48. }
  49. static const char *marzen_boards_compat_dt[] __initdata = {
  50. "renesas,marzen",
  51. "renesas,marzen-reference",
  52. NULL,
  53. };
  54. DT_MACHINE_START(MARZEN, "marzen")
  55. .smp = smp_ops(r8a7779_smp_ops),
  56. .map_io = r8a7779_map_io,
  57. .init_early = shmobile_init_delay,
  58. .init_time = marzen_init_timer,
  59. .nr_irqs = NR_IRQS_LEGACY,
  60. .init_irq = r8a7779_init_irq_dt,
  61. .init_machine = marzen_init,
  62. .dt_compat = marzen_boards_compat_dt,
  63. MACHINE_END