sf_vop.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
  4. */
  5. #ifndef __RK_VOP_H__
  6. #define __RK_VOP_H__
  7. #include <clk.h>
  8. #include <reset.h>
  9. #define AQ_INTR_ACKNOWLEDGE 0x0010
  10. #define AQ_INTR_ENBL 0x0014
  11. #define DC_HW_REVISION 0x0024
  12. #define DC_HW_CHIP_CID 0x0030
  13. #define DC_REG_BASE 0x0800
  14. #define DC_REG_RANGE 0x2000
  15. #define DC_SEC_REG_OFFSET 0x100000
  16. //define power management i2c cmd(reg+data)
  17. #define POWER_SW_0_REG (0x00+0x80)
  18. #define POWER_SW_0_VDD18_HDMI 0
  19. #define POWER_SW_0_VDD18_MIPITX 1
  20. #define POWER_SW_0_VDD18_MIPIRX 2
  21. #define POWER_SW_0_VDD09_HDMI 3
  22. #define POWER_SW_0_VDD09_MIPITX 4
  23. #define POWER_SW_0_VDD09_MIPIRX 5
  24. enum vop_modes {
  25. VOP_MODE_EDP = 0,
  26. VOP_MODE_MIPI,
  27. VOP_MODE_HDMI,
  28. VOP_MODE_LVDS,
  29. VOP_MODE_DP,
  30. };
  31. struct sf_vop_priv {
  32. void __iomem * regs_hi;
  33. void __iomem * regs_low;
  34. struct udevice *conn_dev;
  35. struct display_timing timings;
  36. struct clk disp_axi;
  37. struct clk vout_src;
  38. struct clk top_vout_axi;
  39. struct clk top_vout_ahb;
  40. struct clk dc_pix0;
  41. struct clk dc_pix1;
  42. struct clk dc_axi;
  43. struct clk dc_core;
  44. struct clk dc_ahb;
  45. struct clk top_vout_lcd;
  46. struct clk hdmitx0_pixelclk;
  47. struct clk dc_pix_src;
  48. struct clk dc_pix0_out;
  49. struct clk dc_pix1_out;
  50. struct reset_ctl vout_resets;
  51. //20221014
  52. struct reset_ctl dc8200_rst_axi;
  53. struct reset_ctl dc8200_rst_core;
  54. struct reset_ctl dc8200_rst_ahb;
  55. struct reset_ctl rst_vout_src;
  56. struct reset_ctl noc_disp;
  57. bool mipi_logo;
  58. bool hdmi_logo;
  59. };
  60. enum vop_features {
  61. VOP_FEATURE_OUTPUT_10BIT = (1 << 0),
  62. };
  63. struct rkvop_driverdata {
  64. /* configuration */
  65. u32 features;
  66. /* block-specific setters/getters */
  67. void (*set_pin_polarity)(struct udevice *, enum vop_modes, u32);
  68. };
  69. /**
  70. * rk_vop_probe() - common probe implementation
  71. *
  72. * Performs the rk_display_init on each port-subnode until finding a
  73. * working port (or returning an error if none of the ports could be
  74. * successfully initialised).
  75. *
  76. * @dev: device
  77. * @return 0 if OK, -ve if something went wrong
  78. */
  79. int rk_vop_probe(struct udevice *dev);
  80. /**
  81. * rk_vop_bind() - common bind implementation
  82. *
  83. * Sets the plat->size field to the amount of memory to be reserved for
  84. * the framebuffer: this is always
  85. * (32 BPP) x VIDEO_ROCKCHIP_MAX_XRES x VIDEO_ROCKCHIP_MAX_YRES
  86. *
  87. * @dev: device
  88. * @return 0 (always OK)
  89. */
  90. int rk_vop_bind(struct udevice *dev);
  91. /**
  92. * rk_vop_probe_regulators() - probe (autoset + enable) regulators
  93. *
  94. * Probes a list of regulators by performing autoset and enable
  95. * operations on them. The list of regulators is an array of string
  96. * pointers and any individual regulator-probe may fail without
  97. * counting as an error.
  98. *
  99. * @dev: device
  100. * @names: array of string-pointers to regulator names to probe
  101. * @cnt: number of elements in the 'names' array
  102. */
  103. void rk_vop_probe_regulators(struct udevice *dev,
  104. const char * const *names, int cnt);
  105. #endif