setup-sh7780.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * SH7780 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 = 0xffe80000,
  17. .end = 0xffe80000 + 0x58 - 1,
  18. .flags = IORESOURCE_IO,
  19. },
  20. [1] = {
  21. /* Period IRQ */
  22. .start = 21,
  23. .flags = IORESOURCE_IRQ,
  24. },
  25. [2] = {
  26. /* Carry IRQ */
  27. .start = 22,
  28. .flags = IORESOURCE_IRQ,
  29. },
  30. [3] = {
  31. /* Alarm IRQ */
  32. .start = 23,
  33. .flags = IORESOURCE_IRQ,
  34. },
  35. };
  36. static struct platform_device rtc_device = {
  37. .name = "sh-rtc",
  38. .id = -1,
  39. .num_resources = ARRAY_SIZE(rtc_resources),
  40. .resource = rtc_resources,
  41. };
  42. static struct plat_sci_port sci_platform_data[] = {
  43. {
  44. .mapbase = 0xffe00000,
  45. .flags = UPF_BOOT_AUTOCONF,
  46. .type = PORT_SCIF,
  47. .irqs = { 40, 41, 43, 42 },
  48. }, {
  49. .mapbase = 0xffe10000,
  50. .flags = UPF_BOOT_AUTOCONF,
  51. .type = PORT_SCIF,
  52. .irqs = { 76, 77, 79, 78 },
  53. }, {
  54. .flags = 0,
  55. }
  56. };
  57. static struct platform_device sci_device = {
  58. .name = "sh-sci",
  59. .id = -1,
  60. .dev = {
  61. .platform_data = sci_platform_data,
  62. },
  63. };
  64. static struct platform_device *sh7780_devices[] __initdata = {
  65. &rtc_device,
  66. &sci_device,
  67. };
  68. static int __init sh7780_devices_setup(void)
  69. {
  70. return platform_add_devices(sh7780_devices,
  71. ARRAY_SIZE(sh7780_devices));
  72. }
  73. __initcall(sh7780_devices_setup);
  74. static struct intc2_data intc2_irq_table[] = {
  75. { TIMER_IRQ, 0, 24, 0, INTC_TMU0_MSK, 2 },
  76. { 21, 1, 0, 0, INTC_RTC_MSK, TIMER_PRIORITY },
  77. { 22, 1, 1, 0, INTC_RTC_MSK, TIMER_PRIORITY },
  78. { 23, 1, 2, 0, INTC_RTC_MSK, TIMER_PRIORITY },
  79. { SCIF0_ERI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
  80. { SCIF0_RXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
  81. { SCIF0_BRI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
  82. { SCIF0_TXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
  83. { SCIF1_ERI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
  84. { SCIF1_RXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
  85. { SCIF1_BRI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
  86. { SCIF1_TXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
  87. { PCIC0_IRQ, 0x10, 8, 0, INTC_PCIC0_MSK, PCIC0_PRIORITY },
  88. { PCIC1_IRQ, 0x10, 0, 0, INTC_PCIC1_MSK, PCIC1_PRIORITY },
  89. { PCIC2_IRQ, 0x14, 24, 0, INTC_PCIC2_MSK, PCIC2_PRIORITY },
  90. { PCIC3_IRQ, 0x14, 16, 0, INTC_PCIC3_MSK, PCIC3_PRIORITY },
  91. { PCIC4_IRQ, 0x14, 8, 0, INTC_PCIC4_MSK, PCIC4_PRIORITY },
  92. };
  93. void __init init_IRQ_intc2(void)
  94. {
  95. make_intc2_irq(intc2_irq_table, ARRAY_SIZE(intc2_irq_table));
  96. }