Commit Graph

1272310 Commits

Author SHA1 Message Date
Simon Xue
73d746eecf mm/slab: allows kmalloc min size independent on arch dma min alignment when CONFIG_ROCKCHIP_KMALLOC_NO_USE_ARCH_DMA_MINALIGN=y
CONFIG_ROCKCHIP_MINI_KERNEL enabled in some project which perform DMA
into kmalloc area that may cause data corrupt. Use a independent config
CONFIG_ROCKCHIP_KMALLOC_NO_USE_ARCH_DMA_MINALIGN instead of CONFIG_ROCKCHIP_MINI_KERNEL

Fixes: c97fea6ed1 ("slab: allows kmalloc min size independent on arch dma min alignment when CONFIG_ROCKCHIP_MINI_KERNEL=y")
Change-Id: Idd36490d695a0f2910d2b453228688405efdd43a
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2024-07-24 17:33:30 +08:00
Simon Xue
c3c6ec4a49 soc: rockchip: Kconfig: add ROCKCHIP_KMALLOC_NO_USE_ARCH_DMA_MINALIGN
Change-Id: I1dc9d920d35e341173e43906ef9a6ff3a56e5d0a
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2024-07-24 17:23:41 +08:00
Jianwei Zheng
78999d6007 usb: dwc2: fix USB bus repeatedly suspending and resuming
When system wakeup, It will call _dwc2_hcd_resume function and the
port_suspend_change flag will be set to 1 in _dwc2_hcd_resume function.
But in current code, the autosuspend delay for hub is set to zero and
this will cause a strange phenomenon where the USB bus will repeatedly
suspending and resuming.

Considering that setting the port_suspend_change to 1 is only applicable
for partial power mode, there is no need to set port_suspend_change to
1 when DWC2 IP not support partial power mode.

