setup-sh7709.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*
  2. * SH7707/SH7709 Setup
  3. *
  4. * Copyright (C) 2006 Paul Mundt
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/platform_device.h>
  11. #include <linux/init.h>
  12. #include <linux/serial.h>
  13. #include <asm/sci.h>
  14. static struct resource rtc_resources[] = {
  15. [0] = {
  16. .start = 0xfffffec0,
  17. .end = 0xfffffec0 + 0x1e,
  18. .flags = IORESOURCE_IO,
  19. },
  20. [1] = {
  21. .start = 20,
  22. .flags = IORESOURCE_IRQ,
  23. },
  24. [2] = {
  25. .start = 21,
  26. .flags = IORESOURCE_IRQ,
  27. },
  28. [3] = {
  29. .start = 22,
  30. .flags = IORESOURCE_IRQ,
  31. },
  32. };
  33. static struct plat_sci_port sci_platform_data[] = {
  34. {
  35. .mapbase = 0xfffffe80,
  36. .flags = UPF_BOOT_AUTOCONF,
  37. .type = PORT_SCI,
  38. .irqs = { 23, 24, 25, 0 },
  39. }, {
  40. .mapbase = 0xa4000150,
  41. .flags = UPF_BOOT_AUTOCONF,
  42. .type = PORT_SCIF,
  43. .irqs = { 56, 57, 59, 58 },
  44. }, {
  45. .mapbase = 0xa4000140,
  46. .flags = UPF_BOOT_AUTOCONF,
  47. .type = PORT_IRDA,
  48. .irqs = { 52, 53, 55, 54 },
  49. }, {
  50. .flags = 0,
  51. }
  52. };
  53. static struct platform_device sci_device = {
  54. .name = "sh-sci",
  55. .id = -1,
  56. .dev = {
  57. .platform_data = sci_platform_data,
  58. },
  59. };
  60. static struct platform_device rtc_device = {
  61. .name = "sh-rtc",
  62. .id = -1,
  63. .num_resources = ARRAY_SIZE(rtc_resources),
  64. .resource = rtc_resources,
  65. };
  66. static struct platform_device *sh7709_devices[] __initdata = {
  67. &sci_device,
  68. &rtc_device,
  69. };
  70. static int __init sh7709_devices_setup(void)
  71. {
  72. return platform_add_devices(sh7709_devices,
  73. ARRAY_SIZE(sh7709_devices));
  74. }
  75. __initcall(sh7709_devices_setup);
  76. static struct ipr_data ipr_irq_table[] = {
  77. { 16, 0, 12, 2 }, /* TMU TUNI0 */
  78. { 17, 0, 8, 4 }, /* TMU TUNI1 */
  79. { 18, 0, 4, 1 }, /* TMU TUNI1 */
  80. { 19, 0, 4, 1 }, /* TMU TUNI1 */
  81. { 20, 0, 0, 2 }, /* RTC CUI */
  82. { 21, 0, 0, 2 }, /* RTC CUI */
  83. { 22, 0, 0, 2 }, /* RTC CUI */
  84. { 23, 1, 4, 3 }, /* SCI */
  85. { 24, 1, 4, 3 }, /* SCI */
  86. { 25, 1, 4, 3 }, /* SCI */
  87. { 26, 1, 4, 3 }, /* SCI */
  88. { 27, 1, 12, 3 }, /* WDT ITI */
  89. { 32, 2, 0, 1 }, /* IRQ 0 */
  90. { 33, 2, 4, 1 }, /* IRQ 1 */
  91. { 34, 2, 8, 1 }, /* IRQ 2 APM */
  92. { 35, 2, 12, 1 }, /* IRQ 3 TOUCHSCREEN */
  93. { 36, 3, 0, 1 }, /* IRQ 4 */
  94. { 37, 3, 4, 1 }, /* IRQ 5 */
  95. { 48, 4, 12, 7 }, /* DMA */
  96. { 49, 4, 12, 7 }, /* DMA */
  97. { 50, 4, 12, 7 }, /* DMA */
  98. { 51, 4, 12, 7 }, /* DMA */
  99. { 52, 4, 8, 3 }, /* IRDA */
  100. { 53, 4, 8, 3 }, /* IRDA */
  101. { 54, 4, 8, 3 }, /* IRDA */
  102. { 55, 4, 8, 3 }, /* IRDA */
  103. { 56, 4, 4, 3 }, /* SCIF */
  104. { 57, 4, 4, 3 }, /* SCIF */
  105. { 58, 4, 4, 3 }, /* SCIF */
  106. { 59, 4, 4, 3 }, /* SCIF */
  107. };
  108. static unsigned long ipr_offsets[] = {
  109. 0xfffffee2, /* 0: IPRA */
  110. 0xfffffee4, /* 1: IPRB */
  111. 0xa4000016, /* 2: IPRC */
  112. 0xa4000018, /* 3: IPRD */
  113. 0xa400001a, /* 4: IPRE */
  114. };
  115. static struct ipr_desc ipr_irq_desc = {
  116. .ipr_offsets = ipr_offsets,
  117. .nr_offsets = ARRAY_SIZE(ipr_offsets),
  118. .ipr_data = ipr_irq_table,
  119. .nr_irqs = ARRAY_SIZE(ipr_irq_table),
  120. .chip = {
  121. .name = "IPR-sh7709",
  122. },
  123. };
  124. void __init plat_irq_setup(void)
  125. {
  126. register_ipr_controller(&ipr_irq_desc);
  127. }