setup.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. 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 resource heartbeat_resources[] = {
  36. [0] = {
  37. .start = PA_LED,
  38. .end = PA_LED + ARRAY_SIZE(heartbeat_bit_pos) - 1,
  39. .flags = IORESOURCE_MEM,
  40. },
  41. };
  42. static struct platform_device heartbeat_device = {
  43. .name = "heartbeat",
  44. .id = -1,
  45. .dev = {
  46. .platform_data = heartbeat_bit_pos,
  47. },
  48. .num_resources = ARRAY_SIZE(heartbeat_resources),
  49. .resource = heartbeat_resources,
  50. };
  51. static struct platform_device *se7206_devices[] __initdata = {
  52. &smc91x_device,
  53. &heartbeat_device,
  54. };
  55. static int __init se7206_devices_setup(void)
  56. {
  57. return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices));
  58. }
  59. __initcall(se7206_devices_setup);
  60. /*
  61. * The Machine Vector
  62. */
  63. struct sh_machine_vector mv_se __initmv = {
  64. .mv_name = "SolutionEngine",
  65. .mv_nr_irqs = 256,
  66. .mv_inb = se7206_inb,
  67. .mv_inw = se7206_inw,
  68. .mv_inl = se7206_inl,
  69. .mv_outb = se7206_outb,
  70. .mv_outw = se7206_outw,
  71. .mv_outl = se7206_outl,
  72. .mv_inb_p = se7206_inb_p,
  73. .mv_inw_p = se7206_inw,
  74. .mv_inl_p = se7206_inl,
  75. .mv_outb_p = se7206_outb_p,
  76. .mv_outw_p = se7206_outw,
  77. .mv_outl_p = se7206_outl,
  78. .mv_insb = se7206_insb,
  79. .mv_insw = se7206_insw,
  80. .mv_insl = se7206_insl,
  81. .mv_outsb = se7206_outsb,
  82. .mv_outsw = se7206_outsw,
  83. .mv_outsl = se7206_outsl,
  84. .mv_init_irq = init_se7206_IRQ,
  85. };
  86. ALIAS_MV(se)