setup-sh7705.c 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * SH7705 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 = 0xa4410000,
  18. .flags = UPF_BOOT_AUTOCONF,
  19. .type = PORT_SCIF,
  20. .irqs = { 56, 57, 59 },
  21. }, {
  22. .mapbase = 0xa4400000,
  23. .flags = UPF_BOOT_AUTOCONF,
  24. .type = PORT_SCIF,
  25. .irqs = { 52, 53, 55 },
  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 *sh7705_devices[] __initdata = {
  38. &sci_device,
  39. };
  40. static int __init sh7705_devices_setup(void)
  41. {
  42. return platform_add_devices(sh7705_devices,
  43. ARRAY_SIZE(sh7705_devices));
  44. }
  45. __initcall(sh7705_devices_setup);
  46. static struct ipr_data ipr_irq_table[] = {
  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. { 55, 4, 8, 3 }, /* SCIF0 TXI */
  62. { 56, 4, 4, 3 }, /* SCIF1 ERI */
  63. { 57, 4, 4, 3 }, /* SCIF1 RXI */
  64. { 59, 4, 4, 3 }, /* SCIF1 TXI */
  65. };
  66. static unsigned long ipr_offsets[] = {
  67. 0xFFFFFEE2, /* 0: IPRA */
  68. 0xFFFFFEE4, /* 1: IPRB */
  69. 0xA4000016, /* 2: IPRC */
  70. 0xA4000018, /* 3: IPRD */
  71. 0xA400001A, /* 4: IPRE */
  72. 0xA4080000, /* 5: IPRF */
  73. 0xA4080002, /* 6: IPRG */
  74. 0xA4080004, /* 7: IPRH */
  75. };
  76. static struct ipr_desc ipr_irq_desc = {
  77. .ipr_offsets = ipr_offsets,
  78. .nr_offsets = ARRAY_SIZE(ipr_offsets),
  79. .ipr_data = ipr_irq_table,
  80. .nr_irqs = ARRAY_SIZE(ipr_irq_table),
  81. .chip = {
  82. .name = "IPR-sh7705",
  83. },
  84. };
  85. void __init plat_irq_setup(void)
  86. {
  87. register_ipr_controller(&ipr_irq_desc);
  88. }