[PATCH] arm64: dts: rockchip: Add CD GPIO to Orange Pi 5/5B/5Pro

Dang Huynh dang.huynh at mainlining.org
Fri Nov 27 22:18:14 PST 2026


Hi Quentin,

On Thu, Nov 26, 2026 at 10:56:12AM +0100, Quentin Schulz wrote:
> Hi Dang,
> 
> On 11/21/26 8:03 AM, Dang Huynh wrote:
> > CD GPIO is currently not defined in Orange Pi 5, this breaks
> > SD card hotplugging.
> 
> That's not the issue. The issue is that the card detect signal is muxed in
> the SDMMC_DET function (c.f. sdmmc_det in rk3588-base.dtsi) and that relies
> on the SDMMC controller being powered on to detect such an event. This
> cannot work when the controller is in runtime suspend, so we have a chicken
> and the egg problem. The card detect should resume the controller, but it
> can only work when the controller is running. Hence why we now go for the
> gpio function (via cd-gpios) instead. See
> c7a9549ce46e ("arm64: dts: rockchip: Switch microSD card detect to gpio on
> Radxa ROCK 5 ITX/5C") for an example.
Interesting, I didn't know that the controller could do that. You learn
something new every day I guess.

> > diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtsi
> > index 2db6ee95e504..8fbb0ba19b74 100644
> > --- a/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtsi
> > +++ b/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtsi
> > @@ -282,6 +282,7 @@ &sdhci {
> >   &sdmmc {
> >   	bus-width = <4>;
> >   	cap-sd-highspeed;
> > +	cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
> 
> issue: missing pinmuxing
> 
> You need to configure the pinmux and pinconf for this pin (via pinctrl-0 and
> we require repeating pinctrl-names wherever pinctrl-0 is modified).
pinmux/pinconf is already defined in rk3588-base-pinctrl.dtsi for this
exact GPIO. I guess this is in case when controller's card detect works?

> 
> Cheers,
> Quentin

Best regards,
Dang



More information about the Linux-rockchip mailing list