setup.c 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. };
  25. static struct resource heartbeat_resource = {
  26. .start = PA_LED,
  27. .end = PA_LED,
  28. .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
  29. };
  30. static struct platform_device heartbeat_device = {
  31. .name = "heartbeat",
  32. .id = -1,
  33. .dev = {
  34. .platform_data = &heartbeat_data,
  35. },
  36. .num_resources = 1,
  37. .resource = &heartbeat_resource,
  38. };
  39. static struct resource cf_ide_resources[] = {
  40. [0] = {
  41. .start = PA_MRSHPC_IO + 0x1f0,
  42. .end = PA_MRSHPC_IO + 0x1f0 + 8 ,
  43. .flags = IORESOURCE_IO,
  44. },
  45. [1] = {
  46. .start = PA_MRSHPC_IO + 0x1f0 + 0x206,
  47. .end = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
  48. .flags = IORESOURCE_IO,
  49. },
  50. [2] = {
  51. .start = MRSHPC_IRQ0,
  52. .flags = IORESOURCE_IRQ,
  53. },
  54. };
  55. static struct platform_device cf_ide_device = {
  56. .name = "pata_platform",
  57. .id = -1,
  58. .num_resources = ARRAY_SIZE(cf_ide_resources),
  59. .resource = cf_ide_resources,
  60. };
  61. static struct platform_device *se7721_devices[] __initdata = {
  62. &cf_ide_device,
  63. &heartbeat_device
  64. };
  65. static int __init se7721_devices_setup(void)
  66. {
  67. mrshpc_setup_windows();
  68. return platform_add_devices(se7721_devices, ARRAY_SIZE(se7721_devices));
  69. }
  70. device_initcall(se7721_devices_setup);
  71. static void __init se7721_setup(char **cmdline_p)
  72. {
  73. /* for USB */
  74. __raw_writew(0x0000, 0xA405010C); /* PGCR */
  75. __raw_writew(0x0000, 0xA405010E); /* PHCR */
  76. __raw_writew(0x00AA, 0xA4050118); /* PPCR */
  77. __raw_writew(0x0000, 0xA4050124); /* PSELA */
  78. }
  79. /*
  80. * The Machine Vector
  81. */
  82. struct sh_machine_vector mv_se7721 __initmv = {
  83. .mv_name = "Solution Engine 7721",
  84. .mv_setup = se7721_setup,
  85. .mv_nr_irqs = 109,
  86. .mv_init_irq = init_se7721_IRQ,
  87. };