setup-shx3.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * SH-X3 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 <linux/io.h>
  14. #include <asm/sci.h>
  15. static struct plat_sci_port sci_platform_data[] = {
  16. {
  17. .mapbase = 0xffc30000,
  18. .flags = UPF_BOOT_AUTOCONF,
  19. .type = PORT_SCIF,
  20. .irqs = { 40, 41, 43, 42 },
  21. }, {
  22. .mapbase = 0xffc40000,
  23. .flags = UPF_BOOT_AUTOCONF,
  24. .type = PORT_SCIF,
  25. .irqs = { 44, 45, 47, 46 },
  26. }, {
  27. .mapbase = 0xffc50000,
  28. .flags = UPF_BOOT_AUTOCONF,
  29. .type = PORT_SCIF,
  30. .irqs = { 48, 49, 51, 50 },
  31. }, {
  32. .mapbase = 0xffc60000,
  33. .flags = UPF_BOOT_AUTOCONF,
  34. .type = PORT_SCIF,
  35. .irqs = { 52, 53, 55, 54 },
  36. }, {
  37. .flags = 0,
  38. }
  39. };
  40. static struct platform_device sci_device = {
  41. .name = "sh-sci",
  42. .id = -1,
  43. .dev = {
  44. .platform_data = sci_platform_data,
  45. },
  46. };
  47. static struct platform_device *shx3_devices[] __initdata = {
  48. &sci_device,
  49. };
  50. static int __init shx3_devices_setup(void)
  51. {
  52. return platform_add_devices(shx3_devices,
  53. ARRAY_SIZE(shx3_devices));
  54. }
  55. __initcall(shx3_devices_setup);
  56. static struct intc2_data intc2_irq_table[] = {
  57. { 16, 0, 0, 0, 1, 2 }, /* TMU0 */
  58. { 40, 4, 0, 0x20, 0, 3 }, /* SCIF0 ERI */
  59. { 41, 4, 0, 0x20, 1, 3 }, /* SCIF0 RXI */
  60. { 42, 4, 0, 0x20, 2, 3 }, /* SCIF0 BRI */
  61. { 43, 4, 0, 0x20, 3, 3 }, /* SCIF0 TXI */
  62. };
  63. static struct intc2_desc intc2_irq_desc __read_mostly = {
  64. .prio_base = 0xfe410000,
  65. .msk_base = 0xfe410820,
  66. .mskclr_base = 0xfe410850,
  67. .intc2_data = intc2_irq_table,
  68. .nr_irqs = ARRAY_SIZE(intc2_irq_table),
  69. .chip = {
  70. .name = "INTC2-SHX3",
  71. },
  72. };
  73. void __init plat_irq_setup(void)
  74. {
  75. register_intc2_controller(&intc2_irq_desc);
  76. }