setup.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * linux/arch/sh/boards/se/7721/setup.c
  3. *
  4. * Copyright (C) 2008 Renesas Solutions Corp.
  5. *
  6. * Hitachi UL SolutionEngine 7721 Support.
  7. *
  8. * This file is subject to the terms and conditions of the GNU General Public
  9. * License. See the file "COPYING" in the main directory of this archive
  10. * for more details.
  11. *
  12. */
  13. #include <linux/init.h>
  14. #include <linux/platform_device.h>
  15. #include <mach-se/mach/se7721.h>
  16. #include <mach-se/mach/mrshpc.h>
  17. #include <asm/machvec.h>
  18. #include <asm/io.h>
  19. #include <asm/heartbeat.h>
  20. static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
  21. static struct heartbeat_data heartbeat_data = {
  22. .bit_pos = heartbeat_bit_pos,
  23. .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
  24. .regsize = 16,
  25. };
  26. static struct resource heartbeat_resources[] = {
  27. [0] = {
  28. .start = PA_LED,
  29. .end = PA_LED,
  30. .flags = IORESOURCE_MEM,
  31. },
  32. };
  33. static struct platform_device heartbeat_device = {
  34. .name = "heartbeat",
  35. .id = -1,
  36. .dev = {
  37. .platform_data = &heartbeat_data,
  38. },
  39. .num_resources = ARRAY_SIZE(heartbeat_resources),
  40. .resource = heartbeat_resources,
  41. };
  42. static struct resource cf_ide_resources[] = {
  43. [0] = {
  44. .start = PA_MRSHPC_IO + 0x1f0,
  45. .end = PA_MRSHPC_IO + 0x1f0 + 8 ,
  46. .flags = IORESOURCE_IO,
  47. },
  48. [1] = {
  49. .start = PA_MRSHPC_IO + 0x1f0 + 0x206,
  50. .end = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
  51. .flags = IORESOURCE_IO,
  52. },
  53. [2] = {
  54. .start = MRSHPC_IRQ0,
  55. .flags = IORESOURCE_IRQ,
  56. },
  57. };
  58. static struct platform_device cf_ide_device = {
  59. .name = "pata_platform",
  60. .id = -1,
  61. .num_resources = ARRAY_SIZE(cf_ide_resources),
  62. .resource = cf_ide_resources,
  63. };
  64. static struct platform_device *se7721_devices[] __initdata = {
  65. &cf_ide_device,
  66. &heartbeat_device
  67. };
  68. static int __init se7721_devices_setup(void)
  69. {
  70. mrshpc_setup_windows();
  71. return platform_add_devices(se7721_devices, ARRAY_SIZE(se7721_devices));
  72. }
  73. device_initcall(se7721_devices_setup);
  74. static void __init se7721_setup(char **cmdline_p)
  75. {
  76. /* for USB */
  77. ctrl_outw(0x0000, 0xA405010C); /* PGCR */
  78. ctrl_outw(0x0000, 0xA405010E); /* PHCR */
  79. ctrl_outw(0x00AA, 0xA4050118); /* PPCR */
  80. ctrl_outw(0x0000, 0xA4050124); /* PSELA */
  81. }
  82. /*
  83. * The Machine Vector
  84. */
  85. struct sh_machine_vector mv_se7721 __initmv = {
  86. .mv_name = "Solution Engine 7721",
  87. .mv_setup = se7721_setup,
  88. .mv_nr_irqs = 109,
  89. .mv_init_irq = init_se7721_IRQ,
  90. };