cm-x255.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /*
  2. * linux/arch/arm/mach-pxa/cm-x255.c
  3. *
  4. * Copyright (C) 2007, 2008 CompuLab, Ltd.
  5. * Mike Rapoport <mike@compulab.co.il>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #include <linux/platform_device.h>
  12. #include <linux/irq.h>
  13. #include <linux/gpio.h>
  14. #include <linux/spi/spi.h>
  15. #include <asm/mach/arch.h>
  16. #include <asm/mach-types.h>
  17. #include <asm/mach/map.h>
  18. #include <mach/pxa2xx-regs.h>
  19. #include <mach/mfp-pxa25x.h>
  20. #include <mach/pxa2xx_spi.h>
  21. #include <mach/bitfield.h>
  22. #include "generic.h"
  23. static unsigned long cmx255_pin_config[] = {
  24. /* AC'97 */
  25. GPIO28_AC97_BITCLK,
  26. GPIO29_AC97_SDATA_IN_0,
  27. GPIO30_AC97_SDATA_OUT,
  28. GPIO31_AC97_SYNC,
  29. /* BTUART */
  30. GPIO42_BTUART_RXD,
  31. GPIO43_BTUART_TXD,
  32. GPIO44_BTUART_CTS,
  33. GPIO45_BTUART_RTS,
  34. /* STUART */
  35. GPIO46_STUART_RXD,
  36. GPIO47_STUART_TXD,
  37. /* LCD */
  38. GPIO58_LCD_LDD_0,
  39. GPIO59_LCD_LDD_1,
  40. GPIO60_LCD_LDD_2,
  41. GPIO61_LCD_LDD_3,
  42. GPIO62_LCD_LDD_4,
  43. GPIO63_LCD_LDD_5,
  44. GPIO64_LCD_LDD_6,
  45. GPIO65_LCD_LDD_7,
  46. GPIO66_LCD_LDD_8,
  47. GPIO67_LCD_LDD_9,
  48. GPIO68_LCD_LDD_10,
  49. GPIO69_LCD_LDD_11,
  50. GPIO70_LCD_LDD_12,
  51. GPIO71_LCD_LDD_13,
  52. GPIO72_LCD_LDD_14,
  53. GPIO73_LCD_LDD_15,
  54. GPIO74_LCD_FCLK,
  55. GPIO75_LCD_LCLK,
  56. GPIO76_LCD_PCLK,
  57. GPIO77_LCD_BIAS,
  58. /* SSP1 */
  59. GPIO23_SSP1_SCLK,
  60. GPIO24_SSP1_SFRM,
  61. GPIO25_SSP1_TXD,
  62. GPIO26_SSP1_RXD,
  63. /* SSP2 */
  64. GPIO81_SSP2_CLK_OUT,
  65. GPIO82_SSP2_FRM_OUT,
  66. GPIO83_SSP2_TXD,
  67. GPIO84_SSP2_RXD,
  68. /* PC Card */
  69. GPIO48_nPOE,
  70. GPIO49_nPWE,
  71. GPIO50_nPIOR,
  72. GPIO51_nPIOW,
  73. GPIO52_nPCE_1,
  74. GPIO53_nPCE_2,
  75. GPIO54_nPSKTSEL,
  76. GPIO55_nPREG,
  77. GPIO56_nPWAIT,
  78. GPIO57_nIOIS16,
  79. /* SDRAM and local bus */
  80. GPIO15_nCS_1,
  81. GPIO78_nCS_2,
  82. GPIO79_nCS_3,
  83. GPIO80_nCS_4,
  84. GPIO33_nCS_5,
  85. GPIO18_RDY,
  86. /* GPIO */
  87. GPIO0_GPIO | WAKEUP_ON_EDGE_BOTH,
  88. GPIO9_GPIO, /* PC card reset */
  89. /* NAND controls */
  90. GPIO5_GPIO | MFP_LPM_DRIVE_HIGH, /* NAND CE# */
  91. GPIO4_GPIO | MFP_LPM_DRIVE_LOW, /* NAND ALE */
  92. GPIO3_GPIO | MFP_LPM_DRIVE_LOW, /* NAND CLE */
  93. GPIO10_GPIO, /* NAND Ready/Busy */
  94. /* interrupts */
  95. GPIO22_GPIO, /* DM9000 interrupt */
  96. };
  97. #if defined(CONFIG_SPI_PXA2XX)
  98. static struct pxa2xx_spi_master pxa_ssp_master_info = {
  99. .num_chipselect = 1,
  100. };
  101. static struct spi_board_info spi_board_info[] __initdata = {
  102. [0] = {
  103. .modalias = "rtc-max6902",
  104. .max_speed_hz = 1000000,
  105. .bus_num = 1,
  106. .chip_select = 0,
  107. },
  108. };
  109. static void __init cmx255_init_rtc(void)
  110. {
  111. pxa2xx_set_spi_info(1, &pxa_ssp_master_info);
  112. spi_register_board_info(ARRAY_AND_SIZE(spi_board_info));
  113. }
  114. #else
  115. static inline void cmx255_init_rtc(void) {}
  116. #endif
  117. void __init cmx255_init(void)
  118. {
  119. pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx255_pin_config));
  120. cmx255_init_rtc();
  121. }