board-kzm9d.c 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * kzm9d board support
  3. *
  4. * Copyright (C) 2012 Renesas Solutions Corp.
  5. * Copyright (C) 2012 Magnus Damm
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; version 2 of the License.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #include <linux/kernel.h>
  21. #include <linux/interrupt.h>
  22. #include <linux/platform_device.h>
  23. #include <linux/smsc911x.h>
  24. #include <mach/common.h>
  25. #include <mach/emev2.h>
  26. #include <asm/mach-types.h>
  27. #include <asm/mach/arch.h>
  28. #include <asm/hardware/gic.h>
  29. /* Ether */
  30. static struct resource smsc911x_resources[] = {
  31. [0] = {
  32. .start = 0x20000000,
  33. .end = 0x2000ffff,
  34. .flags = IORESOURCE_MEM,
  35. },
  36. [1] = {
  37. .start = EMEV2_GPIO_IRQ(1),
  38. .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
  39. },
  40. };
  41. static struct smsc911x_platform_config smsc911x_platdata = {
  42. .flags = SMSC911X_USE_32BIT,
  43. .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
  44. .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
  45. };
  46. static struct platform_device smsc91x_device = {
  47. .name = "smsc911x",
  48. .id = 0,
  49. .dev = {
  50. .platform_data = &smsc911x_platdata,
  51. },
  52. .num_resources = ARRAY_SIZE(smsc911x_resources),
  53. .resource = smsc911x_resources,
  54. };
  55. static struct platform_device *kzm9d_devices[] __initdata = {
  56. &smsc91x_device,
  57. };
  58. void __init kzm9d_add_standard_devices(void)
  59. {
  60. emev2_add_standard_devices();
  61. platform_add_devices(kzm9d_devices, ARRAY_SIZE(kzm9d_devices));
  62. }
  63. static const char *kzm9d_boards_compat_dt[] __initdata = {
  64. "renesas,kzm9d",
  65. NULL,
  66. };
  67. DT_MACHINE_START(KZM9D_DT, "kzm9d")
  68. .map_io = emev2_map_io,
  69. .init_early = emev2_add_early_devices,
  70. .nr_irqs = NR_IRQS_LEGACY,
  71. .init_irq = emev2_init_irq,
  72. .handle_irq = gic_handle_irq,
  73. .init_machine = kzm9d_add_standard_devices,
  74. .timer = &shmobile_timer,
  75. .dt_compat = kzm9d_boards_compat_dt,
  76. MACHINE_END