Commit Graph

1268396 Commits

Author SHA1 Message Date
Zhang Yubing
09bbffb298 drm/rockchip: dw-dp: get the real hpd state
In DPTX Controller, when hpd signal is low, the hpd state will
change to unplug immediately. if the low level signal is less
than 2ms, the hpd state will change to plug state and trigger a
hpd irq interrupt.

In some case, driver will detect hpd state to get the plug/unplug
info when a hpd irq is coming. A hpd irq may be regard as a unplug
state. To avoid this issue, it better to wait the hpd state change
to the nest state.

Change-Id: I68c5bdc72128a2bc3ea990cfcb54e2ade755abc7
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
2024-03-03 11:09:41 +08:00
Zhang Yubing
969569b827 drm/rockchip: dw-dp: register mst encoder when port node enabled
Change-Id: Ie242c1a0425a3b01dea1378661a0c18daf3e5d32
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
2024-03-03 11:09:41 +08:00
Sandy Huang
c4642391b1 drm/rockchip: vop2: adjust hfp and hbp for YUV420 output
For RK3576 YUV420 output, hden signal introduce one cycle delay,
so we need to adjust hfp and hbp to compatible with this design.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I272f3e145bfe216b1d76f6313c43180040590deb
2024-03-03 11:09:40 +08:00
Sandy Huang
bcc718e4cf drm/rockchip: vop2: add some debug log for BCSH
Some platform VP can't support BCSH, add some log to remind this info
when userspace want to enable BCSH at unsupported VP.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I8247475edad30e14f08ef8c23e8314916c57a1f4
2024-03-03 11:09:40 +08:00
Zhang Yubing
f07a5c3cf0 drm/rockchip: dw-dp: optimeize disable/enable dp flow
when enable dp, it need config as follow:
1. enable dp link clk;
2. config dp regs;
3. enable dp video stream;
4. enable vop data stream.
when disable dp, it need config as follow:
1. disable vop data steam.
2. disable dp video stream;
3. disable dp link clk.

Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: Icd5407da090f137e02d3028b01576ea157401a8a
2024-03-03 11:09:40 +08:00
Zhang Yubing
77187ba446 drm/rockchip: vop2: support disable/enable vop video stream by interface
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: I29dd1033616b80845a83f9125373df3056a9572f
2024-03-03 11:09:40 +08:00
Sandy Huang
ce8f21340f drm/rockchip: vop2: set pre_scan_hblank minimum value to 8
pre_scan_hblank minimum value is 8, otherwise the win reset signal
lead to first line data be zero.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ibef722cd65a9f7e276ba1ffda1d75cac2ac8b83a
2024-03-03 11:09:40 +08:00
Sandy Huang
700e168994 drm/rockchip: vop2: disable writeback auto gating at oneshot mode
At writeback oneshot mode, the writeback auto gating will close clk after
VOP writeback complete, but at this time, the writeback axi access maybe
uncomplete, this will lead to writeback state error and iommu stall failed.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I4a74a8ace1cf6dba6d60af822e0d74d31d7f61fa
2024-03-03 11:09:40 +08:00
Sandy Huang
e5f93a3ed6 drm/rockchip: vop2: add support hdmi phy pll for dclk parent
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I07cf03e0c0d075693bcd4388f52b32b2be4c87de
2024-03-03 11:09:40 +08:00
Elaine Zhang
743c572ad8 drm/rockchip: vop2: add rockchip_drm_dclk_set_rate for rk3576
Change-Id: I22257c8a31233dc6bb0617cfb1c816a51ef134e8
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2024-03-03 11:09:40 +08:00
Algea Cao
bd6b813ad4 drm/bridge: dw-hdmi-qp: Add hdmi quirks function
Different hdmi sinks have different compatibility issues.
Many of the solutions are conflicting between different sinks,
So special treatment is needed for different sinks.
Only VSI-related quirks are currently supported, new functions
are gradually supported.

Change-Id: I3aaf654424502380d460b3e9d2229a4cdc56dcb1
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2024-03-03 11:09:40 +08:00
Sandy Huang
6b1476cb36 drm/rockchip: vop2: set reg done every field for interlace
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ie003f46f78700a8a01399616619ffaa68f2d7ec9
2024-03-03 11:09:40 +08:00
Algea Cao
0b9ec0ec3c drm/rockchip: vop3: Fix post csc matrix error
Fix vop3_post_csc_config() variable passing
error when property POST_CSC_DATA is NULL.

