flint.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * linux/arch/arm/mach-mmp/flint.c
  3. *
  4. * Support for the Marvell Flint Development Platform.
  5. *
  6. * Copyright (C) 2009 Marvell International Ltd.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * publishhed by the Free Software Foundation.
  11. */
  12. #include <linux/init.h>
  13. #include <linux/kernel.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/smc91x.h>
  16. #include <linux/io.h>
  17. #include <linux/gpio.h>
  18. #include <linux/interrupt.h>
  19. #include <asm/mach-types.h>
  20. #include <asm/mach/arch.h>
  21. #include <mach/addr-map.h>
  22. #include <mach/mfp-mmp2.h>
  23. #include <mach/mmp2.h>
  24. #include "common.h"
  25. #define FLINT_NR_IRQS (IRQ_BOARD_START + 48)
  26. static unsigned long flint_pin_config[] __initdata = {
  27. /* UART1 */
  28. GPIO45_UART1_RXD,
  29. GPIO46_UART1_TXD,
  30. /* UART2 */
  31. GPIO47_UART2_RXD,
  32. GPIO48_UART2_TXD,
  33. /* SMC */
  34. GPIO151_SMC_SCLK,
  35. GPIO145_SMC_nCS0,
  36. GPIO146_SMC_nCS1,
  37. GPIO152_SMC_BE0,
  38. GPIO153_SMC_BE1,
  39. GPIO154_SMC_IRQ,
  40. GPIO113_SMC_RDY,
  41. /*Ethernet*/
  42. GPIO155_GPIO,
  43. /* DFI */
  44. GPIO168_DFI_D0,
  45. GPIO167_DFI_D1,
  46. GPIO166_DFI_D2,
  47. GPIO165_DFI_D3,
  48. GPIO107_DFI_D4,
  49. GPIO106_DFI_D5,
  50. GPIO105_DFI_D6,
  51. GPIO104_DFI_D7,
  52. GPIO111_DFI_D8,
  53. GPIO164_DFI_D9,
  54. GPIO163_DFI_D10,
  55. GPIO162_DFI_D11,
  56. GPIO161_DFI_D12,
  57. GPIO110_DFI_D13,
  58. GPIO109_DFI_D14,
  59. GPIO108_DFI_D15,
  60. GPIO143_ND_nCS0,
  61. GPIO144_ND_nCS1,
  62. GPIO147_ND_nWE,
  63. GPIO148_ND_nRE,
  64. GPIO150_ND_ALE,
  65. GPIO149_ND_CLE,
  66. GPIO112_ND_RDY0,
  67. GPIO160_ND_RDY1,
  68. };
  69. static struct smc91x_platdata flint_smc91x_info = {
  70. .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
  71. };
  72. static struct resource smc91x_resources[] = {
  73. [0] = {
  74. .start = SMC_CS1_PHYS_BASE + 0x300,
  75. .end = SMC_CS1_PHYS_BASE + 0xfffff,
  76. .flags = IORESOURCE_MEM,
  77. },
  78. [1] = {
  79. .start = gpio_to_irq(155),
  80. .end = gpio_to_irq(155),
  81. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
  82. }
  83. };
  84. static struct platform_device smc91x_device = {
  85. .name = "smc91x",
  86. .id = 0,
  87. .dev = {
  88. .platform_data = &flint_smc91x_info,
  89. },
  90. .num_resources = ARRAY_SIZE(smc91x_resources),
  91. .resource = smc91x_resources,
  92. };
  93. static void __init flint_init(void)
  94. {
  95. mfp_config(ARRAY_AND_SIZE(flint_pin_config));
  96. /* on-chip devices */
  97. mmp2_add_uart(1);
  98. mmp2_add_uart(2);
  99. /* off-chip devices */
  100. platform_device_register(&smc91x_device);
  101. }
  102. MACHINE_START(FLINT, "Flint Development Platform")
  103. .map_io = mmp_map_io,
  104. .nr_irqs = FLINT_NR_IRQS,
  105. .init_irq = mmp2_init_irq,
  106. .timer = &mmp2_timer,
  107. .init_machine = flint_init,
  108. MACHINE_END