gpio_gk710x_sanzhong.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #ifndef GK710X_SANZHONG_H
  2. #define GK710X_SANZHONG_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_PHY_USE_AO_MCLK
  10. #define CONFIG_SYSTEM_USE_SDCARD
  11. #ifdef CONFIG_PHY_USE_AO_MCLK
  12. #define SYSTEM_GPIO_PHY_CLK GD_GPIO_TYPE_OUTPUT_AOMCLK
  13. #endif
  14. #ifdef CONFIG_PHY_USE_SD_CLK
  15. #define SYSTEM_GPIO_PHY_CLK GD_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. #ifdef CONFIG_SYSTEM_USE_SDCARD
  21. #define SYSTEM_GADI_GPIO_SD_TABLE \
  22. { GADI_GPIO_2, GADI_GPIO_TYPE_INOUT_SD_DATA_3 }, \
  23. { GADI_GPIO_3, GADI_GPIO_TYPE_INOUT_SD_CMD }, \
  24. { GADI_GPIO_33, GADI_GPIO_TYPE_OUTPUT_SDIO_CLK }, \
  25. { GADI_GPIO_34, GADI_GPIO_TYPE_INOUT_SD_DATA_0 }, \
  26. { GADI_GPIO_35, GADI_GPIO_TYPE_INPUT_SD_CD_N }, \
  27. { GADI_GPIO_36, GADI_GPIO_TYPE_INOUT_SD_DATA_1 }, \
  28. { GADI_GPIO_40, GADI_GPIO_TYPE_OUTPUT_1 /*power enable */ }, \
  29. { GADI_GPIO_54, GADI_GPIO_TYPE_INOUT_SD_DATA_2 },
  30. #else
  31. #define SYSTEM_GADI_GPIO_SD_TABLE \
  32. { GADI_GPIO_2, GADI_GPIO_TYPE_INPUT_0 }, \
  33. { GADI_GPIO_3, GADI_GPIO_TYPE_INPUT_0 }, \
  34. { GADI_GPIO_33, GADI_GPIO_TYPE_INPUT_0 }, \
  35. { GADI_GPIO_34, GADI_GPIO_TYPE_INPUT_0 }, \
  36. { GADI_GPIO_35, GADI_GPIO_TYPE_INPUT_0 }, \
  37. { GADI_GPIO_36, GADI_GPIO_TYPE_INPUT_0 }, \
  38. { GADI_GPIO_40, GADI_GPIO_TYPE_INPUT_0 }, \
  39. { GADI_GPIO_54, GADI_GPIO_TYPE_INPUT_0 },
  40. #endif
  41. #define SYSTEM_GPIO_EXTPHY_TABLE \
  42. { GADI_GPIO_19, GADI_GPIO_TYPE_INPUT_0 }, \
  43. { GADI_GPIO_47, GADI_GPIO_TYPE_INPUT_0 },
  44. #define SYSTEM_GPIO_INTPHY_TABLE \
  45. { GADI_GPIO_19, GADI_GPIO_TYPE_OUTPUT_EPHY_LED_3 }, \
  46. { GADI_GPIO_47, GADI_GPIO_TYPE_OUTPUT_AOMCLK },
  47. //------------------------system gpio map---------------------------
  48. #define SYSTEM_GPIO_XREF_TABLE \
  49. { GADI_GPIO_0 , GADI_GPIO_TYPE_OUTPUT_SF_CS0 }, \
  50. { GADI_GPIO_1 , GADI_GPIO_TYPE_OUTPUT_SF_CS1 }, \
  51. { GADI_GPIO_2 , GADI_GPIO_TYPE_INPUT_0 }, \
  52. { GADI_GPIO_3 , GADI_GPIO_TYPE_INPUT_0 }, \
  53. { GADI_GPIO_4 , GADI_GPIO_TYPE_INOUT_I2C_DATA2 }, \
  54. { GADI_GPIO_5 , GADI_GPIO_TYPE_INOUT_I2C_CLK2 }, \
  55. { GADI_GPIO_7 , GADI_GPIO_TYPE_OUTPUT_0 /* wifi enable */}, \
  56. { GADI_GPIO_8 , GADI_GPIO_TYPE_OUTPUT_0 /* sensor enable */}, \
  57. { GADI_GPIO_9 , GADI_GPIO_TYPE_INPUT_0 }, \
  58. { GADI_GPIO_10, GADI_GPIO_TYPE_OUTPUT_0 /* led ctrl*/}, \
  59. { GADI_GPIO_11, GADI_GPIO_TYPE_INPUT_0 /* set default*/}, \
  60. { GADI_GPIO_12, GADI_GPIO_TYPE_INPUT_0 }, \
  61. { GADI_GPIO_13, GADI_GPIO_TYPE_INPUT_0 /* sensor PWDNF*/}, \
  62. { GADI_GPIO_14, GADI_GPIO_TYPE_INPUT_0 }, \
  63. { GADI_GPIO_15, GADI_GPIO_TYPE_INPUT_0 }, \
  64. { GADI_GPIO_17, GADI_GPIO_TYPE_OUTPUT_0 /* SPK Enable*/}, \
  65. { GADI_GPIO_18, GADI_GPIO_TYPE_INPUT_0 }, \
  66. { GADI_GPIO_21, GADI_GPIO_TYPE_INPUT_0 }, \
  67. { GADI_GPIO_22, GADI_GPIO_TYPE_INPUT_0 }, \
  68. { GADI_GPIO_25, GADI_GPIO_TYPE_INPUT_UART0_RX }, \
  69. { GADI_GPIO_26, GADI_GPIO_TYPE_OUTPUT_UART0_TX }, \
  70. { GADI_GPIO_28, GADI_GPIO_TYPE_INOUT_I2C_DATA }, \
  71. { GADI_GPIO_29, GADI_GPIO_TYPE_INOUT_I2C_CLK }, \
  72. { GADI_GPIO_37, GADI_GPIO_TYPE_INPUT_UART1_RX }, \
  73. { GADI_GPIO_38, GADI_GPIO_TYPE_OUTPUT_UART1_TX }, \
  74. { GADI_GPIO_41, GADI_GPIO_TYPE_OUTPUT_0 /* PTZ */}, \
  75. { GADI_GPIO_42, GADI_GPIO_TYPE_OUTPUT_0 /* PTZ */}, \
  76. { GADI_GPIO_43, GADI_GPIO_TYPE_OUTPUT_0 /* PTZ */}, \
  77. { GADI_GPIO_44, GADI_GPIO_TYPE_OUTPUT_0 /* PTZ */}, \
  78. { GADI_GPIO_45, GADI_GPIO_TYPE_OUTPUT_0 /* PTZ */}, \
  79. { GADI_GPIO_46, GADI_GPIO_TYPE_OUTPUT_0 /* PTZ */}, \
  80. SYSTEM_GPIO_INTPHY_TABLE \
  81. { GADI_GPIO_48, GADI_GPIO_TYPE_OUTPUT_0 /* PTZ */}, \
  82. { GADI_GPIO_49, GADI_GPIO_TYPE_OUTPUT_0 /* PTZ */}, \
  83. SYSTEM_GADI_GPIO_SD_TABLE
  84. #define SYSTEM_GPIO_IR_CUT1 GADI_GPIO_20
  85. #define SYSTEM_GPIO_IR_CUT2 0xFF
  86. #define SYSTEM_ETH_PHY_RESET_GPIO 0xFF
  87. #define SYSTEM_GPIO_SENSOR_RESET GADI_GPIO_27
  88. #define SYSTEM_GPIO_SENSOR_ENABLE GADI_GPIO_8
  89. #define SYSTEM_GPIO_SENSOR_PWDNF GADI_GPIO_13
  90. #define SYSTEM_GPIO_WIFI_ENABLE GADI_GPIO_7
  91. #define SYSTEM_GPIO_LED_CTRL GADI_GPIO_10
  92. #define SYSTEM_GPIO_SPI_SETDEFAULT GADI_GPIO_11
  93. #define SYSTEM_GPIO_SPK_ENABLE GADI_GPIO_17
  94. #define SYSTEM_GPIO_SD_POWER GADI_GPIO_40
  95. #endif