Fixes: c74c26f6e3 ("usb: dwc2: Fix partial power down exiting by
system resume")
Change-Id: Ia57bfb8502cb55a5d9375a5ad609ac4104ff8acb
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com>
2024-07-24 17:18:35 +08:00
Jianwei Zheng
d036e8956b usb: dwc2: fix the port cannot suspend when a HUB is connected
This patch fix the port cannot suspend when a HUB is connected. The
DWC2 IP on Rockchip SOCs does not support clock gating and Current
code places the port suspend within the dwc2_host_enter_clock_gating
function, which results in the port being unable to suspend.

Change-Id: I40fe73d116a30fec6c01a8c3c988653a48175f7f
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com>
2024-07-24 17:18:35 +08:00
Wang Panzhenzhuan
b0a05407cd arm64: dts: rockchip: rk3562-evb2: add ov5695 config
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: I76c1861fd7c41cdff6709f0536be6ee1955c0a14
2024-07-24 17:07:42 +08:00
Ye Zhang
64422a050b arm64: dts: rockchip: rk3576: Add trim configure for tsadc
Signed-off-by: Ye Zhang <ye.zhang@rock-chips.com>
Change-Id: I34fbd118ac4b428548f8a5a71c656634a6a703dc
2024-07-24 14:22:20 +08:00
Sugar Zhang
d8b7089c6a ARM: dts: rockchip: rk3506: Add support for dmamux parsed
Ref: commit 0cabdbb81c ("dmaengine: pl330: Add support for dmamux parsed from DT")

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: If5300201be7a2592946a09b23e4be4d459170748
2024-07-24 09:54:54 +08:00
Sugar Zhang
0cabdbb81c dmaengine: pl330: Add support for dmamux parsed from DT
dmamux pair0: args[1]: reg0 args[2]: val0
dmamux pair1: args[3]: reg1 args[4]: val1

e.g. rk3506

sai0 {
    dmas = <&dmac0 9 0xff2880a4 0x01000100 0xff2880ac 0x000c0000>,
           <&dmac0 8 0xff2880a4 0x00800080 0xff2880ac 0x00030002>;
}

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I81a2d5e8de37954930b6d0e0aab061273ae76cd2
2024-07-24 09:47:25 +08:00
Jianwei Zheng
1087df59e2 extcon: usb-gpio: add some extcon cables
Current Code USB2 PHY use extcon notifier to send USB charger
types to power driver. If we use gpio to detect vbus or id state,
the extcon device is allocated and registered by extcon-usb-gpio.c
driver and USB2 PHY obtains this extcon device through DTS. If
these cables are missing, it will cause USB2 PHY driver to be
unable to set the status of these cables, leading to functional
abnormalities.

Change-Id: Iec27dfde4ec8bf12294bd6c57c3db5dada2f35cd
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com>
2024-07-23 20:52:07 +08:00
Shawn Lin
892834cb62 scsi: ufs: rockchip: Add shutdown support
Disable vcc if it exists, so the rom code could relink the device
from the init state.

Change-Id: I4493df466f3ea60b8c7a7e3befd110311fce6f6c
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2024-07-23 18:41:08 +08:00
Caesar Wang
f148c41378 arm64: dts: rockchip: rk3566/rk3568 boards: Fix pinctrl configuration for wireless-bluetooth
The Linux OS uses the device tree to detect the wifibt module,
particularly the Bluetooth module's UART, identified via
`/sys/firmware/devicetree/base/pinctrl/wireless-bluetooth`.

Some RK3566/RK3568 board configurations redundantly register the pinctrl
for wireless-bluetooth, causing script failures in UART identification.

This commit removes the redundant node to resolve conflicts and ensure
correct UART identification for Bluetooth communication.

Change-Id: Id55c48bda38275c04a365b0ede1f740baf767da2
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2024-07-23 18:37:05 +08:00
Zhibin Huang
df3e952b00 misc: rk628: fix first edid get failure
Type: Fix
Redmine ID: N/A
Associated modifications: N/A
Test: N/A

Signed-off-by: Zhibin Huang <zhibin.huang@rock-chips.com>
Change-Id: I799efc76a444f33c4206f2d6e3610a8768088c81
(cherry picked from commit 11e329fa9405c61c01e6f7630b1482f4f82b6b5f)
2024-07-23 17:24:01 +08:00
Sugar Zhang
42568b67f3 ASoC: rockchip: i2s-tdm: Fix the clk glitch on Calibrate case
BACKGROUND
A short clk giltch (~200us) found on the mclk calibrate case in
kernel 5.10.

  mclk-12.288M - mclk-49.152M (~200us) - mclk-12.288M

The root cause is:

  clk_set_rate(mclk_parent, 49.152M)
  clk_set_rate(mclk, 12.288M)

Prefer to get the mclk rate div from mclk_parent rate, Unfortunately,
the latter will change the mclk_parent rate again in kernel 5.10.

So, do not change mclk parent's rate when it is multiple mclk already,
let clk framework handle it.

e.g.

mclk: clk_i2s1_8ch_tx mclk_parent: clk_i2s_8ch_tx_src

clk_i2s1_8ch_tx_src         0        0        0    12288000
   clk_i2s1_8ch_tx_mux      0        0        0    12288000
      clk_i2s1_8ch_rx       0        0        0    12288000

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ie9e869a48b65e287e60545626e92c9090ab02229
2024-07-23 15:20:51 +08:00
Sugar Zhang
c06d283fd2 ASoC: rockchip: multi-dais: Register PCM before DAI component
API snd_soc_register_component will try to rebind card per
each component register. and the ASoC allow no-pcm card instance.

  devm_snd_soc_register_component
      snd_soc_try_rebind_card
          snd_soc_bind_card
              snd_soc_add_pcm_runtime
  devm_snd_dmaengine_pcm_register

So, we should register PCM before DAI component.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I275e919495280568b6b732097532f466a0cc3a2a
2024-07-23 15:20:51 +08:00
Sugar Zhang
1f1211c186 ASoC: rockchip: spdifrx: Register PCM before DAI component
API snd_soc_register_component will try to rebind card per
each component register. and the ASoC allow no-pcm card instance.

  devm_snd_soc_register_component
      snd_soc_try_rebind_card
          snd_soc_bind_card
              snd_soc_add_pcm_runtime
  devm_snd_dmaengine_pcm_register

So, we should register PCM before DAI component.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I8de05cf709187afd406775998f58ed5ebdb39d38
2024-07-23 15:20:51 +08:00
Sugar Zhang
1564c3cdde ASoC: rockchip: spdif: Register PCM before DAI component
API snd_soc_register_component will try to rebind card per
each component register. and the ASoC allow no-pcm card instance.

  devm_snd_soc_register_component
      snd_soc_try_rebind_card
          snd_soc_bind_card
              snd_soc_add_pcm_runtime
  devm_snd_dmaengine_pcm_register

So, we should register PCM before DAI component.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Id099f4774e040263a370da36427529d45071c173
2024-07-23 15:20:51 +08:00
Sugar Zhang
c1ac114227 ASoC: rockchip: pdm: Register PCM before DAI component
API snd_soc_register_component will try to rebind card per
each component register. and the ASoC allow no-pcm card instance.

  devm_snd_soc_register_component
      snd_soc_try_rebind_card
          snd_soc_bind_card
              snd_soc_add_pcm_runtime
  devm_snd_dmaengine_pcm_register

So, we should register PCM before DAI component.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I0f9f7efd932fc9572c7574aeefb3d61bc5838db2
2024-07-23 15:20:51 +08:00
Sugar Zhang
eb0f1ee27c ASoC: rockchip: i2s: Register PCM before DAI component
API snd_soc_register_component will try to rebind card per
each component register. and the ASoC allow no-pcm card instance.

  devm_snd_soc_register_component
      snd_soc_try_rebind_card
          snd_soc_bind_card
              snd_soc_add_pcm_runtime
  devm_snd_dmaengine_pcm_register

So, we should register PCM before DAI component.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I45ade9943670312be7314604cc7c34c252f515e9
2024-07-23 15:20:51 +08:00
Sugar Zhang
59d3b7b3d7 ASoC: rockchip: sai: Register PCM before DAI component
API snd_soc_register_component will try to rebind card per
each component register. and the ASoC allow no-pcm card instance.

  devm_snd_soc_register_component
      snd_soc_try_rebind_card
          snd_soc_bind_card
              snd_soc_add_pcm_runtime
  devm_snd_dmaengine_pcm_register

So, we should register PCM before DAI component.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Iff41cd4151a5dedb0ae5a45897a86dcccaffb62b
2024-07-23 15:20:51 +08:00
Sugar Zhang
e171dd2bc2 ASoC: rockchip: Add support for Dummy DAI
mainly used for multi-dais as channel map.

e.g.

dummy_dai: dummy-dai {
	compatible = "rockchip,dummy-dai";
	#sound-dai-cells = <0>;
};

multi_dais: multi-dais {
	compatible = "rockchip,multi-dais";
	dais = <&i2s_2ch>,<&dummy_dai> ;
	capture,channel-mapping = <2 2>;
	playback,channel-mapping = <2 0>;
	#sound-dai-cells = <0>;
};

&i2s_2ch {
	rockchip,no-dmaengine;
};

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ie8ead095724ead9ee2995cb1f1640cb57386ad4d
2024-07-23 15:20:51 +08:00
Cai Wenzhong
f4760e0891 media: i2c: maxim: driver version v3.08.00
Signed-off-by: Cai Wenzhong <cwz@rock-chips.com>
Change-Id: Ibec66444cfa38d5f0caca064a5b663b030a430d9
2024-07-23 14:58:53 +08:00
Xuhui Lin
1039ad08c2 ARM: dts: rockchip: rk3506: Set spi0 and spi1 num-cs 2
Change-Id: I9feac67b63564b2469ef6d65a7b8cab6b1154f91
Signed-off-by: Xuhui Lin <xuhui.lin@rock-chips.com>
2024-07-23 14:33:15 +08:00
Jason Zhu
69adc7f1a9 ASoC: codecs: rk3506: set AUDIO_ADC_PGA0 to get better THD performance
Before: THD is -91.34dB.
After: THD is -103.13dB.

Change-Id: Ieaf326326a36ca320effcd924825dce33c5775fc
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2024-07-23 11:44:59 +08:00
Yu Qiaowei
7ac61bc898 video: rockchip: rga3: gauss mode support config alpha
Update driver version to 1.3.5

Change-Id: Icfbbf9c23a71d8aa3c855a15c67afdac13eb6f58
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
2024-07-22 16:27:36 +08:00
Huibin Hong
50e1c583a3 ARM: dts: rockchip: rk3506g-iotest: add regulator for cpu
Change-Id: I8c3fe449c205dddcd4b9b53e81cd42a368df6645
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2024-07-22 16:27:01 +08:00
Huibin Hong
1739101cc3 ARM: dts: rockchip: rk3506g-iotest: support adb
Change-Id: I627fa3b2e9c9bac4f227be1c06e6202e813b1005
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2024-07-22 16:27:01 +08:00
Zain Wang
8caaab4b83 ARM: dts: rockchip: rk3506: Add status "okay" property at queue for gmac
The queue nodes will be deleted if
CONFIG_DTC_OMIT_EMPTY=y, the driver cannot get it, add
status "okay" attributes to avoid deletion.

Change-Id: I5405c85d549289572807a6387fda00f074d7b1aa
Signed-off-by: Zain Wang <wzz@rock-chips.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
2024-07-22 15:16:26 +08:00
Shawn Lin
f1ee82e238 arm64: dts: rockchip: rk3576-evb: Add vcc*-supply for ufs node
Change-Id: I8ecf7cd2c731fdc716c9fd9f3080015d625afc16
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2024-07-22 11:16:39 +08:00
Yao Xiao
7ce18435bc ARM: rk3506_defconfig: Enable WiFi/BT
Before:
   text	   data	    bss	    dec	    hex	filename
4090877	1838576	  97992	6027445	 5bf8b5	vmlinux

After:
   text	   data	    bss	    dec	    hex	filename
4826965	2076636	 104008	7007609	 6aed79	vmlinux

Change-Id: Ie1a185a043dc0444712ac4acbc7c53f5e69dc55c
Signed-off-by: Yao Xiao <xiaoyao@rock-chips.com>
2024-07-22 10:24:27 +08:00
Zain Wang
9ea369f2bd ARM: rk3506_defconfig: use lz4 compression for kernel
Change-Id: Iaeb870fcc97696dbd826bd055970fb1854de8109
Signed-off-by: Zain Wang <wzz@rock-chips.com>
2024-07-19 15:08:52 +08:00
Sandy Huang
ee4d94a9a9 drm/rockchip: vop2: add block size info for fbc format
This can clearly tell user the block size from dump dri summry info or
dump buffer name.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I94f830344e13f2f7c3ac5e4dbde16521caf431dd
2024-07-19 14:58:42 +08:00
Joseph Chen
b0c83cc769 ARM: dts: rockchip: rk3506-evb: Remove vcc0v9-stb regulator
We don't need adjust voltage at runtime, and don't want to
maintain pwm state to keep its voltage in system suspend.

Otherwise it's 0.81v but not 0.90v when system suspend.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia3d0a0901fb0801d8af33f2fd509bab3f2d94a5b
2024-07-19 14:29:45 +08:00
Tao Huang
be9616a9ff ARM: rk3506_defconfig: Enable CONFIG_ROCKCHIP_MINI_KERNEL
-CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
-# CONFIG_STRICT_MODULE_RWX is not set
-CONFIG_VIDEOBUF2_CMA_SG
-CONFIG_VIDEOBUF2_DMA_CONTIG
-CONFIG_VIDEOBUF2_VMALLOC
-CONFIG_VIDEOBUF2_DMA_SG
-CONFIG_DRM_EDID
-CONFIG_DRM_DP
-CONFIG_ROCKCHIP_DRM_DEBUG
-CONFIG_SND_PCM_ELD
-CONFIG_SND_SOC_HDMI_CODEC

+CONFIG_DTC_OMIT_DISABLED=y
+CONFIG_DTC_OMIT_EMPTY=y
+CONFIG_MMC_QUEUE_DEPTH=1

before:
   text	   data	    bss	    dec	    hex	filename
4113328	1882232	  96904	6092464	 5cf6b0	vmlinux

after:
   text	   data	    bss	    dec	    hex	filename
4090837	1838576	  97992	6027405	 5bf88d	vmlinux

Change-Id: Ie247122d435f7da79081b034822355f45f217f3f
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2024-07-18 16:24:46 +08:00
Jianwei Zheng
f048e9102d ARM: dts: rockchip: rk3506g-test1-v10-audio: Add extcon for usb
1. Add extcon usb vbus_det/id gpios for otg0.
2. Fix the vbus control gpio for otg0.
3. Add vbus control gpio for otg1.
4. Set host mode for otg1.

Change-Id: Ia075889449559539c7a2e41a3c50e2b928a46ad0
Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
2024-07-18 10:11:52 +08:00
Sugar Zhang
1cf81ee6b9 ARM: dts: rk3506g-evb1-v10: Enable es8388-sound
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I1836d10b674a908efdd062d2e4472f762ab303af
2024-07-18 10:11:52 +08:00
Zefa Chen
ea58eb40b7 ARM: dts: rockchip: add flexbus cif for rk3506 evb1
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I43fbf4beeb184e3fc3093f6e113cca551479e776
2024-07-18 10:11:52 +08:00
Huibin Hong
565a719e03 ARM: dts: rockchip: rk3506-evb1: add ramoops
Change-Id: I02bc9343d060e4d4b1bb48f10dba572a6b1866c2
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2024-07-18 10:11:52 +08:00
Jason Zhu
492fbe5004 ARM: dts: rockchip: rk3506g-test1: add pdm_mic_array sound card with es7202
Change-Id: I34585bfbe48b748d0eff5212e4e93f15cf50c5b6
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2024-07-18 10:11:51 +08:00
ZiHan Huang
830a37fb67 ARM: dts: rockchip: rk3506-evb1: Additional reservation cma buf
Change-Id: Idd169c243f898986d9b14a813a4f9b31c1811f2b
Signed-off-by: ZiHan Huang <zack.huang@rock-chips.com>
2024-07-18 10:11:51 +08:00
Hongming Zou
cdff835f97 ARM: dts: rockchip: rk3506g-evb1: enable logo display for mipi board
Change-Id: I50dcc7e86869008eff24f3e20da55fc12c19ac3d
Signed-off-by: Hongming Zou <hongming.zou@rock-chips.com>
2024-07-18 10:11:51 +08:00
Jianwei Zheng
325f365207 ARM: dts: rockchip: Support usb2phy for rk3506g-evb1
This patch enable usb2phy for rk3506g-evb1 and support
to use extcon usb gpio driver for usb2phy vbus and id
detection.

Change-Id: I389cf3801a302ff70b1db673803472e493888294
Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
2024-07-18 10:11:51 +08:00
William Wu
0bbcfa2c12 ARM: dts: rockchip: rk3506-evb1-v10: Enable usb2 phy
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I5ab6698176c18a747ccc9d415b3579c564f25ed0
2024-07-18 10:11:51 +08:00
Cliff Chen
33ab8bc7b3 ARM: dts: rockchip: Add rk3506-amp.dtsi
Change-Id: Iaf7f31e72988f5326c60a915e5b0db7305598250
Signed-off-by: Cliff Chen <cliff.chen@rock-chips.com>
2024-07-18 10:11:51 +08:00
Lin Jinhan
a63ddd3753 ARM: dts: rk3506-evb1-v10: enable rng node
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I259d11700cf1f5097d3c2d2e0c3a19661f5ed97f
2024-07-18 10:11:51 +08:00
Damon Ding
297d9a4773 ARM: dts: rockchip: rk3506-evb1: add reserved-memory for display and drm_logo memory config
Change-Id: I9cb948f2cdddc29ead70cd2045824a44d8566e2e
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
2024-07-18 10:11:51 +08:00
Sugar Zhang
fd5c38840a ARM: dts: rockchip: Add rk3506g-test1-v10 audio board
Depends on CONFIG_I2C_GPIO

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: If90642c916012daf6079a452bf453b53f5ca5599
2024-07-18 10:11:51 +08:00
Jon Lin
2a394dfc97 ARM: dts: rk3506-evb1-v10: Add FLEXBUS fspi node
Change-Id: I3face3b49a98c5e0fd0ef64ed6d0837224c52b4a
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2024-07-18 10:11:51 +08:00
Jason Zhu
381e81b0c3 ARM: dts: rk3503-evb1: enable dsm_sound card
Change-Id: I4c38f51f566b68fca2c831e9389be4ca5154488f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2024-07-18 10:11:51 +08:00
Yu Qiaowei
2837e8e60d ARM: dts: rk3506-evb1-v10: enable RGA node
Change-Id: I8fd1d6fe00b37b240045857301e260d31ff71f40
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
2024-07-18 10:11:51 +08:00
Jason Zhu
f3b2b42991 ARM: dts: rk3506-evb1: add dsm_sound/acodec_sound card node
Change-Id: I968c8bf89ef72a0085eae969819a2f3872d0ea89
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2024-07-18 10:11:51 +08:00