gpio_gk7101_imx222.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #ifndef _GPIO_RB_IMX222_H_
  2. #define _GPIO_RB_IMX222_H_
  3. #include "adi_types.h"
  4. #include "adi_gpio.h"
  5. #define SYSTEM_USE_EXTERN_I2S 0
  6. #define SYSTEM_USE_SDCARD 1
  7. #define SYSTEM_USE_EXTERN_ETHPHY 0
  8. #define SYSTEM_INIT_GD_GPIO 0
  9. #define CONFIG_MACH_GK7101_RB_IMX222_V1_00
  10. #define CONFIG_PHY_USE_AO_MCLK
  11. #ifdef CONFIG_PHY_USE_AO_MCLK
  12. #define SYSTEM_GPIO_PHY_CLK GADI_GPIO_TYPE_OUTPUT_AOMCLK
  13. #endif
  14. #ifdef CONFIG_PHY_USE_SD_CLK
  15. #define SYSTEM_GPIO_PHY_CLK GADI_GPIO_TYPE_OUTPUT_SDIO_CLK
  16. #endif
  17. #ifdef CONFIG_PHY_USE_EXTERN_CLK
  18. #define SYSTEM_GPIO_PHY_CLK GADI_GPIO_TYPE_INPUT_0
  19. #endif
  20. #if defined(CONFIG_MACH_GK7101_RB_IMX222_V1_00)
  21. #define SYSTEM_GPIO_EXTPHY_TABLE \
  22. { GADI_GPIO_2 , GADI_GPIO_TYPE_INPUT_ENET_PHY_RXER }, \
  23. { GADI_GPIO_3 , GADI_GPIO_TYPE_OUTPUT_ENET_GMII_MDC_O }, \
  24. { GADI_GPIO_32, GADI_GPIO_TYPE_INPUT_ENET_PHY_RXD_1 }, \
  25. { GADI_GPIO_33, GADI_GPIO_TYPE_INOUT_ETH_MDIO }, \
  26. { GADI_GPIO_41, GADI_GPIO_TYPE_OUTPUT_ENET_PHY_RESET /*ETH reset*/}, \
  27. { GADI_GPIO_43, SYSTEM_GPIO_PHY_CLK }, \
  28. { GADI_GPIO_44, GADI_GPIO_TYPE_OUTPUT_ENET_PHY_TXEN }, \
  29. { GADI_GPIO_46, GADI_GPIO_TYPE_OUTPUT_ENET_PHY_TXD_1 }, \
  30. { GADI_GPIO_47, GADI_GPIO_TYPE_OUTPUT_ENET_PHY_TXD_0 }, \
  31. { GADI_GPIO_48, GADI_GPIO_TYPE_INPUT_0 }, \
  32. { GADI_GPIO_49, GADI_GPIO_TYPE_INPUT_0 }, \
  33. { GADI_GPIO_50, GADI_GPIO_TYPE_INPUT_ENET_PHY_RXD_2 /*CLK*/}, \
  34. { GADI_GPIO_51, GADI_GPIO_TYPE_INPUT_ENET_PHY_RXDV }, \
  35. { GADI_GPIO_52, GADI_GPIO_TYPE_INPUT_ENET_PHY_RXD_0 },
  36. #define SYSTEM_GPIO_INTPHY_TABLE \
  37. { GADI_GPIO_2 , GADI_GPIO_TYPE_INPUT_0 }, \
  38. { GADI_GPIO_3 , GADI_GPIO_TYPE_INPUT_0 }, \
  39. { GADI_GPIO_32, GADI_GPIO_TYPE_INPUT_0 }, \
  40. { GADI_GPIO_33, GADI_GPIO_TYPE_INPUT_0 }, \
  41. { GADI_GPIO_41, GADI_GPIO_TYPE_INPUT_0 }, \
  42. { GADI_GPIO_43, GADI_GPIO_TYPE_INPUT_0 }, \
  43. { GADI_GPIO_44, GADI_GPIO_TYPE_INPUT_0 }, \
  44. { GADI_GPIO_46, GADI_GPIO_TYPE_INPUT_0 }, \
  45. { GADI_GPIO_47, GADI_GPIO_TYPE_INPUT_0 }, \
  46. { GADI_GPIO_48, SYSTEM_GPIO_PHY_CLK }, \
  47. { GADI_GPIO_49, GADI_GPIO_TYPE_OUTPUT_EPHY_LED_3 }, \
  48. { GADI_GPIO_50, GADI_GPIO_TYPE_INPUT_0 }, \
  49. { GADI_GPIO_51, GADI_GPIO_TYPE_INPUT_0 }, \
  50. { GADI_GPIO_52, GADI_GPIO_TYPE_INPUT_0 },
  51. //------------------------system gpio map---------------------------
  52. #define SYSTEM_GPIO_XREF_TABLE \
  53. { GADI_GPIO_0 , GADI_GPIO_TYPE_OUTPUT_SF_CS0 }, \
  54. { GADI_GPIO_1 , GADI_GPIO_TYPE_OUTPUT_SF_CS1 }, \
  55. { GADI_GPIO_4 , GADI_GPIO_TYPE_INPUT_0 }, \
  56. { GADI_GPIO_5 , GADI_GPIO_TYPE_INPUT_0 }, \
  57. { GADI_GPIO_6 , GADI_GPIO_TYPE_INPUT_0 }, \
  58. { GADI_GPIO_7 , GADI_GPIO_TYPE_INPUT_0 }, \
  59. { GADI_GPIO_8 , GADI_GPIO_TYPE_INPUT_0 }, \
  60. { GADI_GPIO_9 , GADI_GPIO_TYPE_INPUT_0 }, \
  61. { GADI_GPIO_10, GADI_GPIO_TYPE_INPUT_0 }, \
  62. { GADI_GPIO_11, GADI_GPIO_TYPE_INPUT_0 }, \
  63. { GADI_GPIO_12, GADI_GPIO_TYPE_OUTPUT_0 /*IR_LED_CTRL*/}, \
  64. { GADI_GPIO_13, GADI_GPIO_TYPE_INPUT_0 }, \
  65. { GADI_GPIO_14, GADI_GPIO_TYPE_INPUT_0 }, \
  66. { GADI_GPIO_15, GADI_GPIO_TYPE_INPUT_0 /*IR_DET_ADC*/}, \
  67. { GADI_GPIO_16, GADI_GPIO_TYPE_INPUT_0 }, \
  68. { GADI_GPIO_17, GADI_GPIO_TYPE_INPUT_0 }, \
  69. { GADI_GPIO_18, GADI_GPIO_TYPE_INPUT_0 }, \
  70. { GADI_GPIO_19, GADI_GPIO_TYPE_INPUT_0 }, \
  71. { GADI_GPIO_20, GADI_GPIO_TYPE_OUTPUT_0 /*IR_CUT+*/}, \
  72. { GADI_GPIO_21, GADI_GPIO_TYPE_INPUT_0 }, \
  73. { GADI_GPIO_22, GADI_GPIO_TYPE_INPUT_0 }, \
  74. { GADI_GPIO_23, GADI_GPIO_TYPE_OUTPUT_0 /*IR_CUT-*/}, \
  75. { GADI_GPIO_24, GADI_GPIO_TYPE_INPUT_0 }, \
  76. { GADI_GPIO_25, GADI_GPIO_TYPE_INPUT_0 }, \
  77. { GADI_GPIO_26, GADI_GPIO_TYPE_INPUT_0 }, \
  78. { GADI_GPIO_27, GADI_GPIO_TYPE_OUTPUT_1 /*Sensor reset*/}, \
  79. { GADI_GPIO_28, GADI_GPIO_TYPE_INOUT_I2C_DATA /*S D*/}, \
  80. { GADI_GPIO_29, GADI_GPIO_TYPE_INOUT_I2C_CLK /*S C*/}, \
  81. { GADI_GPIO_30, GADI_GPIO_TYPE_OUTPUT_UART0_TX }, \
  82. { GADI_GPIO_31, GADI_GPIO_TYPE_INPUT_UART0_RX }, \
  83. { GADI_GPIO_34, GADI_GPIO_TYPE_INPUT_0 }, \
  84. { GADI_GPIO_35, GADI_GPIO_TYPE_INOUT_I2C_DATA2 }, \
  85. { GADI_GPIO_36, GADI_GPIO_TYPE_INOUT_I2C_CLK2 }, \
  86. { GADI_GPIO_37, GADI_GPIO_TYPE_INPUT_0 }, \
  87. { GADI_GPIO_38, GADI_GPIO_TYPE_INPUT_0 }, \
  88. { GADI_GPIO_39, GADI_GPIO_TYPE_INPUT_0 }, \
  89. { GADI_GPIO_40, GADI_GPIO_TYPE_INPUT_0 }, \
  90. { GADI_GPIO_42, GADI_GPIO_TYPE_INPUT_0 }, \
  91. SYSTEM_GPIO_INTPHY_TABLE\
  92. { GADI_GPIO_45, GADI_GPIO_TYPE_INPUT_0 }, \
  93. { GADI_GPIO_53, GADI_GPIO_TYPE_INPUT_0 /* ALARM_OUT */}, \
  94. { GADI_GPIO_54, GADI_GPIO_TYPE_INPUT_0 /* ALARM_IN */}, \
  95. { GADI_GPIO_55, GADI_GPIO_TYPE_INPUT_0 }
  96. #define SYSTEM_GPIO_IR_LED_CTRL GADI_GPIO_12
  97. #define SYSTEM_GPIO_IR_CUT1 GADI_GPIO_20
  98. #define SYSTEM_GPIO_IR_CUT2 GADI_GPIO_23
  99. #define SYSTEM_GPIO_SENSOR_RESET GADI_GPIO_27
  100. #define SYSTEM_GPIO_PHY_SPEED_LED GADI_GPIO_49
  101. #define SYSTEM_GPIO_SPI0_EN0 GADI_GPIO_37 // not real pin
  102. #define SYSTEM_GPIO_SPI1_EN0 GADI_GPIO_38 // not real pin
  103. #define SYSTEM_GPIO_PWM0 GADI_GPIO_39 // not real pin
  104. #define SYSTEM_GPIO_PWM1 GADI_GPIO_40 // not real pin
  105. #define SYSTEM_GPIO_PWM2 GADI_GPIO_42 // not real pin
  106. #define SYSTEM_GPIO_PWM3 GADI_GPIO_45 // not real pin
  107. #define SYSTEM_GPIO_USB_HOST GADI_GPIO_55 // not real pin
  108. #define SYSTEM_GPIO_SD_DETECT GADI_GPIO_4 // not real pin
  109. #define SYSTEM_GPIO_SD_POWER GADI_GPIO_5 // not real pin
  110. #define SYSTEM_ETH_PHY_RESET_GPIO GADI_GPIO_41
  111. #endif
  112. #endif /* _GPIO_RB_IMX222_H_ */