flint.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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 <mach/irqs.h>
  25. #include "common.h"
  26. #define FLINT_NR_IRQS (MMP_NR_IRQS + 48)
  27. static unsigned long flint_pin_config[] __initdata = {
  28. /* UART1 */
  29. GPIO45_UART1_RXD,
  30. GPIO46_UART1_TXD,
  31. /* UART2 */
  32. GPIO47_UART2_RXD,
  33. GPIO48_UART2_TXD,
  34. /* SMC */
  35. GPIO151_SMC_SCLK,
  36. GPIO145_SMC_nCS0,
  37. GPIO146_SMC_nCS1,
  38. GPIO152_SMC_BE0,
  39. GPIO153_SMC_BE1,
  40. GPIO154_SMC_IRQ,
  41. GPIO113_SMC_RDY,
  42. /*Ethernet*/
  43. GPIO155_GPIO,
  44. /* DFI */
  45. GPIO168_DFI_D0,
  46. GPIO167_DFI_D1,
  47. GPIO166_DFI_D2,
  48. GPIO165_DFI_D3,
  49. GPIO107_DFI_D4,
  50. GPIO106_DFI_D5,
  51. GPIO105_DFI_D6,
  52. GPIO104_DFI_D7,
  53. GPIO111_DFI_D8,
  54. GPIO164_DFI_D9,
  55. GPIO163_DFI_D10,
  56. GPIO162_DFI_D11,
  57. GPIO161_DFI_D12,
  58. GPIO110_DFI_D13,
  59. GPIO109_DFI_D14,
  60. GPIO108_DFI_D15,
  61. GPIO143_ND_nCS0,
  62. GPIO144_ND_nCS1,
  63. GPIO147_ND_nWE,
  64. GPIO148_ND_nRE,
  65. GPIO150_ND_ALE,
  66. GPIO149_ND_CLE,
  67. GPIO112_ND_RDY0,
  68. GPIO160_ND_RDY1,
  69. };
  70. static struct smc91x_platdata flint_smc91x_info = {
  71. .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
  72. };
  73. static struct resource smc91x_resources[] = {
  74. [0] = {
  75. .start = SMC_CS1_PHYS_BASE + 0x300,
  76. .end = SMC_CS1_PHYS_BASE + 0xfffff,
  77. .flags = IORESOURCE_MEM,
  78. },
  79. [1] = {
  80. .start = MMP_GPIO_TO_IRQ(155),
  81. .end = MMP_GPIO_TO_IRQ(155),
  82. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
  83. }
  84. };
  85. static struct platform_device smc91x_device = {
  86. .name = "smc91x",
  87. .id = 0,
  88. .dev = {
  89. .platform_data = &flint_smc91x_info,
  90. },
  91. .num_resources = ARRAY_SIZE(smc91x_resources),
  92. .resource = smc91x_resources,
  93. };
  94. static void __init flint_init(void)
  95. {
  96. mfp_config(ARRAY_AND_SIZE(flint_pin_config));
  97. /* on-chip devices */
  98. mmp2_add_uart(1);
  99. mmp2_add_uart(2);
  100. platform_device_register(&mmp2_device_gpio);
  101. /* off-chip devices */
  102. platform_device_register(&smc91x_device);
  103. }
  104. MACHINE_START(FLINT, "Flint Development Platform")
  105. .map_io = mmp_map_io,
  106. .nr_irqs = FLINT_NR_IRQS,
  107. .init_irq = mmp2_init_irq,
  108. .timer = &mmp2_timer,
  109. .init_machine = flint_init,
  110. .restart = mmp_restart,
  111. MACHINE_END