setup.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. */
  11. #include <linux/init.h>
  12. #include <linux/platform_device.h>
  13. #include <asm/se7206.h>
  14. #include <asm/io.h>
  15. #include <asm/machvec.h>
  16. #include <asm/heartbeat.h>
  17. static struct resource smc91x_resources[] = {
  18. [0] = {
  19. .start = 0x300,
  20. .end = 0x300 + 0x020 - 1,
  21. .flags = IORESOURCE_MEM,
  22. },
  23. [1] = {
  24. .start = 64,
  25. .end = 64,
  26. .flags = IORESOURCE_IRQ,
  27. },
  28. };
  29. static struct platform_device smc91x_device = {
  30. .name = "smc91x",
  31. .id = -1,
  32. .num_resources = ARRAY_SIZE(smc91x_resources),
  33. .resource = smc91x_resources,
  34. };
  35. static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
  36. static struct heartbeat_data heartbeat_data = {
  37. .bit_pos = heartbeat_bit_pos,
  38. .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
  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_inl = se7206_inl,
  74. .mv_outb = se7206_outb,
  75. .mv_outw = se7206_outw,
  76. .mv_outl = se7206_outl,
  77. .mv_inb_p = se7206_inb_p,
  78. .mv_inw_p = se7206_inw,
  79. .mv_inl_p = se7206_inl,
  80. .mv_outb_p = se7206_outb_p,
  81. .mv_outw_p = se7206_outw,
  82. .mv_outl_p = se7206_outl,
  83. .mv_insb = se7206_insb,
  84. .mv_insw = se7206_insw,
  85. .mv_insl = se7206_insl,
  86. .mv_outsb = se7206_outsb,
  87. .mv_outsw = se7206_outsw,
  88. .mv_outsl = se7206_outsl,
  89. .mv_init_irq = init_se7206_IRQ,
  90. };