setup-sh7709.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * SH7707/SH7709 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 = 0xfffffe80,
  17. .flags = UPF_BOOT_AUTOCONF,
  18. .type = PORT_SCI,
  19. .irqs = { 23, 24, 25, 0 },
  20. }, {
  21. .mapbase = 0xa4000150,
  22. .flags = UPF_BOOT_AUTOCONF,
  23. .type = PORT_SCIF,
  24. .irqs = { 56, 57, 59, 58 },
  25. }, {
  26. .mapbase = 0xa4000140,
  27. .flags = UPF_BOOT_AUTOCONF,
  28. .type = PORT_IRDA,
  29. .irqs = { 52, 53, 55, 54 },
  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 *sh7709_devices[] __initdata = {
  42. &sci_device,
  43. };
  44. static int __init sh7709_devices_setup(void)
  45. {
  46. return platform_add_devices(sh7709_devices,
  47. ARRAY_SIZE(sh7709_devices));
  48. }
  49. __initcall(sh7709_devices_setup);
  50. #define IPRx(A,N) .addr=A, .shift=N
  51. #define IPRA(N) IPRx(0xfffffee2UL,N)
  52. #define IPRB(N) IPRx(0xfffffee4UL,N)
  53. #define IPRC(N) IPRx(0xa4000016UL,N)
  54. #define IPRD(N) IPRx(0xa4000018UL,N)
  55. #define IPRE(N) IPRx(0xa400001aUL,N)
  56. static struct ipr_data sh7709_ipr_map[] = {
  57. [16] = { IPRA(12), 2 }, /* TMU TUNI0 */
  58. [17] = { IPRA(8), 4 }, /* TMU TUNI1 */
  59. [18 ... 19] = { IPRA(4), 1 }, /* TMU TUNI1 */
  60. [20 ... 22] = { IPRA(0), 2 }, /* RTC CUI */
  61. [23 ... 26] = { IPRB(4), 3 }, /* SCI */
  62. [27] = { IPRB(12), 2 }, /* WDT ITI */
  63. [32] = { IPRC(0), 1 }, /* IRQ 0 */
  64. [33] = { IPRC(4), 1 }, /* IRQ 1 */
  65. [34] = { IPRC(8), 1 }, /* IRQ 2 APM */
  66. [35] = { IPRC(12), 1 }, /* IRQ 3 TOUCHSCREEN */
  67. [36] = { IPRD(0), 1 }, /* IRQ 4 */
  68. [37] = { IPRD(4), 1 }, /* IRQ 5 */
  69. [48 ... 51] = { IPRE(12), 7 }, /* DMA */
  70. [52 ... 55] = { IPRE(8), 3 }, /* IRDA */
  71. [56 ... 59] = { IPRE(4), 3 }, /* SCIF */
  72. };
  73. void __init init_IRQ_ipr()
  74. {
  75. make_ipr_irq(sh7709_ipr_map, ARRAY_SIZE(sh7709_ipr_map));
  76. }