capc7117.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*
  2. * linux/arch/arm/mach-pxa/capc7117.c
  3. *
  4. * Support for the Embedian CAPC-7117 Evaluation Kit
  5. * based on the Embedian MXM-8x10 Computer on Module
  6. *
  7. * Copyright (C) 2009 Embedian Inc.
  8. * Copyright (C) 2009 TMT Services & Supplies (Pty) Ltd.
  9. *
  10. * 2007-09-04: eric miao <eric.y.miao@gmail.com>
  11. * rewrite to align with latest kernel
  12. *
  13. * 2010-01-09: Edwin Peer <epeer@tmtservices.co.za>
  14. * Hennie van der Merwe <hvdmerwe@tmtservices.co.za>
  15. * rework for upstream merge
  16. *
  17. * This program is free software; you can redistribute it and/or modify
  18. * it under the terms of the GNU General Public License version 2 as
  19. * published by the Free Software Foundation.
  20. */
  21. #include <linux/irq.h>
  22. #include <linux/platform_device.h>
  23. #include <linux/ata_platform.h>
  24. #include <linux/serial_8250.h>
  25. #include <linux/gpio.h>
  26. #include <linux/regulator/machine.h>
  27. #include <asm/mach-types.h>
  28. #include <asm/mach/arch.h>
  29. #include "pxa320.h"
  30. #include "mxm8x10.h"
  31. #include "generic.h"
  32. /* IDE (PATA) Support */
  33. static struct pata_platform_info pata_platform_data = {
  34. .ioport_shift = 1
  35. };
  36. static struct resource capc7117_ide_resources[] = {
  37. [0] = {
  38. .start = 0x11000020,
  39. .end = 0x1100003f,
  40. .flags = IORESOURCE_MEM
  41. },
  42. [1] = {
  43. .start = 0x1100001c,
  44. .end = 0x1100001c,
  45. .flags = IORESOURCE_MEM
  46. },
  47. [2] = {
  48. .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO76)),
  49. .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO76)),
  50. .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING
  51. }
  52. };
  53. static struct platform_device capc7117_ide_device = {
  54. .name = "pata_platform",
  55. .num_resources = ARRAY_SIZE(capc7117_ide_resources),
  56. .resource = capc7117_ide_resources,
  57. .dev = {
  58. .platform_data = &pata_platform_data,
  59. .coherent_dma_mask = ~0 /* grumble */
  60. }
  61. };
  62. static void __init capc7117_ide_init(void)
  63. {
  64. platform_device_register(&capc7117_ide_device);
  65. }
  66. /* TI16C752 UART support */
  67. #define TI16C752_FLAGS (UPF_BOOT_AUTOCONF | \
  68. UPF_IOREMAP | \
  69. UPF_BUGGY_UART | \
  70. UPF_SKIP_TEST)
  71. #define TI16C752_UARTCLK (22118400)
  72. static struct plat_serial8250_port ti16c752_platform_data[] = {
  73. [0] = {
  74. .mapbase = 0x14000000,
  75. .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO78)),
  76. .irqflags = IRQF_TRIGGER_RISING,
  77. .flags = TI16C752_FLAGS,
  78. .iotype = UPIO_MEM,
  79. .regshift = 1,
  80. .uartclk = TI16C752_UARTCLK
  81. },
  82. [1] = {
  83. .mapbase = 0x14000040,
  84. .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO79)),
  85. .irqflags = IRQF_TRIGGER_RISING,
  86. .flags = TI16C752_FLAGS,
  87. .iotype = UPIO_MEM,
  88. .regshift = 1,
  89. .uartclk = TI16C752_UARTCLK
  90. },
  91. [2] = {
  92. .mapbase = 0x14000080,
  93. .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO80)),
  94. .irqflags = IRQF_TRIGGER_RISING,
  95. .flags = TI16C752_FLAGS,
  96. .iotype = UPIO_MEM,
  97. .regshift = 1,
  98. .uartclk = TI16C752_UARTCLK
  99. },
  100. [3] = {
  101. .mapbase = 0x140000c0,
  102. .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO81)),
  103. .irqflags = IRQF_TRIGGER_RISING,
  104. .flags = TI16C752_FLAGS,
  105. .iotype = UPIO_MEM,
  106. .regshift = 1,
  107. .uartclk = TI16C752_UARTCLK
  108. },
  109. [4] = {
  110. /* end of array */
  111. }
  112. };
  113. static struct platform_device ti16c752_device = {
  114. .name = "serial8250",
  115. .id = PLAT8250_DEV_PLATFORM,
  116. .dev = {
  117. .platform_data = ti16c752_platform_data
  118. }
  119. };
  120. static void __init capc7117_uarts_init(void)
  121. {
  122. platform_device_register(&ti16c752_device);
  123. }
  124. static void __init capc7117_init(void)
  125. {
  126. /* Init CoM */
  127. mxm_8x10_barebones_init();
  128. /* Init evaluation board peripherals */
  129. mxm_8x10_ac97_init();
  130. mxm_8x10_usb_host_init();
  131. mxm_8x10_mmc_init();
  132. capc7117_uarts_init();
  133. capc7117_ide_init();
  134. regulator_has_full_constraints();
  135. }
  136. MACHINE_START(CAPC7117,
  137. "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM")
  138. .atag_offset = 0x100,
  139. .map_io = pxa3xx_map_io,
  140. .nr_irqs = PXA_NR_IRQS,
  141. .init_irq = pxa3xx_init_irq,
  142. .handle_irq = pxa3xx_handle_irq,
  143. .init_time = pxa_timer_init,
  144. .init_machine = capc7117_init,
  145. .restart = pxa_restart,
  146. MACHINE_END