setup-sh7780.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * SH7780 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 resource rtc_resources[] = {
  15. [0] = {
  16. .start = 0xffe80000,
  17. .end = 0xffe80000 + 0x58 - 1,
  18. .flags = IORESOURCE_IO,
  19. },
  20. [1] = {
  21. /* Period IRQ */
  22. .start = 21,
  23. .flags = IORESOURCE_IRQ,
  24. },
  25. [2] = {
  26. /* Carry IRQ */
  27. .start = 22,
  28. .flags = IORESOURCE_IRQ,
  29. },
  30. [3] = {
  31. /* Alarm IRQ */
  32. .start = 23,
  33. .flags = IORESOURCE_IRQ,
  34. },
  35. };
  36. static struct platform_device rtc_device = {
  37. .name = "sh-rtc",
  38. .id = -1,
  39. .num_resources = ARRAY_SIZE(rtc_resources),
  40. .resource = rtc_resources,
  41. };
  42. static struct plat_sci_port sci_platform_data[] = {
  43. {
  44. .mapbase = 0xffe00000,
  45. .flags = UPF_BOOT_AUTOCONF,
  46. .type = PORT_SCIF,
  47. .irqs = { 40, 41, 43, 42 },
  48. }, {
  49. .mapbase = 0xffe10000,
  50. .flags = UPF_BOOT_AUTOCONF,
  51. .type = PORT_SCIF,
  52. .irqs = { 76, 77, 79, 78 },
  53. }, {
  54. .flags = 0,
  55. }
  56. };
  57. static struct platform_device sci_device = {
  58. .name = "sh-sci",
  59. .id = -1,
  60. .dev = {
  61. .platform_data = sci_platform_data,
  62. },
  63. };
  64. static struct platform_device *sh7780_devices[] __initdata = {
  65. &rtc_device,
  66. &sci_device,
  67. };
  68. static int __init sh7780_devices_setup(void)
  69. {
  70. return platform_add_devices(sh7780_devices,
  71. ARRAY_SIZE(sh7780_devices));
  72. }
  73. __initcall(sh7780_devices_setup);