mach-mx1ads.c 3.4 KB

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