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 - 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. };
  49. static struct resource heartbeat_resource = {
  50. .start = PA_LED,
  51. .end = PA_LED,
  52. .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
  53. };
  54. static struct platform_device heartbeat_device = {
  55. .name = "heartbeat",
  56. .id = -1,
  57. .dev = {
  58. .platform_data = &heartbeat_data,
  59. },
  60. .num_resources = 1,
  61. .resource = &heartbeat_resource,
  62. };
  63. static struct platform_device *se7206_devices[] __initdata = {
  64. &smc91x_device,
  65. &heartbeat_device,
  66. };
  67. static int __init se7206_devices_setup(void)
  68. {
  69. return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices));
  70. }
  71. device_initcall(se7206_devices_setup);
  72. static int se7206_mode_pins(void)
  73. {
  74. return MODE_PIN1 | MODE_PIN2;
  75. }
  76. /*
  77. * The Machine Vector
  78. */
  79. static struct sh_machine_vector mv_se __initmv = {
  80. .mv_name = "SolutionEngine",
  81. .mv_nr_irqs = 256,
  82. .mv_init_irq = init_se7206_IRQ,
  83. .mv_mode_pins = se7206_mode_pins,
  84. };