setup-sh7709.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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=0*N*-1
  51. #define IPRA(N) IPRx(0xfffffee2UL,N)
  52. #define IPRB(N) IPRx(0xfffffee4UL,N)
  53. #define IPRE(N) IPRx(0xa400001aUL,N)
  54. static struct ipr_data sh7709_ipr_map[] = {
  55. [16] = { IPRA(15-12), 2 }, /* TMU TUNI0 */
  56. [17] = { IPRA(11-8), 4 }, /* TMU TUNI1 */
  57. [22] = { IPRA(3-0), 2 }, /* RTC CUI */
  58. [23 ... 26] = { IPRB(7-4), 3 }, /* SCI */
  59. [27] = { IPRB(15-12), 2 }, /* WDT ITI */
  60. [48 ... 51] = { IPRE(15-12), 7 }, /* DMA */
  61. [52 ... 55] = { IPRE(11-8), 3 }, /* IRDA */
  62. [56 ... 59] = { IPRE(7-4), 3 }, /* SCIF */
  63. };
  64. void __init init_IRQ_ipr()
  65. {
  66. make_ipr_irq(sh7709_ipr_map, ARRAY_SIZE(sh7709_ipr_map));
  67. }