Commit Graph

1280544 Commits

Author SHA1 Message Date
Sugar Zhang
4bdb54ffcb drm/bridge: synopsys: dw-hdmi: Fix nlpcm bitstream
Clear the Audio Logic to fix the NLPCM and HBR situation switch.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I98c25e36c76c1308c5b4d50a1d861e3b043e2235
2025-02-27 02:39:26 +00:00
Sugar Zhang
944315b15a arm64: dts: rockchip: rk3528: Enable CLK-ALWAYS-ON for HDMI-SAI
Change-Id: I3863a2f5f080a1e59b02e00014b3eb32d8162839
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2025-02-27 02:39:26 +00:00
Shawn Lin
2eae2ccf32 PCI: rockchip: dw: Mask and unmask misc irq
Other types of irq should only be fired during linked state, except
misc irq. Masking it to keep suspend and resume in noirq environment,
otherwise we might occur accessing dbi in irq for hot reset case while
resuming haven't finished, which causing the system hung.

Thread #1 (Suspended : Step)
dw_pcie_read() at pcie - designware.c:106 0xfffffc0106809d0
dw_pcie_read_dbi() at pcie - designware.c:147 0xfffffc0106809d0
dw_pcie_readl_dbi() at pcie - designware.h:315 0xfffffc01068686c
rk_pcie_sys_irq_handler() at pcie - rockchip.c:1,432 0xfffffc01068686c
__handle_irq_event_percpu() at handle.c:156 0xfffffc0100ccd50
handle_irq_event_percpu() at handle.c:196 0xfffffc0100cd03c
handle_irq_event() at handle.c:213 0xfffffc0100cd03c
handle_fasteoi_irq() at chip.c:732 0xfffffc0100d2b00
generic_handle_irq_desc() at irqdesc.h:152 0xfffffc0100cbc70
__handle_domain_irq() at irqdesc.c:693 0xfffffc0100cbc70
<...more frames...>

Fixes: bb9632320ba7 ("PCI: dw: rockchip: Support rockchip_dw_pcie_pm_ctrl_for_user")
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I2bff726b30c0c5fcaef62aa5cc80548aedbb4505
2025-02-27 02:38:10 +00:00
Tao Huang
2551a5f146 ARM: rockchip_linux_defconfig: Enable CONFIG_WERROR
Change-Id: I0a28141853b771b948a19652d7fa846c0fce1466
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2025-02-26 19:20:10 +08:00
Mingwei Yan
3f26cdc2d2 media: rockchip: vpss: refactor v_1 for rk3576
Signed-off-by: Mingwei Yan <mingwei.yan@rock-chips.com>
Change-Id: Iff2b7f690b9143807cb5135aa518804dbaf29614
2025-02-26 10:02:54 +00:00
Yandong Lin
a956e55572 media: rockchip: isp: set the dma_buf of wrap buf
Change-Id: I1203b4701e9e77a6bede5210f5273a4919b3536a
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-02-26 16:39:24 +08:00
Yandong Lin
5e7f327ab7 video: rockchip: dvbm: Fix typo
Change-Id: Id42b53521e7b797353ef7af36764fc1d656f874e
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-02-26 16:39:20 +08:00
Sandy Huang
230936ca04 drm/rockchip: drv: only rk3528/rk3566/rk3568/rk3588 need ovl lock
1. RK3566/RK3568/RK3588 VOP different VPs share one overlay logic,
so need use ovl lock to make sure they're mutually exclusive, Except
this three platform, other VOP each VP have independent overlay logic.

2. RK3528 need to reset the p2i_en bit when POST_BUF_EMPTY at
post_buf_empty_work_event(), the vop2_cfg_done() must exclusive with
userspace commit new frame.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I84feb978e00a6c5d32266cd3946610e0cc09868b
2025-02-26 08:03:13 +00:00
Finley Xiao
1e5e146f58 mali400: mali: Add support to set clk to normal pll for rk3518
Change-Id: I74440a835ef513d2f936b5b7f9a89a82ce15e021
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2025-02-26 15:06:57 +08:00
chaoyi.chen
2367b261cf drm/rockchip: dw_dp: Set output_type in dw_dp_encoder_mode_valid()
The output_type may changed after DP encoder bound to CRTC. For
example, when performing modeset, calling vop2_crtc_atomic_disable()
will clear the output_type to zero. When drm_mode_getconnector() is
called again, since the encoder has already been bound to the CRTC,
the output_type will not be set and will remain zero. It can lead to
the vop2_crtc_mode_valid() being unable to retrieve the correct
output_type.

