mach-mx1ads.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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/iomux-mx1.h>
  26. #include "devices-imx1.h"
  27. static const int mx1ads_pins[] __initconst = {
  28. /* UART1 */
  29. PC9_PF_UART1_CTS,
  30. PC10_PF_UART1_RTS,
  31. PC11_PF_UART1_TXD,
  32. PC12_PF_UART1_RXD,
  33. /* UART2 */
  34. PB28_PF_UART2_CTS,
  35. PB29_PF_UART2_RTS,
  36. PB30_PF_UART2_TXD,
  37. PB31_PF_UART2_RXD,
  38. /* I2C */
  39. PA15_PF_I2C_SDA,
  40. PA16_PF_I2C_SCL,
  41. /* SPI */
  42. PC13_PF_SPI1_SPI_RDY,
  43. PC14_PF_SPI1_SCLK,
  44. PC15_PF_SPI1_SS,
  45. PC16_PF_SPI1_MISO,
  46. PC17_PF_SPI1_MOSI,
  47. };
  48. /*
  49. * UARTs platform data
  50. */
  51. static const struct imxuart_platform_data uart0_pdata __initconst = {
  52. .flags = IMXUART_HAVE_RTSCTS,
  53. };
  54. static const struct imxuart_platform_data uart1_pdata __initconst = {
  55. .flags = IMXUART_HAVE_RTSCTS,
  56. };
  57. /*
  58. * Physmap flash
  59. */
  60. static const struct physmap_flash_data mx1ads_flash_data __initconst = {
  61. .width = 4, /* bankwidth in bytes */
  62. };
  63. static const struct resource flash_resource __initconst = {
  64. .start = MX1_CS0_PHYS,
  65. .end = MX1_CS0_PHYS + SZ_32M - 1,
  66. .flags = IORESOURCE_MEM,
  67. };
  68. /*
  69. * I2C
  70. */
  71. static struct pcf857x_platform_data pcf857x_data[] = {
  72. {
  73. .gpio_base = 4 * 32,
  74. }, {
  75. .gpio_base = 4 * 32 + 16,
  76. }
  77. };
  78. static const struct imxi2c_platform_data mx1ads_i2c_data __initconst = {
  79. .bitrate = 100000,
  80. };
  81. static struct i2c_board_info mx1ads_i2c_devices[] = {
  82. {
  83. I2C_BOARD_INFO("pcf8575", 0x22),
  84. .platform_data = &pcf857x_data[0],
  85. }, {
  86. I2C_BOARD_INFO("pcf8575", 0x24),
  87. .platform_data = &pcf857x_data[1],
  88. },
  89. };
  90. /*
  91. * Board init
  92. */
  93. static void __init mx1ads_init(void)
  94. {
  95. imx1_soc_init();
  96. mxc_gpio_setup_multiple_pins(mx1ads_pins,
  97. ARRAY_SIZE(mx1ads_pins), "mx1ads");
  98. /* UART */
  99. imx1_add_imx_uart0(&uart0_pdata);
  100. imx1_add_imx_uart1(&uart1_pdata);
  101. /* Physmap flash */
  102. platform_device_register_resndata(NULL, "physmap-flash", 0,
  103. &flash_resource, 1,
  104. &mx1ads_flash_data, sizeof(mx1ads_flash_data));
  105. /* I2C */
  106. i2c_register_board_info(0, mx1ads_i2c_devices,
  107. ARRAY_SIZE(mx1ads_i2c_devices));
  108. imx1_add_imx_i2c(&mx1ads_i2c_data);
  109. }
  110. static void __init mx1ads_timer_init(void)
  111. {
  112. mx1_clocks_init(32000);
  113. }
  114. static struct sys_timer mx1ads_timer = {
  115. .init = mx1ads_timer_init,
  116. };
  117. MACHINE_START(MX1ADS, "Freescale MX1ADS")
  118. /* Maintainer: Sascha Hauer, Pengutronix */
  119. .atag_offset = 0x100,
  120. .map_io = mx1_map_io,
  121. .init_early = imx1_init_early,
  122. .init_irq = mx1_init_irq,
  123. .handle_irq = imx1_handle_irq,
  124. .timer = &mx1ads_timer,
  125. .init_machine = mx1ads_init,
  126. .restart = mxc_restart,
  127. MACHINE_END
  128. MACHINE_START(MXLADS, "Freescale MXLADS")
  129. .atag_offset = 0x100,
  130. .map_io = mx1_map_io,
  131. .init_early = imx1_init_early,
  132. .init_irq = mx1_init_irq,
  133. .handle_irq = imx1_handle_irq,
  134. .timer = &mx1ads_timer,
  135. .init_machine = mx1ads_init,
  136. .restart = mxc_restart,
  137. MACHINE_END