From 3e396a0fffe6287ef471d865035b5e7220fe0983 Mon Sep 17 00:00:00 2001 From: Jun Zeng Date: Fri, 24 Nov 2023 17:53:44 +0800 Subject: [PATCH 1/6] arm64: dts: rockchip: rk3588-vehicle-evb: use a spi-codec driver for the remote adsp Change to use a spi-codec driver for the remote adsp, instead of the old dummy codec driver. Change-Id: I44a41dbdfe8a7489cc94d9a8f83a5b5f0d99a4c8 Signed-off-by: Jun Zeng --- .../dts/rockchip/rk3588-vehicle-evb-v20.dtsi | 27 ++++++++++++------- .../dts/rockchip/rk3588-vehicle-evb-v21.dtsi | 27 ++++++++++++------- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-vehicle-evb-v20.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-vehicle-evb-v20.dtsi index 9534104fb57d..d5621243346a 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-vehicle-evb-v20.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588-vehicle-evb-v20.dtsi @@ -118,14 +118,6 @@ status = "okay"; }; - dummy_codec: dummy-codec { - status = "okay"; - compatible = "rockchip,dummy-codec"; - #sound-dai-cells = <0>; - pinctrl-names = "default"; - pinctrl-0 = <&rk3308_reset>; - }; - car_rk3308_sound: car-rk3308-sound { status = "okay"; compatible = "simple-audio-card"; @@ -140,7 +132,7 @@ dai-tdm-slot-width = <32>; }; codec_master: simple-audio-card,codec { - sound-dai = <&dummy_codec>; + sound-dai = <&spi_codec>; }; }; }; @@ -326,6 +318,23 @@ status = "disabled"; }; +&spi4 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&spi4m0_cs1 &spi4m0_pins>; + + spi_codec: spi-codec@1 { + compatible ="rockchip,spi-codec"; + reg = <1>; + spi-lsb-first; + spi-max-frequency = <5000000>; + #sound-dai-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&rk3308_reset>; + status = "okay"; + }; +}; + &uart9 { status = "okay"; pinctrl-names = "default"; diff --git a/arch/arm64/boot/dts/rockchip/rk3588-vehicle-evb-v21.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-vehicle-evb-v21.dtsi index d53b247f8bb9..3624b81976c2 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-vehicle-evb-v21.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588-vehicle-evb-v21.dtsi @@ -130,14 +130,6 @@ status = "okay"; }; - dummy_codec: dummy-codec { - status = "okay"; - compatible = "rockchip,dummy-codec"; - #sound-dai-cells = <0>; - pinctrl-names = "default"; - pinctrl-0 = <&rk3308_reset>; - }; - car_rk3308_sound: car-rk3308-sound { status = "okay"; compatible = "simple-audio-card"; @@ -152,7 +144,7 @@ dai-tdm-slot-width = <32>; }; codec_master: simple-audio-card,codec { - sound-dai = <&dummy_codec>; + sound-dai = <&spi_codec>; }; }; }; @@ -339,6 +331,23 @@ status = "disabled"; }; +&spi4 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&spi4m0_cs1 &spi4m0_pins>; + + spi_codec: spi-codec@1 { + compatible ="rockchip,spi-codec"; + reg = <1>; + spi-lsb-first; + spi-max-frequency = <5000000>; + #sound-dai-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&rk3308_reset>; + status = "okay"; + }; +}; + &uart7 { /delete-property/ dmas; status = "okay"; From 6834fefbb4fff8bd21ef27b98dd2b5802eb8c4c9 Mon Sep 17 00:00:00 2001 From: Jianqun Xu Date: Fri, 1 Dec 2023 18:23:56 +0800 Subject: [PATCH 2/6] arm64: configs: rockchip_defconfig: enable CONFIG_SND_SOC_ROCKCHIP_SPI_CODEC The RK3588M car audio product uses spi codec Change-Id: Ibba1affd44ba86a223690a15b5296ae8fe93ccc4 Signed-off-by: Jianqun Xu --- arch/arm64/configs/rockchip_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/rockchip_defconfig b/arch/arm64/configs/rockchip_defconfig index 65258a5b38b0..28340b4bdfae 100644 --- a/arch/arm64/configs/rockchip_defconfig +++ b/arch/arm64/configs/rockchip_defconfig @@ -726,6 +726,7 @@ CONFIG_SND_SOC_RK3528=y CONFIG_SND_SOC_RK817=y CONFIG_SND_SOC_RK_CODEC_DIGITAL=y CONFIG_SND_SOC_RK_DSM=y +CONFIG_SND_SOC_ROCKCHIP_SPI_CODEC=y CONFIG_SND_SOC_RT5640=y CONFIG_SND_SOC_RT5651=y CONFIG_SND_SOC_SPDIF=y From 41a3bd108adf28ee417689c9f075720153596d5b Mon Sep 17 00:00:00 2001 From: Jon Lin Date: Thu, 7 Dec 2023 10:41:40 +0800 Subject: [PATCH 3/6] spi: rockchip: Support DMA burst 16 Change-Id: Ic8b6c0284158d034c3d5ce36810b69588b4b13a2 Signed-off-by: Jon Lin --- drivers/spi/spi-rockchip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index ff62a171da0f..324933450b42 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -478,8 +478,8 @@ static u32 rockchip_spi_calc_burst_size(u32 data_len) { u32 i; - /* burst size: 1, 2, 4, 8 */ - for (i = 1; i < 8; i <<= 1) { + /* burst size: 1, 2, 4, 8, 16 */ + for (i = 1; i < 16; i <<= 1) { if (data_len & i) break; } From a3a960756568e8e390744a6bbe3336d2a0794591 Mon Sep 17 00:00:00 2001 From: Wu Liangqing Date: Fri, 8 Dec 2023 10:00:26 +0000 Subject: [PATCH 4/6] arm64: dts: rockchip: px30-android: add debug support Change-Id: Id36e08c0e5c946b27440c3e841912dfd82b6ec19 Signed-off-by: Wu Liangqing --- arch/arm64/boot/dts/rockchip/px30-android.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/px30-android.dtsi b/arch/arm64/boot/dts/rockchip/px30-android.dtsi index ba3620b9c124..017a17017679 100644 --- a/arch/arm64/boot/dts/rockchip/px30-android.dtsi +++ b/arch/arm64/boot/dts/rockchip/px30-android.dtsi @@ -9,6 +9,14 @@ bootargs = "earlycon=uart8250,mmio32,0xff160000 console=ttyFIQ0 init=/init kpti=0"; }; + debug: debug@ff690000 { + compatible = "rockchip,debug"; + reg = <0x0 0xff690000 0x0 0x1000>, + <0x0 0xff692000 0x0 0x1000>, + <0x0 0xff694000 0x0 0x1000>, + <0x0 0xff696000 0x0 0x1000>; + }; + fiq-debugger { compatible = "rockchip,fiq-debugger"; rockchip,serial-id = <2>; From 71928f92e61e4ecb218fb3e7c3db768418f66fd0 Mon Sep 17 00:00:00 2001 From: Chaoyi Chen Date: Fri, 8 Dec 2023 11:23:48 +0800 Subject: [PATCH 5/6] drm/rockchip: vop: correct RK3288/RK3399 VOP WIN register fields In RK3288/RK3399, there is a problem with the definition of the `fmt_10` field in the VOP WIN register. The original `fmt_10` definition conflicts with the `lb_mode` definition. This will cause the `lb_mode` function to be affected, there may be problems with incorrect colors displayed, incorrect window sizes, image flickering, etc. This patch correct `fmt_10` field to the expected value in TRM. Change-Id: I0f9f23c459dc5870532e28b74053a9b4dc606de0 Signed-off-by: Chaoyi Chen --- drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c index 7c632677ce6d..069cb6e7aef9 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c @@ -185,7 +185,7 @@ static const struct vop_win_phy rk3288_win01_data = { .nformats = ARRAY_SIZE(formats_win_full_10bit), .enable = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 0), .format = VOP_REG(RK3288_WIN0_CTRL0, 0x7, 1), - .fmt_10 = VOP_REG(RK3288_WIN0_CTRL0, 0x7, 4), + .fmt_10 = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 4), .csc_mode = VOP_REG_VER(RK3288_WIN0_CTRL0, 0x3, 10, 3, 2, -1), .rb_swap = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 12), .xmirror = VOP_REG_VER(RK3368_WIN0_CTRL0, 0x1, 21, 3, 2, -1), @@ -669,7 +669,7 @@ static const struct vop_win_phy rk3399_win01_data = { .nformats = ARRAY_SIZE(formats_win_full_10bit_yuyv), .enable = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 0), .format = VOP_REG(RK3288_WIN0_CTRL0, 0x7, 1), - .fmt_10 = VOP_REG(RK3288_WIN0_CTRL0, 0x7, 4), + .fmt_10 = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 4), .fmt_yuyv = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 17), .csc_mode = VOP_REG_VER(RK3288_WIN0_CTRL0, 0x3, 10, 3, 2, -1), .rb_swap = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 12), From 542f25b9ec2f03cf1f4ea5f0556430ab26934924 Mon Sep 17 00:00:00 2001 From: Finley Xiao Date: Mon, 11 Dec 2023 21:20:11 +0800 Subject: [PATCH 6/6] Revert "dt-bindings: add binding document for Rockchip cpu avs" Remove unused file. This reverts commit 21b5ccaf8513b2214b894399dff8e9decb4025cf. Change-Id: I01d5c35e03b6b346c8361ce92301e99459d07ab3 Signed-off-by: Finley Xiao --- .../bindings/power/rockchip-cpu-avs.txt | 50 ------------------- 1 file changed, 50 deletions(-) delete mode 100644 Documentation/devicetree/bindings/power/rockchip-cpu-avs.txt diff --git a/Documentation/devicetree/bindings/power/rockchip-cpu-avs.txt b/Documentation/devicetree/bindings/power/rockchip-cpu-avs.txt deleted file mode 100644 index 25ba862ae0e8..000000000000 --- a/Documentation/devicetree/bindings/power/rockchip-cpu-avs.txt +++ /dev/null @@ -1,50 +0,0 @@ -Rockchip cpu avs device tree bindings -------------------------------------- - -Under the same frequency, the operating voltage tends to decrease with -increasing leakage. so it is necessary to adjust opp's voltage according -to leakage for power. - - -Required properties: -- cluster-id: At runtime, the platform can find a cpu's cluster_id - according to it's cpu_id and match cluster-id property. -- min-volt: The minimum voltage in uV. Even though opp's voltage will be - adjusted, it must be bigger than or equal to the minimum. -- min-freq: The minimum frequency in KHz. If an opp's frequency is bigger - than or equal to the minimum, its volatge will be adjusted. -- leakage-adjust-volt: The property is an array of 3-tuples items, and - each item consists of leakage and voltage like - . - min-leakage: minimum leakage in mA, ranges from 0 to 254. - max-leakage: maximum leakage in mA, ranges from 0 to 254. - volt: voltage offset in uV to apply to the opp table entries. -- nvmem-cells: A phandle to the leakage data provided by efuse. -- nvmem-cell-names: Should be "cpu_leakage". - -Example: - - cpu_avs: cpu-avs { - cluster0-avs { - cluster-id = <0>; - min-volt = <800000>; /* uV */ - min-freq = <408000>; /* KHz */ - leakage-adjust-volt = < - /* mA mA uV */ - 0 254 0 - >; - nvmem-cells = <&cpul_leakage>; - nvmem-cell-names = "cpu_leakage"; - }; - cluster1-avs { - cluster-id = <1>; - min-volt = <800000>; /* uV */ - min-freq = <408000>; /* KHz */ - leakage-adjust-volt = < - /* mA mA uV */ - 0 254 0 - >; - nvmem-cells = <&cpub_leakage>; - nvmem-cell-names = "cpu_leakage"; - }; - };