st-pincfg.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ST_PINCFG_H_
  3. #define _ST_PINCFG_H_
  4. /* Alternate functions */
  5. #define ALT1 1
  6. #define ALT2 2
  7. #define ALT3 3
  8. #define ALT4 4
  9. #define ALT5 5
  10. #define ALT6 6
  11. #define ALT7 7
  12. /* Output enable */
  13. #define OE (1 << 27)
  14. /* Pull Up */
  15. #define PU (1 << 26)
  16. /* Open Drain */
  17. #define OD (1 << 25)
  18. #define RT (1 << 23)
  19. #define INVERTCLK (1 << 22)
  20. #define CLKNOTDATA (1 << 21)
  21. #define DOUBLE_EDGE (1 << 20)
  22. #define CLK_A (0 << 18)
  23. #define CLK_B (1 << 18)
  24. #define CLK_C (2 << 18)
  25. #define CLK_D (3 << 18)
  26. /* User-frendly defines for Pin Direction */
  27. /* oe = 0, pu = 0, od = 0 */
  28. #define IN (0)
  29. /* oe = 0, pu = 1, od = 0 */
  30. #define IN_PU (PU)
  31. /* oe = 1, pu = 0, od = 0 */
  32. #define OUT (OE)
  33. /* oe = 1, pu = 0, od = 1 */
  34. #define BIDIR (OE | OD)
  35. /* oe = 1, pu = 1, od = 1 */
  36. #define BIDIR_PU (OE | PU | OD)
  37. /* RETIME_TYPE */
  38. /*
  39. * B Mode
  40. * Bypass retime with optional delay parameter
  41. */
  42. #define BYPASS (0)
  43. /*
  44. * R0, R1, R0D, R1D modes
  45. * single-edge data non inverted clock, retime data with clk
  46. */
  47. #define SE_NICLK_IO (RT)
  48. /*
  49. * RIV0, RIV1, RIV0D, RIV1D modes
  50. * single-edge data inverted clock, retime data with clk
  51. */
  52. #define SE_ICLK_IO (RT | INVERTCLK)
  53. /*
  54. * R0E, R1E, R0ED, R1ED modes
  55. * double-edge data, retime data with clk
  56. */
  57. #define DE_IO (RT | DOUBLE_EDGE)
  58. /*
  59. * CIV0, CIV1 modes with inverted clock
  60. * Retiming the clk pins will park clock & reduce the noise within the core.
  61. */
  62. #define ICLK (RT | CLKNOTDATA | INVERTCLK)
  63. /*
  64. * CLK0, CLK1 modes with non-inverted clock
  65. * Retiming the clk pins will park clock & reduce the noise within the core.
  66. */
  67. #define NICLK (RT | CLKNOTDATA)
  68. #endif /* _ST_PINCFG_H_ */