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/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 struct physmap_flash_data mx1ads_flash_data = {
  62. .width = 4, /* bankwidth in bytes */
  63. };
  64. static struct resource flash_resource = {
  65. .start = MX1_CS0_PHYS,
  66. .end = MX1_CS0_PHYS + SZ_32M - 1,
  67. .flags = IORESOURCE_MEM,
  68. };
  69. static struct platform_device flash_device = {
  70. .name = "physmap-flash",
  71. .id = 0,
  72. .resource = &flash_resource,
  73. .num_resources = 1,
  74. };
  75. /*
  76. * I2C
  77. */
  78. static struct pcf857x_platform_data pcf857x_data[] = {
  79. {
  80. .gpio_base = 4 * 32,
  81. }, {
  82. .gpio_base = 4 * 32 + 16,
  83. }
  84. };
  85. static const struct imxi2c_platform_data mx1ads_i2c_data __initconst = {
  86. .bitrate = 100000,
  87. };
  88. static struct i2c_board_info mx1ads_i2c_devices[] = {
  89. {
  90. I2C_BOARD_INFO("pcf8575", 0x22),
  91. .platform_data = &pcf857x_data[0],
  92. }, {
  93. I2C_BOARD_INFO("pcf8575", 0x24),
  94. .platform_data = &pcf857x_data[1],
  95. },
  96. };
  97. /*
  98. * Board init
  99. */
  100. static void __init mx1ads_init(void)
  101. {
  102. mxc_gpio_setup_multiple_pins(mx1ads_pins,
  103. ARRAY_SIZE(mx1ads_pins), "mx1ads");
  104. /* UART */
  105. imx1_add_imx_uart0(&uart0_pdata);
  106. imx1_add_imx_uart1(&uart1_pdata);
  107. /* Physmap flash */
  108. mxc_register_device(&flash_device, &mx1ads_flash_data);
  109. /* I2C */
  110. i2c_register_board_info(0, mx1ads_i2c_devices,
  111. ARRAY_SIZE(mx1ads_i2c_devices));
  112. imx1_add_imx_i2c(&mx1ads_i2c_data);
  113. }
  114. static void __init mx1ads_timer_init(void)
  115. {
  116. mx1_clocks_init(32000);
  117. }
  118. struct sys_timer mx1ads_timer = {
  119. .init = mx1ads_timer_init,
  120. };
  121. MACHINE_START(MX1ADS, "Freescale MX1ADS")
  122. /* Maintainer: Sascha Hauer, Pengutronix */
  123. .boot_params = MX1_PHYS_OFFSET + 0x100,
  124. .map_io = mx1_map_io,
  125. .init_early = imx1_init_early,
  126. .init_irq = mx1_init_irq,
  127. .timer = &mx1ads_timer,
  128. .init_machine = mx1ads_init,
  129. MACHINE_END
  130. MACHINE_START(MXLADS, "Freescale MXLADS")
  131. .boot_params = MX1_PHYS_OFFSET + 0x100,
  132. .map_io = mx1_map_io,
  133. .init_early = imx1_init_early,
  134. .init_irq = mx1_init_irq,
  135. .timer = &mx1ads_timer,
  136. .init_machine = mx1ads_init,
  137. MACHINE_END