Change-Id: I628178877dbe16a2697ad716f103725952a3a6fa
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2024-03-03 11:09:40 +08:00
Sandy Huang
e2a0c491c8 drm/rockchip: vop2: disable dma access stride 4k
If less this commit, Cluster will be display black and appear
POST_BUF_EMPTY.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ia0505bdb3917624725bb288e089fb88abbe9972e
2024-03-03 11:09:40 +08:00
Sandy Huang
999eaf4dae drm/rockchip: vop2: update default axi id for rk3576
win axi id register is 5 bits, but lut/dci axi id is 4 bits, so lut axi id
should be less then 0xf;

  Cluster0 win0: 0x10, 0x11	[AXI0]
  Cluster0 win1: 0x12, 0x13	[AXI0]
  Cluster1 win0: 6, 7        	[AXI0]
  Cluster1 win1: 8, 9        	[AXI0]
  Esmart0:	 a, b           [AXI0]
  Esmart1:	 c, d           [AXI0]
  Esmart2:	 a, b           [AXI1]
  Esmart3:	 c, d           [AXI1]
  Lut dma rid:	 0x1, 0x2, 0x3  [AXI0]
  DCI dma rid:	 0x4        	[AXI0]
  Metadata rid:	 0x5        	[AXI0]

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: If1148aba4ab5242470511b356ee53db9cccef1eb
2024-03-03 11:09:40 +08:00
Algea Cao
3832b4ab01 drm/rockchip: dw_hdmi: Support rk3576 config ddc sda holding time
If hdmi ddc sda and scl fall edge phase difference
is too small, support configure the sda falling edge
in dts.
The delay range is 0-76800 ns.

Change-Id: I116137d8e6b9adac1262a8e658320845281555b5
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2024-03-03 11:09:40 +08:00
Algea Cao
99433cbd0e drm/rockchip: dw_hdmi: Support hdcp1.4 repeator auth
Change-Id: I0905b4e77c89c6d9020903d00105e7d3eea3cfef
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2024-03-03 11:09:40 +08:00
Guochun Huang
53c35ed667 drm/rockchip: dsi2: optimize power-on sequence
1.set dsi lane to LP11 status before powering on the sceen
2.Support for init codes can be transmitted at LP or HS mode
3.HS clk comes out when the high-speed video signal is sent

Change-Id: I192a9b9d6ac3fb0cdbb4b4d462203e97c6427028
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
2024-03-03 11:09:40 +08:00
Sandy Huang
1a3e95ad13 drm/rockchip: vop2: update output mode for rk3576/rk3588 yuv422
RK3588:
    4'b0011: eDP YUV422
    4'b1100: DP YUV422
    4'b1101: DP YUV420
    4'b1110: HDMI YUV420
RK3576:
    4'b1100: eDP/DP YUV422
    4'b1101: HDMI YUV422
    4'b1110: DP/HDMI YUV420

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I8f51ccda820ecba15c1f594794a24138e9348c54
2024-03-03 11:09:39 +08:00
Sandy Huang
fe3cbe40dc drm/rockchip: vop2: esmart port sel config need only consider region0
If less this commit, esmart port sel will be set error val and lead to
esmart register can't take effect, this will lead to like iommu
pagefault issues.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: If2c80a683b81d1ad00bdea9f2c09da90a5f55964
2024-03-03 11:09:39 +08:00
Damon Ding
ff9086b3e3 drm/rockchip: vop: fix the configurations of 1to4 function for rk3576
1.Fix the shift of reg grf_mipi_1to4_en to 0.
2.Set grf_mipi_mode to 0(video mode) if using display path
  vopl->1to4->mipi.
3.Add configuration of reg out_dresetn, which should be
  set to 1 if using display path vopl->1to4->edp/hdmi/mipi.
4.Set reg grf_hdmi_1to4_en to 1 if using display path
  vopl->1to4->hdmi.

Change-Id: Ia19725f69382d6b0d2a710c17b9ac1c8a284ddf5
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
2024-03-03 11:09:39 +08:00
Damon Ding
3965fbfb46 drm/rockchip: vop: enable rb_swap and rg_swap in YUV444 bus_format for rk3576 vopl
The RGB888 bus_format can be converted to VYU444 if r2y
enabled, so it is needed to enable rb_swap and rg_swap
for YUV444.

Change-Id: Ib35398137dcd3c849590ba5243d879c5ef11ccee
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
2024-03-03 11:09:39 +08:00
Algea Cao
0a6460072f drm/bridge: dw-hdmi-qp: Fix timer reference base error
Set timer reference base According to the actual
refclk frequency, otherwise cec or ddc function
may be abnormal.

