setup-sh7722.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * SH7722 Setup
  3. *
  4. * Copyright (C) 2006 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 = 0xffe00000,
  17. .flags = UPF_BOOT_AUTOCONF,
  18. .type = PORT_SCIF,
  19. .irqs = { 80, 81, 83, 82 },
  20. }, {
  21. .flags = 0,
  22. }
  23. };
  24. static struct platform_device sci_device = {
  25. .name = "sh-sci",
  26. .id = -1,
  27. .dev = {
  28. .platform_data = sci_platform_data,
  29. },
  30. };
  31. static struct platform_device *sh7722_devices[] __initdata = {
  32. &sci_device,
  33. };
  34. static int __init sh7722_devices_setup(void)
  35. {
  36. return platform_add_devices(sh7722_devices,
  37. ARRAY_SIZE(sh7722_devices));
  38. }
  39. __initcall(sh7722_devices_setup);
  40. static struct ipr_data sh7722_ipr_map[] = {
  41. /* IRQ, IPR-idx, shift, prio */
  42. { 16, 0, 12, 2 }, /* TMU0 */
  43. { 17, 0, 8, 2 }, /* TMU1 */
  44. { 80, 6, 12, 3 }, /* SCIF ERI */
  45. { 81, 6, 12, 3 }, /* SCIF RXI */
  46. { 82, 6, 12, 3 }, /* SCIF BRI */
  47. { 83, 6, 12, 3 }, /* SCIF TXI */
  48. };
  49. static unsigned long ipr_offsets[] = {
  50. 0xa4080000, /* 0: IPRA */
  51. 0xa4080004, /* 1: IPRB */
  52. 0xa4080008, /* 2: IPRC */
  53. 0xa408000c, /* 3: IPRD */
  54. 0xa4080010, /* 4: IPRE */
  55. 0xa4080014, /* 5: IPRF */
  56. 0xa4080018, /* 6: IPRG */
  57. 0xa408001c, /* 7: IPRH */
  58. 0xa4080020, /* 8: IPRI */
  59. 0xa4080024, /* 9: IPRJ */
  60. 0xa4080028, /* 10: IPRK */
  61. 0xa408002c, /* 11: IPRL */
  62. };
  63. unsigned int map_ipridx_to_addr(int idx)
  64. {
  65. if (unlikely(idx >= ARRAY_SIZE(ipr_offsets)))
  66. return 0;
  67. return ipr_offsets[idx];
  68. }
  69. void __init init_IRQ_ipr(void)
  70. {
  71. make_ipr_irq(sh7722_ipr_map, ARRAY_SIZE(sh7722_ipr_map));
  72. }