This patch set output_type in dw_dp_encoder_mode_valid(), regardless
of whether encoder is already bound to a CRTC.

Change-Id: I1888d4cc44604072bbf0cbe67a0d21fa8303b7b0
Signed-off-by: chaoyi.chen <chaoyi.chen@rock-chips.com>
2025-02-25 04:00:35 +00:00
Damon Ding
de85a5fecf drm/rockchip: logo: check whether the bridge supports atomic mode before mode fixup
According to the include/drm/drm_bridge.h, the following functions
are mandatory in atomic mode:
&drm_bridge_funcs.atomic_reset()
&drm_bridge_funcs.atomic_duplicate_state()
&drm_bridge_funcs.atomic_destroy_state()

For some bridge drivers that have not supported atomic mode yet:
drivers/gpu/drm/bridge/sii902x.c
drivers/gpu/drm/bridge/rk630-tve.c
......

The drm_atomic_get_bridge_state() should not be called to get the
bridge state by the global atomic state. Without this patch, the null
pointer exception will occur.

Fixes: 3558926745 ("drm/rockchip: logo: call drm_atomic_bridge_chain_check() bridge in mode fixup")
Change-Id: I68c953db21a95bf5454fc47c65958dee9d13a8ce
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
2025-02-25 10:46:30 +08:00
Sandy Huang
2f6100f677 ARM: dts: rockchip: add RK3518 evaluation board devicetree
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ib4a8a05d13fc4c2cb3732bbc9365d9c292788e3d
2025-02-24 20:04:33 +08:00
Sandy Huang
c28467ad76 arm64: dts: rockchip: add RK3518 evaluation board devicetree
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Id2d6a2792bd237db868fe1ad0844a65e77d00af3
2025-02-24 20:03:34 +08:00
Sandy Huang
5c5445c865 arm64: dts: rockchip: add core dtsi for RK3518 Soc
RK3518 is a Soc base on Rockchip RK3528, the cpu freq
is lower than RK3528 and remove PCIE/RGMII supported.

Change-Id: I9334959b598ece349dfce7e2b922cf91562c61ac
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2025-02-24 20:02:31 +08:00
Finley Xiao
de1f9cd3b4 cpufreq: dt-platdev: Add rk3518 project into blacklist
Change-Id: Ic18aa909ded2c4820036ea4bbaf6a60510a69078
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2025-02-24 19:59:24 +08:00
Finley Xiao
aa5ca65c01 soc: rockchip: cpuinfo: Add support for rk3518
Change-Id: I3061709de83521c6c98df68ba12422e2523c88ab
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2025-02-24 19:59:23 +08:00
Finley Xiao
422fcf5068 soc: rockchip: cpuinfo: Add support to parse 'cpu-code1'
Change-Id: I080efaae76c28fd255c314fc9033efcc02457d4d
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2025-02-24 19:59:12 +08:00
Sugar Zhang
8edba5a8bc ASoC: rockchip: dlp: Fix loopback capture data loss
When applptr exceeds buffer boundaries, the calculated offset
becomes misaligned with the actual buffer position, causing
loopback capture data loss.