Change-Id: Id45af649182a5158a47ee2cadb1254f2dc855d52
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2024-03-03 11:09:39 +08:00
Zhang Yubing
9e65f43e46 drm/rockchip: dw-dp: power on phy when enter mst mode
Change-Id: I5cf78578784741b031721ef39df578c93606cf86
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
2024-03-03 11:09:39 +08:00
Zhang Yubing
430ada503b drm/rockchip: drv: support dp mst atomic check
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: I1a28ea739b49c6ec17f2ffa6c071bcf590cfe367
2024-03-03 11:09:39 +08:00
Zhang Yubing
4e4477d788 drm/rockchip: dw-dp: support rk3576 dp
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I05bca0eb320c99aa007e93a5c75f87886812f075
2024-03-03 11:09:39 +08:00
Sandy Huang
e0dafef0e0 drm/rockchip: vop2: update default axi id for rk3576 esmart2/3
Cluster0 win0: 	2, 3    		[AXI0]
Cluster0 win1: 	4, 5    		[AXI0]
Cluster1 win0: 	6, 7    		[AXI0]
Cluster1 win1: 	8, 9    		[AXI0]
esmart0: 	a, b			[AXI0]
esmart1: 	c, d        		[AXI0]
esmart2: 	a, b      	     	[AXI1]
esmart3: 	c, d           		[AXI1]
lut dma: 	0x10, 0x11, 0x12	[AXI0]
dci dma: 	0x13        		[AXI0]
metadata: 	0x14        		[AXI0]

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I1bd2db0a154a3c5f54c31ae55062ad2ba78abfc3
2024-03-03 11:09:39 +08:00
Damon Ding
a601d1332e drm/rockchip: analogix_dp: add mem_clk_auto_gating config
Reg mem_clk_auto_gating can help to gate the clock for
accessing HDCP memory automatically.

Change-Id: I04188d59e4273cfb61551cd01ca53f336d2bf1aa
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
2024-03-03 11:09:39 +08:00
Algea Cao
6413818cf5 drm/rockchip: dw_hdmi: Support rk3576 hdmitx
1.Support hpd.
2.Support hdmi ddc.
3.Support resolutions up to 4k120.

Change-Id: I557c3bdb097612aa7656ba23af7510ecb7158b17
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2024-03-03 11:09:39 +08:00
Damon Ding
2a859346b0 drm/rockchip: vop: move 1to4 reg configs to vo0_grf domain
For rk3576, vopl supports eDP/HDMI/MIPI by the 1to4
module, which can transfer 1 pixle/cycle data from
vopl to 4 pixle/cycle data for HDMI/MIPI controllers.

Change-Id: I0da688d53c92a93e55778da2cce17596a22f540e
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
2024-03-03 11:09:39 +08:00
Damon Ding
ba3a77c3b7 drm/rockchip: vop: update VOP_GRF_SET() func to support different grf domains
Change-Id: Ibafb0458d13ab4b8c397e888fff1e43266777a79
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
2024-03-03 11:09:39 +08:00
Algea Cao
039fcfd05c drm/rockchip: vop3: Support rk3576 post SHARP
SHARP mainly completes the enhancement of image
details, which can support the configuration of
different intensity gains for different scales
and different directions of details.

Only vp0 support SHARP and rgb input is not
supported. SHARP shares line buffer with
post scaler, so the two functions are mutually
exclusive.

Change-Id: Id4887594821640d6685a76a7094bbb57c6d50b21
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2024-03-03 11:09:39 +08:00
Algea Cao
c32a7f8a2c drm/rockchip: vop3: Support rk3576 DCI
DCI mainly completes the dynamic adjustment of the
brightness and contrast of the picture according to
the brightness distribution of the current picture,
so that the picture appears more transparent.

Only cluster0 supports DCI, suitable for minimum
resolution of 128 x 128 and maximum resolution of
4096 x 2160.

Change-Id: I1836d2d317172859b7df971ce4f4fb5dfb1b4c83
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2024-03-03 11:09:39 +08:00
Algea Cao
47d9586f41 drm/rockchip: vop3: Support rk3576 dither frac v2
Change-Id: I4a815190d05e8a149c969df7b4418f02031e3f2c
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2024-03-03 11:09:39 +08:00
Sandy Huang
8379fd7555 drm/rockchip: vop2: add support rk3576
RK3576 VOP have 2 Cluster win and 4 Esmart win, this win be used
by 3 video ports as following roles:
 * VP0 can use Cluster0/1 and Esmart0/2
 * VP1 can use Cluster0/1 and Esmart1/3
 * VP2 can use Esmart0/1/2/3

