setup-sh7619.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * SH7619 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 = 0xf8400000,
  17. .flags = UPF_BOOT_AUTOCONF,
  18. .type = PORT_SCIF,
  19. .irqs = { 88, 89, 91, 90},
  20. }, {
  21. .mapbase = 0xf8410000,
  22. .flags = UPF_BOOT_AUTOCONF,
  23. .type = PORT_SCIF,
  24. .irqs = { 92, 93, 95, 94},
  25. }, {
  26. .mapbase = 0xf8420000,
  27. .flags = UPF_BOOT_AUTOCONF,
  28. .type = PORT_SCIF,
  29. .irqs = { 96, 97, 99, 98},
  30. }, {
  31. .flags = 0,
  32. }
  33. };
  34. static struct platform_device sci_device = {
  35. .name = "sh-sci",
  36. .id = -1,
  37. .dev = {
  38. .platform_data = sci_platform_data,
  39. },
  40. };
  41. static struct platform_device *sh7619_devices[] __initdata = {
  42. &sci_device,
  43. };
  44. static int __init sh7619_devices_setup(void)
  45. {
  46. return platform_add_devices(sh7619_devices,
  47. ARRAY_SIZE(sh7619_devices));
  48. }
  49. __initcall(sh7619_devices_setup);
  50. static struct ipr_data sh7619_ipr_map[] = {
  51. { 86, 0, 4, 2 }, /* CMI0 */
  52. { 88, 1, 12, 3 }, /* SCIF0_ERI */
  53. { 89, 1, 12, 3 }, /* SCIF0_RXI */
  54. { 90, 1, 12, 3 }, /* SCIF0_BRI */
  55. { 91, 1, 12, 3 }, /* SCIF0_TXI */
  56. { 92, 1, 8, 3 }, /* SCIF1_ERI */
  57. { 93, 1, 8, 3 }, /* SCIF1_RXI */
  58. { 94, 1, 8, 3 }, /* SCIF1_BRI */
  59. { 95, 1, 8, 3 }, /* SCIF1_TXI */
  60. { 96, 1, 4, 3 }, /* SCIF2_ERI */
  61. { 97, 1, 4, 3 }, /* SCIF2_RXI */
  62. { 98, 1, 4, 3 }, /* SCIF2_BRI */
  63. { 99, 1, 4, 3 }, /* SCIF2_TXI */
  64. };
  65. static unsigned int ipr_offsets[] = {
  66. 0xf8080000, /* IPRC */
  67. 0xf8080002, /* IPRD */
  68. 0xf8080004, /* IPRE */
  69. 0xf8080006, /* IPRF */
  70. 0xf8080008, /* IPRG */
  71. };
  72. /* given the IPR index return the address of the IPR register */
  73. unsigned int map_ipridx_to_addr(int idx)
  74. {
  75. if (unlikely(idx >= ARRAY_SIZE(ipr_offsets)))
  76. return 0;
  77. return ipr_offsets[idx];
  78. }
  79. void __init init_IRQ_ipr(void)
  80. {
  81. make_ipr_irq(sh7619_ipr_map, ARRAY_SIZE(sh7619_ipr_map));
  82. }