flint.c 2.8 KB

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