setup-sh7785.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * SH7785 Setup
  3. *
  4. * Copyright (C) 2007 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 plat_sci_port sci_platform_data[] = {
  15. {
  16. .mapbase = 0xffea0000,
  17. .flags = UPF_BOOT_AUTOCONF,
  18. .type = PORT_SCIF,
  19. .irqs = { 40, 41, 43, 42 },
  20. }, {
  21. .mapbase = 0xffeb0000,
  22. .flags = UPF_BOOT_AUTOCONF,
  23. .type = PORT_SCIF,
  24. .irqs = { 44, 45, 47, 46 },
  25. },
  26. /*
  27. * The rest of these all have multiplexed IRQs
  28. */
  29. {
  30. .mapbase = 0xffec0000,
  31. .flags = UPF_BOOT_AUTOCONF,
  32. .type = PORT_SCIF,
  33. .irqs = { 60, 60, 60, 60 },
  34. }, {
  35. .mapbase = 0xffed0000,
  36. .flags = UPF_BOOT_AUTOCONF,
  37. .type = PORT_SCIF,
  38. .irqs = { 61, 61, 61, 61 },
  39. }, {
  40. .mapbase = 0xffee0000,
  41. .flags = UPF_BOOT_AUTOCONF,
  42. .type = PORT_SCIF,
  43. .irqs = { 62, 62, 62, 62 },
  44. }, {
  45. .mapbase = 0xffef0000,
  46. .flags = UPF_BOOT_AUTOCONF,
  47. .type = PORT_SCIF,
  48. .irqs = { 63, 63, 63, 63 },
  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 *sh7785_devices[] __initdata = {
  61. &sci_device,
  62. };
  63. static int __init sh7785_devices_setup(void)
  64. {
  65. return platform_add_devices(sh7785_devices,
  66. ARRAY_SIZE(sh7785_devices));
  67. }
  68. __initcall(sh7785_devices_setup);
  69. static struct intc2_data intc2_irq_table[] = {
  70. { 28, 0, 24, 0, 0, 2 }, /* TMU0 */
  71. { 40, 8, 24, 0, 2, 3 }, /* SCIF0 ERI */
  72. { 41, 8, 24, 0, 2, 3 }, /* SCIF0 RXI */
  73. { 42, 8, 24, 0, 2, 3 }, /* SCIF0 BRI */
  74. { 43, 8, 24, 0, 2, 3 }, /* SCIF0 TXI */
  75. { 44, 8, 16, 0, 3, 3 }, /* SCIF1 ERI */
  76. { 45, 8, 16, 0, 3, 3 }, /* SCIF1 RXI */
  77. { 46, 8, 16, 0, 3, 3 }, /* SCIF1 BRI */
  78. { 47, 8, 16, 0, 3, 3 }, /* SCIF1 TXI */
  79. { 64, 0x14, 8, 0, 14, 2 }, /* PCIC0 */
  80. { 65, 0x14, 0, 0, 15, 2 }, /* PCIC1 */
  81. { 66, 0x18, 24, 0, 16, 2 }, /* PCIC2 */
  82. { 67, 0x18, 16, 0, 17, 2 }, /* PCIC3 */
  83. { 68, 0x18, 8, 0, 18, 2 }, /* PCIC4 */
  84. { 60, 8, 8, 0, 4, 3 }, /* SCIF2 ERI, RXI, BRI, TXI */
  85. { 60, 8, 0, 0, 5, 3 }, /* SCIF3 ERI, RXI, BRI, TXI */
  86. { 60, 12, 24, 0, 6, 3 }, /* SCIF4 ERI, RXI, BRI, TXI */
  87. { 60, 12, 16, 0, 7, 3 }, /* SCIF5 ERI, RXI, BRI, TXI */
  88. };
  89. void __init init_IRQ_intc2(void)
  90. {
  91. make_intc2_irq(intc2_irq_table, ARRAY_SIZE(intc2_irq_table));
  92. }