setup.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. *
  4. * linux/arch/sh/boards/se/7206/setup.c
  5. *
  6. * Copyright (C) 2006 Yoshinori Sato
  7. * Copyright (C) 2007 - 2008 Paul Mundt
  8. *
  9. * Hitachi 7206 SolutionEngine Support.
  10. */
  11. #include <linux/init.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/smc91x.h>
  14. #include <mach-se/mach/se7206.h>
  15. #include <asm/io.h>
  16. #include <asm/machvec.h>
  17. #include <asm/heartbeat.h>
  18. static struct resource smc91x_resources[] = {
  19. [0] = {
  20. .name = "smc91x-regs",
  21. .start = PA_SMSC + 0x300,
  22. .end = PA_SMSC + 0x300 + 0x020 - 1,
  23. .flags = IORESOURCE_MEM,
  24. },
  25. [1] = {
  26. .start = 64,
  27. .end = 64,
  28. .flags = IORESOURCE_IRQ,
  29. },
  30. };
  31. static struct smc91x_platdata smc91x_info = {
  32. .flags = SMC91X_USE_16BIT,
  33. };
  34. static struct platform_device smc91x_device = {
  35. .name = "smc91x",
  36. .id = -1,
  37. .dev = {
  38. .dma_mask = NULL,
  39. .coherent_dma_mask = 0xffffffff,
  40. .platform_data = &smc91x_info,
  41. },
  42. .num_resources = ARRAY_SIZE(smc91x_resources),
  43. .resource = smc91x_resources,
  44. };
  45. static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
  46. static struct heartbeat_data heartbeat_data = {
  47. .bit_pos = heartbeat_bit_pos,
  48. .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
  49. };
  50. static struct resource heartbeat_resource = {
  51. .start = PA_LED,
  52. .end = PA_LED,
  53. .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
  54. };
  55. static struct platform_device heartbeat_device = {
  56. .name = "heartbeat",
  57. .id = -1,
  58. .dev = {
  59. .platform_data = &heartbeat_data,
  60. },
  61. .num_resources = 1,
  62. .resource = &heartbeat_resource,
  63. };
  64. static struct platform_device *se7206_devices[] __initdata = {
  65. &smc91x_device,
  66. &heartbeat_device,
  67. };
  68. static int __init se7206_devices_setup(void)
  69. {
  70. return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices));
  71. }
  72. device_initcall(se7206_devices_setup);
  73. static int se7206_mode_pins(void)
  74. {
  75. return MODE_PIN1 | MODE_PIN2;
  76. }
  77. /*
  78. * The Machine Vector
  79. */
  80. static struct sh_machine_vector mv_se __initmv = {
  81. .mv_name = "SolutionEngine",
  82. .mv_init_irq = init_se7206_IRQ,
  83. .mv_mode_pins = se7206_mode_pins,
  84. };