setup.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 <asm/machvec.h>
  16. #include <mach-se/mach/se7721.h>
  17. #include <asm/io.h>
  18. #include <asm/heartbeat.h>
  19. static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
  20. static struct heartbeat_data heartbeat_data = {
  21. .bit_pos = heartbeat_bit_pos,
  22. .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
  23. .regsize = 16,
  24. };
  25. static struct resource heartbeat_resources[] = {
  26. [0] = {
  27. .start = PA_LED,
  28. .end = PA_LED,
  29. .flags = IORESOURCE_MEM,
  30. },
  31. };
  32. static struct platform_device heartbeat_device = {
  33. .name = "heartbeat",
  34. .id = -1,
  35. .dev = {
  36. .platform_data = &heartbeat_data,
  37. },
  38. .num_resources = ARRAY_SIZE(heartbeat_resources),
  39. .resource = heartbeat_resources,
  40. };
  41. static struct resource cf_ide_resources[] = {
  42. [0] = {
  43. .start = PA_MRSHPC_IO + 0x1f0,
  44. .end = PA_MRSHPC_IO + 0x1f0 + 8 ,
  45. .flags = IORESOURCE_IO,
  46. },
  47. [1] = {
  48. .start = PA_MRSHPC_IO + 0x1f0 + 0x206,
  49. .end = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
  50. .flags = IORESOURCE_IO,
  51. },
  52. [2] = {
  53. .start = MRSHPC_IRQ0,
  54. .flags = IORESOURCE_IRQ,
  55. },
  56. };
  57. static struct platform_device cf_ide_device = {
  58. .name = "pata_platform",
  59. .id = -1,
  60. .num_resources = ARRAY_SIZE(cf_ide_resources),
  61. .resource = cf_ide_resources,
  62. };
  63. static struct platform_device *se7721_devices[] __initdata = {
  64. &cf_ide_device,
  65. &heartbeat_device
  66. };
  67. static int __init se7721_devices_setup(void)
  68. {
  69. return platform_add_devices(se7721_devices,
  70. ARRAY_SIZE(se7721_devices));
  71. }
  72. device_initcall(se7721_devices_setup);
  73. static void __init se7721_setup(char **cmdline_p)
  74. {
  75. /* for USB */
  76. ctrl_outw(0x0000, 0xA405010C); /* PGCR */
  77. ctrl_outw(0x0000, 0xA405010E); /* PHCR */
  78. ctrl_outw(0x00AA, 0xA4050118); /* PPCR */
  79. ctrl_outw(0x0000, 0xA4050124); /* PSELA */
  80. }
  81. /*
  82. * The Machine Vector
  83. */
  84. struct sh_machine_vector mv_se7721 __initmv = {
  85. .mv_name = "Solution Engine 7721",
  86. .mv_setup = se7721_setup,
  87. .mv_nr_irqs = 109,
  88. .mv_init_irq = init_se7721_IRQ,
  89. };