setup-sh5.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * SH5-101/SH5-103 CPU Setup
  3. *
  4. * Copyright (C) 2009 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/serial_sci.h>
  14. #include <linux/io.h>
  15. #include <linux/mm.h>
  16. #include <asm/addrspace.h>
  17. static struct plat_sci_port sci_platform_data[] = {
  18. {
  19. .mapbase = PHYS_PERIPHERAL_BLOCK + 0x01030000,
  20. .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
  21. .type = PORT_SCIF,
  22. .irqs = { 39, 40, 42, 0 },
  23. }, {
  24. .flags = 0,
  25. }
  26. };
  27. static struct platform_device sci_device = {
  28. .name = "sh-sci",
  29. .id = -1,
  30. .dev = {
  31. .platform_data = sci_platform_data,
  32. },
  33. };
  34. static struct resource rtc_resources[] = {
  35. [0] = {
  36. .start = PHYS_PERIPHERAL_BLOCK + 0x01040000,
  37. .end = PHYS_PERIPHERAL_BLOCK + 0x01040000 + 0x58 - 1,
  38. .flags = IORESOURCE_IO,
  39. },
  40. [1] = {
  41. /* Period IRQ */
  42. .start = IRQ_PRI,
  43. .flags = IORESOURCE_IRQ,
  44. },
  45. [2] = {
  46. /* Carry IRQ */
  47. .start = IRQ_CUI,
  48. .flags = IORESOURCE_IRQ,
  49. },
  50. [3] = {
  51. /* Alarm IRQ */
  52. .start = IRQ_ATI,
  53. .flags = IORESOURCE_IRQ,
  54. },
  55. };
  56. static struct platform_device rtc_device = {
  57. .name = "sh-rtc",
  58. .id = -1,
  59. .num_resources = ARRAY_SIZE(rtc_resources),
  60. .resource = rtc_resources,
  61. };
  62. static struct platform_device *sh5_devices[] __initdata = {
  63. &sci_device,
  64. &rtc_device,
  65. };
  66. static int __init sh5_devices_setup(void)
  67. {
  68. return platform_add_devices(sh5_devices,
  69. ARRAY_SIZE(sh5_devices));
  70. }
  71. __initcall(sh5_devices_setup);