This patch fix it by applying boundary checks during applptr updates.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I7c6497a9aa7e12e9b3e1c14dcc6de74bbc1515e2
2025-02-24 11:01:21 +00:00
Simon Xue
a3ae395ec7 iio: adc: rockchip_saradc: fix bitmask for channels on SARADCv2
Change-Id: I07c3a41ca74201ac324821e707fe8ee05d42322d
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2025-02-24 18:26:59 +08:00
Jiang Yu
160d27ae72 arm64: dts: rockchip: rk3576-amp: Modify the address of the reserved-memory to ease the MCU's address remapping.
Change-Id: Id01ef28f6db51b92691f928d385e2ae5c504258e
Signed-off-by: Jiang Yu <yu.jiang@rock-chips.com>
2025-02-24 06:46:27 +00:00
Jianwei Fan
91e4a94e33 video: rockchip: vehicle: switch to using gpiod API
Change-Id: I1cb0255c09da6bdaef96299e2e6bd4b087ba5413
Signed-off-by: Jianwei Fan <jianwei.fan@rock-chips.com>
2025-02-24 06:44:02 +00:00
Lin Jianhua
bffc28f119 ARM: configs: rk3506_defconfig: support keyboard matrix
Change-Id: Ia3ef90a49f465eebdc2363f17e28eb835c4ea0e7
Signed-off-by: Lin Jianhua <linjh@rock-chips.com>
2025-02-24 10:34:05 +08:00
Sandy Huang
92379ecd7d drm/rockchip: remove unused psr_list{,_lock}
This code has been removed in the upstream version, but it's left
in the internal project.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I4d41bfa646df698d24d38c98244529f8ea53f47e
2025-02-21 17:39:29 +08:00
Ye Zhang
ab4e8bc959 soc: rockchip: pm_debug: Add gpio debug info
Signed-off-by: Ye Zhang <ye.zhang@rock-chips.com>
Change-Id: Ia639f5285b4ef520bd980034d3bee4cd1370a6d1
2025-02-21 17:06:23 +08:00
Joseph Chen
a708fcf972 ARM: dts: rockchip: rk3502-evb1: Update io to save suspend power
gpio0_c5: pull-z and disable smt
gpio0_a0/a2: pull-z

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iac5877f14f66d18c2b69a44a12035fd17a5b6412
2025-02-21 07:42:51 +00:00
Yu Qiaowei
c75c935971 video: rockchip: rga3: support iova equal to 0
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I0fd52e2ff9ee93944d8f37c6c8ea1e7e63dff10f
2025-02-21 07:14:22 +00:00
Simon Xue
b22838f67e soc: rockchip: add /proc/rk_zoneinfo/zoneinfo
The dump zone information using the following two commands:

1. cat /proc/rk_zoneinfo/zoneinfo
2. cat /proc/rk_zoneinfo/zoneinfo > /data/data/1.txt

NOTICE: dumping zone information should only be done during debugging.
The dump zone information holds the spinlock of the zone, which can
impact the performance of the memory subsystem.

==== ZONE & PAGE INFO (with page order) ====
Zone: DMA32
  managed_pages:  952984
  spanned_pages:  1048064
  present_pages:  978432

  Order: 0 | nr_free: 5
    Migrate type 0 => (empty)
    Migrate type 1 => page: fffffffe000a3940 | PFN: 00010469 | phys_addr: 0x00028e5000 | flags: 0x0 | compound: 0 | node: 0 | zone: DMA32 | buddy_order: 0
    Migrate type 1 => page: fffffffe0028d940 | PFN: 00041829 | phys_addr: 0x000a365000 | flags: 0x0 | compound: 0 | node: 0 | zone: DMA32 | buddy_order: 0
    Migrate type 2 => (empty)
    Migrate type 3 => page: fffffffe004085c0 | PFN: 00066071 | phys_addr: 0x0010217000 | flags: 0x0 | compound: 0 | node: 0 | zone: DMA32 | buddy_order: 0
    Migrate type 3 => page: fffffffe004089c0 | PFN: 00066087 | phys_addr: 0x0010227000 | flags: 0x0 | compound: 0 | node: 0 | zone: DMA32 | buddy_order: 0
    Migrate type 3 => page: fffffffe00408ac0 | PFN: 00066091 | phys_addr: 0x001022b000 | flags: 0x0 | compound: 0 | node: 0 | zone: DMA32 | buddy_order: 0
    Migrate type 4 => (empty)
    Migrate type 5 => (empty)

  Order: 1 | nr_free: 65
    Migrate type 0 => (empty)
    Migrate type 1 => page: fffffffe000a3980 | PFN: 00010470 | phys_addr: 0x00028e6000 | flags: 0x0 | compound: 0 | node: 0 | zone: DMA32 | buddy_order: 1
    Migrate type 1 => page: fffffffe0020d280 | PFN: 00033610 | phys_addr: 0x000834a000 | flags: 0x0 | compound: 0 | node: 0 | zone: DMA32 | buddy_order: 1
    Migrate type 1 => page: fffffffe0028d980 | PFN: 00041830 | phys_addr: 0x000a366000 | flags: 0x0 | compound: 0 | node: 0 | zone: DMA32 | buddy_order: 1
    Migrate type 2 => (empty)

