setup.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. *
  3. * linux/arch/sh/boards/se/7206/setup.c
  4. *
  5. * Copyright (C) 2006 Yoshinori Sato
  6. * Copyright (C) 2007 Paul Mundt
  7. *
  8. * Hitachi 7206 SolutionEngine Support.
  9. */
  10. #include <linux/init.h>
  11. #include <linux/platform_device.h>
  12. #include <asm/se7206.h>
  13. #include <asm/io.h>
  14. #include <asm/machvec.h>
  15. #include <asm/heartbeat.h>
  16. static struct resource smc91x_resources[] = {
  17. [0] = {
  18. .start = 0x300,
  19. .end = 0x300 + 0x020 - 1,
  20. .flags = IORESOURCE_MEM,
  21. },
  22. [1] = {
  23. .start = 64,
  24. .end = 64,
  25. .flags = IORESOURCE_IRQ,
  26. },
  27. };
  28. static struct platform_device smc91x_device = {
  29. .name = "smc91x",
  30. .id = -1,
  31. .num_resources = ARRAY_SIZE(smc91x_resources),
  32. .resource = smc91x_resources,
  33. };
  34. static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
  35. static struct heartbeat_data heartbeat_data = {
  36. .bit_pos = heartbeat_bit_pos,
  37. .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
  38. .regsize = 32,
  39. };
  40. static struct resource heartbeat_resources[] = {
  41. [0] = {
  42. .start = PA_LED,
  43. .end = PA_LED,
  44. .flags = IORESOURCE_MEM,
  45. },
  46. };
  47. static struct platform_device heartbeat_device = {
  48. .name = "heartbeat",
  49. .id = -1,
  50. .dev = {
  51. .platform_data = &heartbeat_data,
  52. },
  53. .num_resources = ARRAY_SIZE(heartbeat_resources),
  54. .resource = heartbeat_resources,
  55. };
  56. static struct platform_device *se7206_devices[] __initdata = {
  57. &smc91x_device,
  58. &heartbeat_device,
  59. };
  60. static int __init se7206_devices_setup(void)
  61. {
  62. return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices));
  63. }
  64. __initcall(se7206_devices_setup);
  65. /*
  66. * The Machine Vector
  67. */
  68. static struct sh_machine_vector mv_se __initmv = {
  69. .mv_name = "SolutionEngine",
  70. .mv_nr_irqs = 256,
  71. .mv_inb = se7206_inb,
  72. .mv_inw = se7206_inw,
  73. .mv_outb = se7206_outb,
  74. .mv_outw = se7206_outw,
  75. .mv_inb_p = se7206_inb_p,
  76. .mv_inw_p = se7206_inw,
  77. .mv_outb_p = se7206_outb_p,
  78. .mv_outw_p = se7206_outw,
  79. .mv_insb = se7206_insb,
  80. .mv_insw = se7206_insw,
  81. .mv_outsb = se7206_outsb,
  82. .mv_outsw = se7206_outsw,
  83. .mv_init_irq = init_se7206_IRQ,
  84. };