arm64: dts: rockchip: Fix rk3399-roc-pc-plus analog audio
Subsystems (3)
PATCH 1/3 arm64: dts: rockchip: Fix rk3399-roc-pc-plus analog audio
From: Fabio Estevam <[email protected]>
The ES8388 sound card on the rk3399-roc-pc-plus fails to probe because i2s1 cannot claim its MCLK pin:
pinctrl: pin gpio4-0 already requested by ff880000.i2s; cannot claim for ff890000.i2s
pinctrl: error -EINVAL: pin-128 (ff890000.i2s)
pinctrl: error -EINVAL: could not request pin 128 (gpio4-0) from group i2s-8ch-mclk-pin on device rockchip-pinctrl
GPIO4_A0 is routed as SCLK_I2S_8CH_OUT and is used by i2s1 as the external MCLK for the ES8388 codec. The board dts already removes GPIO4_A0 from the i2s0_8ch_bus pin group, but i2s0 still claims the same pin through its bclk_off state.
Since the i2s driver requests both states, this blocks i2s1 pinctrl setup and leaves the simple-audio-card deferred with a parse error.
Override i2s0_8ch_bus_bclk_off as well, matching the existing i2s0_8ch_bus override, so GPIO4_A0 is left for i2s1/ES8388 audio.
--- arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts +12 -0
@@ -136,6 +136,18 @@ &i2s0_8ch_bus { <3 RK_PD7 1 &pcfg_pull_none>; }; +&i2s0_8ch_bus_bclk_off { + rockchip,pins = + <3 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>, + <3 RK_PD1 1 &pcfg_pull_none>, + <3 RK_PD2 1 &pcfg_pull_none>, + <3 RK_PD3 1 &pcfg_pull_none>, + <3 RK_PD4 1 &pcfg_pull_none>, + <3 RK_PD5 1 &pcfg_pull_none>, + <3 RK_PD6 1 &pcfg_pull_none>, + <3 RK_PD7 1 &pcfg_pull_none>; +}; + &i2s1 { pinctrl-names = "default"; pinctrl-0 = <&i2s_8ch_mclk_pin>, <&i2s1_2ch_bus>;
Signature · 1 line
2.43.0
PATCH 2/3 arm64: dts: rockchip: Enable wireless on rk3399-roc-pc-plus
From: Fabio Estevam <[email protected]>
The rk3399-roc-pc-plus board has an Ampak AP6256 Wi-Fi/Bluetooth module.
Describe the Wi-Fi function on SDIO0 and the Bluetooth function on UART0. Add the Bluetooth wake and shutdown pinctrl entries, enable SDIO0 as a non-removable SDIO device, and add the power sequencing delays needed by the module.
The module uses the RK808 CLKOUT2 output as its 32 kHz low-power clock. Drop the duplicate HYM8563 clock-output-names property and remove the same clock from the SDIO power sequencer so the Bluetooth node can request the shared LPO clock directly.
--- .../boot/dts/rockchip/rk3399-roc-pc-plus.dts | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts +51 -0
@@ -123,6 +123,10 @@ es8388: es8388@11 { }; }; +&hym8563 { + /delete-property/ clock-output-names; +}; + /* <4 RK_PA0 1 &pcfg_pull_none> is used as i2s_8ch_mclk_pin */ &i2s0_8ch_bus { rockchip,pins =
@@ -157,6 +161,20 @@ &i2s1 { }; &pinctrl { + bt { + bt_enable_h: bt-enable-h { + rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + bt_host_wake_l: bt-host-wake-l { + rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + bt_wake_l: bt-wake-l { + rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + es8388 { ear_ctl_pin: ear-ctl-pin { rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_output_high>;
@@ -180,6 +198,28 @@ i2s_8ch_mclk_pin: i2s-8ch-mclk-pin { }; }; +&sdio_pwrseq { + /delete-property/ clocks; + /delete-property/ clock-names; + post-power-on-delay-ms = <100>; + power-off-delay-us = <500000>; +}; + +&sdio0 { + #address-cells = <1>; + #size-cells = <0>; + bus-width = <4>; + cap-sd-highspeed; + cap-sdio-irq; + keep-power-in-suspend; + mmc-pwrseq = <&sdio_pwrseq>; + non-removable; + pinctrl-names = "default"; + pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>; + sd-uhs-sdr104; + status = "okay"; +}; + &u2phy0 { status = "okay";
@@ -212,6 +252,17 @@ &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>; status = "okay"; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + clocks = <&rk808 1>; + clock-names = "lpo"; + device-wakeup-gpios = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>; + host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>; + shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>; + }; }; &usbdrd_dwc3_0 {
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH 2/3] arm64: dts: rockchip: Enable wireless on rk3399-roc-pc-plus
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] Removing the shared 32kHz LPO clock from the SDIO power sequencer breaks Wi-Fi initialization when…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Removing the shared 32kHz LPO clock from the SDIO power sequencer breaks Wi-Fi initialization when Bluetooth is disabled or probes later. --
--- Patch [2]: [PATCH 2/3] arm64: dts: rockchip: Enable wireless on rk3399-roc-pc-plus --- commit d6496a6030e5f440c56fb715094eff4f9078ed81
Author: Fabio Estevam <[email protected]>
arm64: dts: rockchip: Enable wireless on rk3399-roc-pc-plus
This commit enables the Ampak AP6256 Wi-Fi/Bluetooth module on the rk3399-roc-pc-plus board. It describes the SDIO and UART interfaces, adds power sequencing delays, and removes the clock from the SDIO power sequencer to allow the Bluetooth node to request it directly.
Quoted 4 lines
arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts +0
-0
[ ... ]
arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts i2s_8ch_mclk_pin: i2s-8ch-mclk-pin { · line 203
Quoted 7 lines
arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts +3
-0@@ -180,6 +198,28 @@ i2s_8ch_mclk_pin: i2s-8ch-mclk-pin { }; }; +&sdio_pwrseq { + /delete-property/ clocks; + /delete-property/ clock-names;
[Severity: High]
Will removing the shared 32kHz LPO clock from the SDIO power sequencer break Wi-Fi initialization when Bluetooth is disabled or probes later?
If the MMC/SDIO subsystem initiates its power-on sequence before the Bluetooth driver probes, or if Bluetooth is disabled, the LPO clock will not be enabled. Without this clock, the Wi-Fi module cannot start its state machine and will fail to respond to the initial CMD5 enumeration from the MMC core.
Additionally, if Bluetooth enters runtime suspend and gates the clock, could this crash the active Wi-Fi firmware?
Quoted 3 lines
arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts +3
-0+ post-power-on-delay-ms = <100>; + power-off-delay-us = <500000>; +};
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
PATCH 3/3 arm64: dts: rockchip: Keep rk3399-roc-pc-plus work LED on
In reply to Fabio EstevamFrom: Fabio Estevam <[email protected]>
The rk3399-roc-pc-plus inherits the work LED heartbeat trigger from the common rk3399-roc-pc.dtsi.
On the rk3399-roc-pc-plus this LED is the prominent blue front-panel status LED. Blinking it continuously is distracting for a PC-style board. The usual default is a steady power/status indication while the system is running.
Use the default-on trigger for this board instead. This keeps the LED useful as a simple running indicator and still lets userspace select a different trigger or turn it off after boot.
--- arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts +4 -0
@@ -93,6 +93,10 @@ leds { }; }; +&work_led { + linux,default-trigger = "default-on"; +}; + &fusb0 { vbus-supply = <&vcc_vbus_typec1>; };
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH 3/3] arm64: dts: rockchip: Keep rk3399-roc-pc-plus work LED on
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The commit message describes the work LED as a "prominent blue front-panel status LED", but the…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message describes the work LED as a "prominent blue front-panel status LED", but the patch fails to override the inherited "green:work" label, resulting in a code and commit message mismatch. --
--- Patch [3]: [PATCH 3/3] arm64: dts: rockchip: Keep rk3399-roc-pc-plus work LED on --- commit 7bd9a09829c15f03ac88e155bb13da9235dada8c
Author: Fabio Estevam <[email protected]>
arm64: dts: rockchip: Keep rk3399-roc-pc-plus work LED on
This commit overrides the default LED trigger for the rk3399-roc-pc-plus work LED to default-on. It changes the behavior from a distracting continuous blink to a steady status indication.
arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts leds { · line 98
Quoted 11 lines
arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts +3
-0@@ -93,6 +93,10 @@ leds { }; }; +&work_led { + linux,default-trigger = "default-on"; +};
[Severity: Medium]
The commit message mentions this is the prominent blue front-panel status LED. Since the board inherits from rk3399-roc-pc.dtsi where the work LED is typically configured with the green:work label, does this node also need a color or label override?
If the inherited label is not overridden here, the sysfs interface might misrepresent the physical blue LED as green, causing a mismatch between the commit message's description and the resulting device tree.
Quoted 4 lines
arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts +1
-0+ &fusb0 { vbus-supply = <&vcc_vbus_typec1>; };
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
Quoted 9 lines · Fabio Estevam
The ES8388 sound card on the rk3399-roc-pc-plus fails to probe because i2s1 cannot claim its MCLK pin:
pinctrl: pin gpio4-0 already requested by ff880000.i2s; cannot claim for ff890000.i2s
pinctrl: error-EINVAL: pin-128 (ff890000.i2s)
pinctrl: error-EINVAL: could not request pin 128 (gpio4-0) from group i2s-8ch-mclk-pin on device rockchip-pinctrl[...]
Applied, thanks!
[1/3] arm64: dts: rockchip: Fix rk3399-roc-pc-plus analog audio
commit: 4f7259ebe1eba4778768a4f5a0bbbe439d10f3f3
[2/3] arm64: dts: rockchip: Enable wireless on rk3399-roc-pc-plus
commit: 2dfc88c13fb2db7f17c55f16b679cdfe4ded19c5
[3/3] arm64: dts: rockchip: Keep rk3399-roc-pc-plus work LED on
commit: b2007873ddfff223bb680c7ff60eaf675670f07aBest regards,
Signature · 1 line
Heiko Stuebner <[email protected]>