setup.c 2.2 KB

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