Change-Id: If9227fefaa79d744ca6dde123bd50f033d30c39c
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2025-02-20 20:48:08 +08:00
Jianwei Fan
bb4832d4dc media: i2c: rk628: post process add yuv2020 to rgb
Change-Id: Ic40174bae631bf40e1f48927e6ff5454fe4e76a8
Signed-off-by: Jianwei Fan <jianwei.fan@rock-chips.com>
2025-02-20 11:39:34 +00:00
Sugar Zhang
2e44c5c06e ASoC: rk312x: Remove unused code
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Iab76cb375c1b855a4619da302927e85dfa001d1d
2025-02-20 11:35:17 +00:00
Zefa Chen
3066221fd5 media: rockchip: vicap fixes error of parse data type
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I02b1fe620312ce3b6fdae08da6eea993f141cfc0
2025-02-20 11:31:28 +00:00
Finley Xiao
4c0e96c036 PM / devfreq: rockchip_dmc: Use new api to adjust opp table for rk3528
Change-Id: I3f1889870675d143281ab52d9205edb76cbaee31
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2025-02-20 08:39:31 +00:00
Finley Xiao
7e3f5258dd arm64: dts: rockchip: rk3528: Add 324MHz and 666MHz for dmc
Change-Id: I4a00da54462f95e64252ecb4f4e081eedad8458f
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2025-02-20 08:39:31 +00:00
Sugar Zhang
13787c3f30 ASoC: es8323: Fix power consumption
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I50718cb52ec7fd0fa827c1cd856ec4cbdc978433
2025-02-20 07:43:15 +00:00
Cai YiWei
8e24c177fa media: rockchip: isp: optimize aiisp for isp39
Change-Id: I79d975e39bca68b0b14ed5bdebf361c11749493e
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2025-02-19 06:57:00 +00:00
Sandy Huang
e5cff921bf drm/rockchip: gem: fix some potential issues
According to deepseek suggestion, fix the following potential issues:

1. drm_gem_object_init() does not check the return value,
   causing memory leak;
2. The alloc_kmap flag maybe overwritten by an error in
   rockchip_gem_create_with_handle();
3. Resource leak exists in rockchip_gem_prime_import_sg_table();

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I998feace191784638bf68bf53f57ff74c4ecf6dd
2025-02-19 06:56:17 +00:00
Damon Ding
a3d2c5d99a drm/rockchip: vop2: fix the default plane_make configurations for RK3588
The relationships between the main window and the splice window are:

Main     | Splice
Cluster0 | Cluster1
Cluster2 | Cluster3
Esmart0  | Esmart1
Esmart2  | Esmart3

The VP0 and VP1 should be used in combination when the display mode is
over 4k. The main window should attach to the VP0, while the splice
window should attach to the other.

Without this patch, the default plane_mask may not meet the above
requirement when the plane_mask is not assigned in DTS.

Change-Id: Ia676f519ce26d579b1066841715fe8678dc15852
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
2025-02-19 03:45:49 +00:00
Jianwei Zheng
c3dbb54a6d usb: dwc2: skip core init if ARCH_ROCKCHIP is defined
There is no need to do dwc2_core_init() for Rockchip SOCs if the
logic is not powered off after system suspend. If the logic is
powered off after system suspend, we will reinitialize the core
in dwc2_resume() function.

