board-kzm9g-reference.c 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * KZM-A9-GT board support - Reference Device Tree Implementation
  3. *
  4. * Copyright (C) 2012 Horms Solutions Ltd.
  5. *
  6. * Based on board-kzm9g.c
  7. * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; version 2 of the License.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. #include <linux/delay.h>
  23. #include <linux/gpio.h>
  24. #include <linux/io.h>
  25. #include <linux/irq.h>
  26. #include <linux/irqchip.h>
  27. #include <linux/input.h>
  28. #include <linux/of_platform.h>
  29. #include <linux/pinctrl/machine.h>
  30. #include <mach/sh73a0.h>
  31. #include <mach/common.h>
  32. #include <asm/hardware/cache-l2x0.h>
  33. #include <asm/mach-types.h>
  34. #include <asm/mach/arch.h>
  35. static const struct pinctrl_map kzm_pinctrl_map[] = {
  36. PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.3", "pfc-sh73a0",
  37. "i2c3_1", "i2c3"),
  38. PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
  39. "scifa4_data", "scifa4"),
  40. PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
  41. "scifa4_ctrl", "scifa4"),
  42. };
  43. static void __init kzm_init(void)
  44. {
  45. sh73a0_add_standard_devices_dt();
  46. pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map));
  47. sh73a0_pinmux_init();
  48. #ifdef CONFIG_CACHE_L2X0
  49. /* Early BRESP enable, Shared attribute override enable, 64K*8way */
  50. l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
  51. #endif
  52. }
  53. static void kzm9g_restart(char mode, const char *cmd)
  54. {
  55. #define RESCNT2 IOMEM(0xe6188020)
  56. /* Do soft power on reset */
  57. writel((1 << 31), RESCNT2);
  58. }
  59. static const char *kzm9g_boards_compat_dt[] __initdata = {
  60. "renesas,kzm9g-reference",
  61. NULL,
  62. };
  63. /* Please note that the clock initialisation shcheme used in
  64. * sh73a0_add_early_devices_dt() and sh73a0_add_standard_devices_dt()
  65. * does not work with SMP as there is a yet to be resolved lock-up in
  66. * workqueue initialisation.
  67. *
  68. * CONFIG_SMP should be disabled when using this code.
  69. */
  70. DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
  71. .smp = smp_ops(sh73a0_smp_ops),
  72. .map_io = sh73a0_map_io,
  73. .init_early = sh73a0_init_delay,
  74. .nr_irqs = NR_IRQS_LEGACY,
  75. .init_irq = irqchip_init,
  76. .init_machine = kzm_init,
  77. .init_late = shmobile_init_late,
  78. .init_time = shmobile_timer_init,
  79. .restart = kzm9g_restart,
  80. .dt_compat = kzm9g_boards_compat_dt,
  81. MACHINE_END