In additions, RK3576 VOP can support DCI/ACM/CSC/HDR/SHARP/GAMMA/3D LUT/POST SCALE/BCSH
etc. post process.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I89f656e847f758f9d3d57ee0c137b29196de6737
2024-03-03 11:09:39 +08:00
Damon Ding
d59406a0fc drm/rockchip: analogix_dp: add support for rk3576
Change-Id: Iba1522fbdb19d50f3ebfbac8eb056e1ba7c55125
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
2024-03-03 11:09:38 +08:00
Guochun Huang
a456949589 drm/rockchip: dsi2: add support rk3576
Change-Id: I11edc6366102e6c2aee27f05731a87f3c6565468
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
2024-03-03 11:09:38 +08:00
Damon Ding
c84e046df4 drm/rockchip: vop: add support for rk3576 vopl
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: Ib4854bbb16834ae06db4f48d562eb0e8a072dc88
2024-03-03 11:09:38 +08:00
Damon Ding
3cdbc041e2 drm/rockchip: rgb: add support for rk3576
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I52f6fdad495700dd172fa86c85d168100fcd7486
2024-03-03 11:09:38 +08:00
Steven Liu
2345ce1339 gpio: rockchip: support GPIO_TYPE_V2_2
Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: Ia3e261dbe23d82fe9c1706cd2b374c27009fbdda
2024-03-03 11:09:38 +08:00
Steven Liu
9f71509836 pinctrl: rockchip: add rk3576 support
Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: Ib5d22b9aeee559ad7bd7202b1586326f6f8cf8ab
2024-03-03 10:59:40 +08:00
Finley Xiao
d6510db1a1 soc: rockchip: power-domain: Add power domain support for rk3576
This driver is modified to support RK3576 SoCs.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Id933108d90a2850b82779a7328563a3b0812e703
2024-03-03 10:59:40 +08:00
Finley Xiao
dd7db0cde7 dt-bindings: add power-domain header for RK3576 SoCs
According to a description from TRM, add all the power domains.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ia9361658401641acbaec8b4853a07507dcf48404
2024-03-01 22:15:43 +08:00
Elaine Zhang
12fe1aaf5b clk: rockchip: Add clock controller for the RK3576
Add the clock tree definition for the new RK3576 SoC.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I85c05295394032485f146efbaf8aee9044685bfa
2024-03-01 22:15:42 +08:00
Elaine Zhang
081c3b4917 clk: rockchip: add dt-binding header for rk3576
Add the dt-bindings header for the rk3576, that gets shared between
the clock controller and the clock references in the dts.
Add softreset ID for rk3576.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I6aff7360d4ff95266134394e66e0987c59906905
2024-03-01 22:15:42 +08:00
Elaine Zhang
f2ab9b0921 dt-binding: clock: Document rockchip,rk3576-cru bindings
Document the device tree bindings of the rockchip Rk3576 SoC
clock driver in
Documentation/devicetree/bindings/clock/rockchip,rk3576-cru.yaml.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I4f80de8accd78e29a3bac0a8ef9c2c9ef946bb94
2024-03-01 22:15:42 +08:00
Cai YiWei
2ec5069873 arm64: rockchip_linux_defconfig: add vpss for rk3576
Change-Id: I79e46c333994ea0c80d5af3c0d470e5afd60e44c
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2024-03-01 22:15:42 +08:00
Zefa Chen
44b3e5d885 arm64: config: rockchip_linux_defconfig: add sc4336
Enable sc4336 for rk3576 evb1

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I109eb8a0f68ef113392c57ccf4442774be23285a
2024-03-01 22:15:42 +08:00
Huibin Hong
72357fe5a5 arm64: rockchip_linux_defconfig: set CONFIG_SERIAL_8250_RUNTIME_UARTS=15
For soc has less 15 UARTS, bur more than 10, like rk3576

Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Change-Id: I3bfdfa7414a080864e8d154dec8e1691c21a9ab0
2024-03-01 22:15:42 +08:00
Jiajian Wu
a39f4fe1b1 arm64: configs: rockchip_linux_defconfig: enable CONFIG_SND_SOC_ROCKCHIP_PDM_V2
Change-Id: I51a28cfcf9cac8e7922dc6586f49de53de887c0f
Signed-off-by: Jiajian Wu <jair.wu@rock-chips.com>
2024-03-01 22:15:42 +08:00