Re: [RFC] arm64: dts: rockchip: rk3576-lckfb-tspi-3m: sdmmc0_det_l question
From: Alexey Charkov
Date: Sun Nov 22 2026 - 01:01:24 EST
On Sun, Nov 22, 2026 at 9:51 AM <220110626hanxuechao@xxxxxxxxxxxxxx> wrote:
>
> Hi Heiko, Liu Changjie,
>
> I have a question about the SD card detect configuration of the LCKFB
> Taishan Pi 3M.
>
> The &sdmmc node uses the board-specific sdmmc0_det_l group:
>
> sdmmc {
> sdmmc0_det_l: sdmmc0-det-l {
> rockchip,pins = <0 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>;
> };
> };
>
> which muxes GPIO0_A7 as a GPIO, matching
>
> cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
>
> The SoC dtsi already provides sdmmc0_det for the same pin, using the
> SDMMC0_DETn function instead:
>
> sdmmc0_det: sdmmc0-det {
> rockchip,pins = <0 RK_PA7 1 &pcfg_pull_up>;
> };
>
> and other RK3576 boards use it together with cd-gpios, for example
> rk3576-evb1-v10.dts and rk3576-evb2-v10.dts. Both groups configure the
> same pin with the same pull-up; only the pin function differs.
>
> I tested the node below on a Taishan Pi 3M with mainline v7.4-rc2,
> i.e. with sdmmc0_det instead of sdmmc0_det_l and cd-gpios unchanged,
> and card insertion and removal are still detected correctly:
>
> &sdmmc {
> bus-width = <4>;
> cap-sd-highspeed;
> cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
Here you've just used your pin in the GPIO function without
configuring its mux into GPIO. This happens to work in Linux due to
how its GPIO and pinctrl subsystems are wired, but it's not a correct
description of the hardware and is likely to break under other OSes.
E.g. U-Boot doesn't implicitly re-mux the pins used as GPIOs and would
be likely to break.
On a more general point, the reason to use GPIO for card detection on
Rockchip boards is to allow the controller to sleep with its clocks
down when no card is inserted. It cannot detect card insertion via its
"native" CD pin mode in such a case, but GPIO can.
Best regards,
Alexey