setup-sh7710.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * SH7710 Setup
  3. *
  4. * Copyright (C) 2006 Paul Mundt
  5. * Copyright (C) 2007 Nobuhiro Iwamatsu
  6. *
  7. * This file is subject to the terms and conditions of the GNU General Public
  8. * License. See the file "COPYING" in the main directory of this archive
  9. * for more details.
  10. */
  11. #include <linux/platform_device.h>
  12. #include <linux/init.h>
  13. #include <linux/serial.h>
  14. #include <asm/sci.h>
  15. static struct plat_sci_port sci_platform_data[] = {
  16. {
  17. .mapbase = 0xa4400000,
  18. .flags = UPF_BOOT_AUTOCONF,
  19. .type = PORT_SCIF,
  20. .irqs = { 52, 53, 55, 54 },
  21. }, {
  22. .mapbase = 0xa4420000,
  23. .flags = UPF_BOOT_AUTOCONF,
  24. .type = PORT_SCIF,
  25. .irqs = { 56, 57, 59, 58 },
  26. }, {
  27. .flags = 0,
  28. }
  29. };
  30. static struct platform_device sci_device = {
  31. .name = "sh-sci",
  32. .id = -1,
  33. .dev = {
  34. .platform_data = sci_platform_data,
  35. },
  36. };
  37. static struct platform_device *sh7710_devices[] __initdata = {
  38. &sci_device,
  39. };
  40. static int __init sh7710_devices_setup(void)
  41. {
  42. return platform_add_devices(sh7710_devices,
  43. ARRAY_SIZE(sh7710_devices));
  44. }
  45. __initcall(sh7710_devices_setup);
  46. static struct ipr_data sh7710_ipr_map[] = {
  47. /* IRQ, IPR-idx, shift, priority */
  48. { 16, 0, 12, 2 }, /* TMU0 TUNI*/
  49. { 17, 0, 8, 2 }, /* TMU1 TUNI */
  50. { 18, 0, 4, 2 }, /* TMU2 TUNI */
  51. { 27, 1, 12, 2 }, /* WDT ITI */
  52. { 20, 0, 0, 2 }, /* RTC ATI (alarm) */
  53. { 21, 0, 0, 2 }, /* RTC PRI (period) */
  54. { 22, 0, 0, 2 }, /* RTC CUI (carry) */
  55. { 48, 4, 12, 7 }, /* DMAC DMTE0 */
  56. { 49, 4, 12, 7 }, /* DMAC DMTE1 */
  57. { 50, 4, 12, 7 }, /* DMAC DMTE2 */
  58. { 51, 4, 12, 7 }, /* DMAC DMTE3 */
  59. { 52, 4, 8, 3 }, /* SCIF0 ERI */
  60. { 53, 4, 8, 3 }, /* SCIF0 RXI */
  61. { 54, 4, 8, 3 }, /* SCIF0 BRI */
  62. { 55, 4, 8, 3 }, /* SCIF0 TXI */
  63. { 56, 4, 4, 3 }, /* SCIF1 ERI */
  64. { 57, 4, 4, 3 }, /* SCIF1 RXI */
  65. { 58, 4, 4, 3 }, /* SCIF1 BRI */
  66. { 59, 4, 4, 3 }, /* SCIF1 TXI */
  67. { 76, 5, 8, 7 }, /* DMAC DMTE4 */
  68. { 77, 5, 8, 7 }, /* DMAC DMTE5 */
  69. { 80, 6, 12, 5 }, /* EDMAC EINT0 */
  70. { 81, 6, 8, 5 }, /* EDMAC EINT1 */
  71. { 82, 6, 4, 5 }, /* EDMAC EINT2 */
  72. };
  73. static unsigned long ipr_offsets[] = {
  74. 0xA414FEE2 /* 0: IPRA */
  75. , 0xA414FEE4 /* 1: IPRB */
  76. , 0xA4140016 /* 2: IPRC */
  77. , 0xA4140018 /* 3: IPRD */
  78. , 0xA414001A /* 4: IPRE */
  79. , 0xA4080000 /* 5: IPRF */
  80. , 0xA4080002 /* 6: IPRG */
  81. , 0xA4080004 /* 7: IPRH */
  82. , 0xA4080006 /* 8: IPRI */
  83. };
  84. /* given the IPR index return the address of the IPR register */
  85. unsigned int map_ipridx_to_addr(int idx)
  86. {
  87. if (idx >= ARRAY_SIZE(ipr_offsets))
  88. return 0;
  89. return ipr_offsets[idx];
  90. }
  91. void __init init_IRQ_ipr()
  92. {
  93. make_ipr_irq(sh7710_ipr_map, ARRAY_SIZE(sh7710_ipr_map));
  94. }