mach-mx1ads.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /*
  2. * arch/arm/mach-imx/mach-mx1ads.c
  3. *
  4. * Initially based on:
  5. * linux-2.6.7-imx/arch/arm/mach-imx/scb9328.c
  6. * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
  7. *
  8. * 2004 (c) MontaVista Software, Inc.
  9. *
  10. * This file is licensed under the terms of the GNU General Public
  11. * License version 2. This program is licensed "as is" without any
  12. * warranty of any kind, whether express or implied.
  13. */
  14. #include <linux/i2c.h>
  15. #include <linux/i2c/pcf857x.h>
  16. #include <linux/init.h>
  17. #include <linux/kernel.h>
  18. #include <linux/platform_device.h>
  19. #include <linux/mtd/physmap.h>
  20. #include <asm/mach-types.h>
  21. #include <asm/mach/arch.h>
  22. #include <asm/mach/time.h>
  23. #include <mach/common.h>
  24. #include <mach/hardware.h>
  25. #include <mach/i2c.h>
  26. #include <mach/iomux-mx1.h>
  27. #include <mach/irqs.h>
  28. #include "devices-imx1.h"
  29. static const int mx1ads_pins[] __initconst = {
  30. /* UART1 */
  31. PC9_PF_UART1_CTS,
  32. PC10_PF_UART1_RTS,
  33. PC11_PF_UART1_TXD,
  34. PC12_PF_UART1_RXD,
  35. /* UART2 */
  36. PB28_PF_UART2_CTS,
  37. PB29_PF_UART2_RTS,
  38. PB30_PF_UART2_TXD,
  39. PB31_PF_UART2_RXD,
  40. /* I2C */
  41. PA15_PF_I2C_SDA,
  42. PA16_PF_I2C_SCL,
  43. /* SPI */
  44. PC13_PF_SPI1_SPI_RDY,
  45. PC14_PF_SPI1_SCLK,
  46. PC15_PF_SPI1_SS,
  47. PC16_PF_SPI1_MISO,
  48. PC17_PF_SPI1_MOSI,
  49. };
  50. /*
  51. * UARTs platform data
  52. */
  53. static const struct imxuart_platform_data uart0_pdata __initconst = {
  54. .flags = IMXUART_HAVE_RTSCTS,
  55. };
  56. static const struct imxuart_platform_data uart1_pdata __initconst = {
  57. .flags = IMXUART_HAVE_RTSCTS,
  58. };
  59. /*
  60. * Physmap flash
  61. */
  62. static struct physmap_flash_data mx1ads_flash_data = {
  63. .width = 4, /* bankwidth in bytes */
  64. };
  65. static struct resource flash_resource = {
  66. .start = MX1_CS0_PHYS,
  67. .end = MX1_CS0_PHYS + SZ_32M - 1,
  68. .flags = IORESOURCE_MEM,
  69. };
  70. static struct platform_device flash_device = {
  71. .name = "physmap-flash",
  72. .id = 0,
  73. .resource = &flash_resource,
  74. .num_resources = 1,
  75. };
  76. /*
  77. * I2C
  78. */
  79. static struct pcf857x_platform_data pcf857x_data[] = {
  80. {
  81. .gpio_base = 4 * 32,
  82. }, {
  83. .gpio_base = 4 * 32 + 16,
  84. }
  85. };
  86. static const struct imxi2c_platform_data mx1ads_i2c_data __initconst = {
  87. .bitrate = 100000,
  88. };
  89. static struct i2c_board_info mx1ads_i2c_devices[] = {
  90. {
  91. I2C_BOARD_INFO("pcf8575", 0x22),
  92. .platform_data = &pcf857x_data[0],
  93. }, {
  94. I2C_BOARD_INFO("pcf8575", 0x24),
  95. .platform_data = &pcf857x_data[1],
  96. },
  97. };
  98. /*
  99. * Board init
  100. */
  101. static void __init mx1ads_init(void)
  102. {
  103. mxc_gpio_setup_multiple_pins(mx1ads_pins,
  104. ARRAY_SIZE(mx1ads_pins), "mx1ads");
  105. /* UART */
  106. imx1_add_imx_uart0(&uart0_pdata);
  107. imx1_add_imx_uart1(&uart1_pdata);
  108. /* Physmap flash */
  109. mxc_register_device(&flash_device, &mx1ads_flash_data);
  110. /* I2C */
  111. i2c_register_board_info(0, mx1ads_i2c_devices,
  112. ARRAY_SIZE(mx1ads_i2c_devices));
  113. imx1_add_imx_i2c(&mx1ads_i2c_data);
  114. }
  115. static void __init mx1ads_timer_init(void)
  116. {
  117. mx1_clocks_init(32000);
  118. }
  119. struct sys_timer mx1ads_timer = {
  120. .init = mx1ads_timer_init,
  121. };
  122. MACHINE_START(MX1ADS, "Freescale MX1ADS")
  123. /* Maintainer: Sascha Hauer, Pengutronix */
  124. .boot_params = MX1_PHYS_OFFSET + 0x100,
  125. .map_io = mx1_map_io,
  126. .init_early = imx1_init_early,
  127. .init_irq = mx1_init_irq,
  128. .timer = &mx1ads_timer,
  129. .init_machine = mx1ads_init,
  130. MACHINE_END
  131. MACHINE_START(MXLADS, "Freescale MXLADS")
  132. .boot_params = MX1_PHYS_OFFSET + 0x100,
  133. .map_io = mx1_map_io,
  134. .init_early = imx1_init_early,
  135. .init_irq = mx1_init_irq,
  136. .timer = &mx1ads_timer,
  137. .init_machine = mx1ads_init,
  138. MACHINE_END