Change-Id: Ibe6d0e81e5a39feca528c838c187cfe8c31269f5
Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com>
2025-02-19 03:44:09 +00:00
XiaoTan Luo
8f68e85c3d ASoC: rockchip: pdm_v2: set 0dB gain as default
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: Idd40bf44db7bbc0177bc3ac84ba847787ed98436
2025-02-18 12:31:02 +00:00
Zefa Chen
d00f989131 media: rockchip: isp support to adjust sof_cnt according to vicap sof
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: Ia4534a6b88dbf1d6780d8a9ba4fa656b386e42c9
2025-02-18 17:55:00 +08:00
Zefa Chen
4f692186c0 media: rockchip: vicap increase frame_idx and sof according to mipi fs package
mean sometimes dma capture is turned off because not active buf,but increase frame_idx to record frame loss
the function start with rk3576 and new chip

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: Ie5be72b2ba3372a511c462853fc705a5c8b1e9d7
2025-02-18 17:54:50 +08:00
Sandy Huang
3fe3f9cdbd drm/rockchip: vop2: Fix incorrect ref_count for rk3576 cluster_pd
1. The 4 ESMART win share one PD_ESMART and 2 CLUSTER win share one
   PD_CLUSTER
2. The 4 ESMART win and 2 CLUSTER win maybe used by different VP
3. Different VP have different vsync, this maybe lead to PD up and
   down at unexpected time.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Iaa3d72df880180a9d73476551f31b7adaa76e967
2025-02-18 09:28:01 +00:00
Algea Cao
d3bff0d9f8 drm/bridge: synopsys: dw-hdmi-qp: Fix AVI checksum error in vsi quirk
Complement the calculation of AVI checksum.

Change-Id: Icbc4091923a81a69fe0a99aa0be4f448d61a7bb0
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2025-02-18 09:21:33 +00:00
Chaoyi Chen
3301ea2fe9 drm/rockchip: vop: move devm_request_irq to the end of vop_bind
At MOS environment, the irq handle may be triggered immediately
after request irq, the irq handle maybe access vop memory, e.g.,
vop_isr() -> vop_wb_handler() access vop->wb->regs, so move
devm_request_irq() to the end of this function to make sure vop is
initialized.

Change-Id: Ie124576bf2333f63ec3985c321a3c368e28b34be
Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
2025-02-18 08:53:59 +00:00
Zefa Chen
cab48d65f1 media: rockchip: vicap modify logic of sof
skip sof and frame_index when loss frame, only work in multi online

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: Ib9739dec0674deac0c0ad182f6836f9edf858212
2025-02-18 08:52:03 +00:00
Cai YiWei
007db6109c media: rockchip: isp: multi-sensor online info to vicap
Change-Id: Ie5797f8ed2962df2901aaae07f0cdc63bc1e3885
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
2025-02-18 08:52:03 +00:00
Lin Jianhua
524b58176c arm64: dts: rockchip: rk3576-evb1: add pcie1 config
Change-Id: Ibe7bf214394a28a7353b183d669a47e43e4fb32e
Signed-off-by: Lin Jianhua <linjh@rock-chips.com>
2025-02-18 07:07:11 +00:00
Jianwei Zheng
4073bf94a0 ARM: dts: rockchip: rk3502: enable low power mode for rk3502 otg0 port
Change-Id: I881ee0071e937a682225f58f48b8b78dc209a4ae
Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com>
2025-02-18 06:09:07 +00:00
Jianwei Zheng
e38af60ecf phy: rockchip: inno-usb2: disable vbus detection in low power mode
This patch disable vbus detection in low power mode to save power.

Change-Id: Ic9536d26d6e9d9ab57e4e20b9f43859f445ada0c
Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com>
2025-02-18 06:09:07 +00:00
Tao Huang
9916fb1f29 media: i2c: tp2855: move from strlcpy with unused retval to strscpy
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I4e253239598ab2ac253fea105ab616087881a795
2025-02-17 19:37:58 +08:00
Tao Huang
1b68336277 media: i2c: tc35874x: move from strlcpy with unused retval to strscpy
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I95996a7f1e21627d71dfebeef2c65f3a308d7a0a
2025-02-17 19:37:58 +08:00