board-marzen.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * marzen board support
  3. *
  4. * Copyright (C) 2011 Renesas Solutions Corp.
  5. * Copyright (C) 2011 Magnus Damm
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; version 2 of the License.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #include <linux/kernel.h>
  21. #include <linux/init.h>
  22. #include <linux/interrupt.h>
  23. #include <linux/irq.h>
  24. #include <linux/platform_device.h>
  25. #include <linux/delay.h>
  26. #include <linux/io.h>
  27. #include <linux/dma-mapping.h>
  28. #include <mach/hardware.h>
  29. #include <mach/r8a7779.h>
  30. #include <mach/common.h>
  31. #include <asm/mach-types.h>
  32. #include <asm/mach/arch.h>
  33. #include <asm/mach/map.h>
  34. #include <asm/mach/time.h>
  35. #include <asm/hardware/gic.h>
  36. #include <asm/traps.h>
  37. static struct platform_device *marzen_devices[] __initdata = {
  38. };
  39. static struct map_desc marzen_io_desc[] __initdata = {
  40. /* 2M entity map for 0xf0000000 (MPCORE) */
  41. {
  42. .virtual = 0xf0000000,
  43. .pfn = __phys_to_pfn(0xf0000000),
  44. .length = SZ_2M,
  45. .type = MT_DEVICE_NONSHARED
  46. },
  47. /* 16M entity map for 0xfexxxxxx (DMAC-S/HPBREG/INTC2/LRAM/DBSC) */
  48. {
  49. .virtual = 0xfe000000,
  50. .pfn = __phys_to_pfn(0xfe000000),
  51. .length = SZ_16M,
  52. .type = MT_DEVICE_NONSHARED
  53. },
  54. };
  55. static void __init marzen_map_io(void)
  56. {
  57. iotable_init(marzen_io_desc, ARRAY_SIZE(marzen_io_desc));
  58. }
  59. static void __init marzen_init_early(void)
  60. {
  61. r8a7779_add_early_devices();
  62. /* Early serial console setup is not included here due to
  63. * memory map collisions. The SCIF serial ports in r8a7779
  64. * are difficult to entity map 1:1 due to collision with the
  65. * virtual memory range used by the coherent DMA code on ARM.
  66. *
  67. * Anyone wanting to debug early can remove UPF_IOREMAP from
  68. * the sh-sci serial console platform data, adjust mapbase
  69. * to a static M:N virt:phys mapping that needs to be added to
  70. * the mappings passed with iotable_init() above.
  71. *
  72. * Then add a call to shmobile_setup_console() from this function.
  73. *
  74. * As a final step pass earlyprint=sh-sci.2,115200 on the kernel
  75. * command line.
  76. */
  77. }
  78. static void __init marzen_init(void)
  79. {
  80. r8a7779_pinmux_init();
  81. r8a7779_add_standard_devices();
  82. platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
  83. }
  84. static void __init marzen_timer_init(void)
  85. {
  86. r8a7779_clock_init();
  87. shmobile_timer.init();
  88. return;
  89. }
  90. struct sys_timer marzen_timer = {
  91. .init = marzen_timer_init,
  92. };
  93. MACHINE_START(MARZEN, "marzen")
  94. .map_io = marzen_map_io,
  95. .init_early = marzen_init_early,
  96. .nr_irqs = NR_IRQS_LEGACY,
  97. .init_irq = r8a7779_init_irq,
  98. .handle_irq = shmobile_handle_irq_gic,
  99. .init_machine = marzen_init,
  100. .timer = &marzen_timer,
  101. MACHINE_END