setup-sh7780.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. { 28, 0, 24, 0, 0, 2 }, /* TMU0 */
  76. { 21, 1, 0, 0, 2, 2 },
  77. { 22, 1, 1, 0, 2, 2 },
  78. { 23, 1, 2, 0, 2, 2 },
  79. { 40, 8, 24, 0, 3, 3 }, /* SCIF0 ERI */
  80. { 41, 8, 24, 0, 3, 3 }, /* SCIF0 RXI */
  81. { 42, 8, 24, 0, 3, 3 }, /* SCIF0 BRI */
  82. { 43, 8, 24, 0, 3, 3 }, /* SCIF0 TXI */
  83. { 76, 8, 16, 0, 4, 3 }, /* SCIF1 ERI */
  84. { 77, 8, 16, 0, 4, 3 }, /* SCIF1 RXI */
  85. { 78, 8, 16, 0, 4, 3 }, /* SCIF1 BRI */
  86. { 79, 8, 16, 0, 4, 3 }, /* SCIF1 TXI */
  87. { 64, 0x10, 8, 0, 14, 2 }, /* PCIC0 */
  88. { 65, 0x10, 0, 0, 15, 2 }, /* PCIC1 */
  89. { 66, 0x14, 24, 0, 16, 2 }, /* PCIC2 */
  90. { 67, 0x14, 16, 0, 17, 2 }, /* PCIC3 */
  91. { 68, 0x14, 8, 0, 18, 2 }, /* PCIC4 */
  92. };
  93. void __init init_IRQ_intc2(void)
  94. {
  95. make_intc2_irq(intc2_irq_table, ARRAY_SIZE(intc2_irq_table));
  96. }