setup-sh7206.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * SH7206 Setup
  3. *
  4. * Copyright (C) 2006 Yoshinori Sato
  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 plat_sci_port sci_platform_data[] = {
  15. {
  16. .mapbase = 0xfffe8000,
  17. .flags = UPF_BOOT_AUTOCONF,
  18. .type = PORT_SCIF,
  19. .irqs = { 241, 242, 243, 240},
  20. }, {
  21. .mapbase = 0xfffe8800,
  22. .flags = UPF_BOOT_AUTOCONF,
  23. .type = PORT_SCIF,
  24. .irqs = { 247, 244, 245, 246},
  25. }, {
  26. .mapbase = 0xfffe9000,
  27. .flags = UPF_BOOT_AUTOCONF,
  28. .type = PORT_SCIF,
  29. .irqs = { 249, 250, 251, 248},
  30. }, {
  31. .mapbase = 0xfffe9800,
  32. .flags = UPF_BOOT_AUTOCONF,
  33. .type = PORT_SCIF,
  34. .irqs = { 253, 254, 255, 252},
  35. }, {
  36. .flags = 0,
  37. }
  38. };
  39. static struct platform_device sci_device = {
  40. .name = "sh-sci",
  41. .id = -1,
  42. .dev = {
  43. .platform_data = sci_platform_data,
  44. },
  45. };
  46. static struct platform_device *sh7206_devices[] __initdata = {
  47. &sci_device,
  48. };
  49. static int __init sh7206_devices_setup(void)
  50. {
  51. return platform_add_devices(sh7206_devices,
  52. ARRAY_SIZE(sh7206_devices));
  53. }
  54. __initcall(sh7206_devices_setup);
  55. #define INTC_IPR08 0xfffe0c04UL
  56. #define INTC_IPR09 0xfffe0c06UL
  57. #define INTC_IPR14 0xfffe0c10UL
  58. #define CMI0_IRQ 140
  59. #define MTU1_TGI1A 164
  60. #define SCIF0_BRI_IRQ 240
  61. #define SCIF0_ERI_IRQ 241
  62. #define SCIF0_RXI_IRQ 242
  63. #define SCIF0_TXI_IRQ 243
  64. #define SCIF1_BRI_IRQ 244
  65. #define SCIF1_ERI_IRQ 245
  66. #define SCIF1_RXI_IRQ 246
  67. #define SCIF1_TXI_IRQ 247
  68. #define SCIF2_BRI_IRQ 248
  69. #define SCIF2_ERI_IRQ 249
  70. #define SCIF2_RXI_IRQ 250
  71. #define SCIF2_TXI_IRQ 251
  72. #define SCIF3_BRI_IRQ 252
  73. #define SCIF3_ERI_IRQ 253
  74. #define SCIF3_RXI_IRQ 254
  75. #define SCIF3_TXI_IRQ 255
  76. static struct ipr_data sh7206_ipr_map[] = {
  77. { CMI0_IRQ, INTC_IPR08, 3, 2 },
  78. { MTU2_TGI1A, INTC_IPR09, 1, 2 },
  79. { SCIF0_ERI_IRQ, INTC_IPR14, 3, 3 },
  80. { SCIF0_RXI_IRQ, INTC_IPR14, 3, 3 },
  81. { SCIF0_BRI_IRQ, INTC_IPR14, 3, 3 },
  82. { SCIF0_TXI_IRQ, INTC_IPR14, 3, 3 },
  83. { SCIF1_ERI_IRQ, INTC_IPR14, 2, 3 },
  84. { SCIF1_RXI_IRQ, INTC_IPR14, 2, 3 },
  85. { SCIF1_BRI_IRQ, INTC_IPR14, 2, 3 },
  86. { SCIF1_TXI_IRQ, INTC_IPR14, 2, 3 },
  87. { SCIF2_ERI_IRQ, INTC_IPR14, 1, 3 },
  88. { SCIF2_RXI_IRQ, INTC_IPR14, 1, 3 },
  89. { SCIF2_BRI_IRQ, INTC_IPR14, 1, 3 },
  90. { SCIF2_TXI_IRQ, INTC_IPR14, 1, 3 },
  91. { SCIF3_ERI_IRQ, INTC_IPR14, 0, 3 },
  92. { SCIF3_RXI_IRQ, INTC_IPR14, 0, 3 },
  93. { SCIF3_BRI_IRQ, INTC_IPR14, 0, 3 },
  94. { SCIF3_TXI_IRQ, INTC_IPR14, 0, 3 },
  95. };
  96. void __init init_IRQ_ipr(void)
  97. {
  98. make_ipr_irq(sh7206_ipr_map, ARRAY_SIZE(sh7206_ipr_map));
  99. }