I’m not able to make SD card reader to detected SD cards after system is booted. Card is detected during boot-up, but after boot up I’m not able to detect is it taken off sdcard slot or not. I configured card detect pin in linux kernel device tree:
mmc@3400000 {
status = "okay";
bus-width = <4>;
cd-gpios = <&gpio TEGRA234_MAIN_GPIO(G, 7) GPIO_ACTIVE_LOW>;
disable-wp;
};
I tried to add G7 pin to gpio as input:
/ {
gpio@2200000 {
gpio-init-names = "default";
gpio-init-0 = <&gpio_main_default>;
gpio_main_default: default {
gpio-input = <
TEGRA234_MAIN_GPIO(B, 0)
TEGRA234_MAIN_GPIO(P, 4)
TEGRA234_MAIN_GPIO(Q, 7)
TEGRA234_MAIN_GPIO(R, 1)
TEGRA234_MAIN_GPIO(N, 4)
TEGRA234_MAIN_GPIO(M, 3)
TEGRA234_MAIN_GPIO(M, 5)
TEGRA234_MAIN_GPIO(M, 6)
TEGRA234_MAIN_GPIO(N, 1)
TEGRA234_MAIN_GPIO(G, 0)
TEGRA234_MAIN_GPIO(G, 1)
TEGRA234_MAIN_GPIO(G, 2)
TEGRA234_MAIN_GPIO(G, 4)
TEGRA234_MAIN_GPIO(G, 7)
TEGRA234_MAIN_GPIO(H, 0)
TEGRA234_MAIN_GPIO(AC, 4)
TEGRA234_MAIN_GPIO(AC, 5)
TEGRA234_MAIN_GPIO(AC, 7)
TEGRA234_MAIN_GPIO(AE, 0)
TEGRA234_MAIN_GPIO(AE, 1)
TEGRA234_MAIN_GPIO(K, 0)
TEGRA234_MAIN_GPIO(K, 1)
TEGRA234_MAIN_GPIO(L, 2)
TEGRA234_MAIN_GPIO(L, 3)
>;
I tested few combinations with pinmux:
soc_gpio20_pg7 {
nvidia,pins = "soc_gpio20_pg7";
nvidia,function = "sdmmc1";
nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
nvidia,tristate = <TEGRA_PIN_ENABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
soc_gpio20_pg7 {
nvidia,pins = "soc_gpio20_pg7";
nvidia,function = "rsvd0";
nvidia,pull = <TEGRA_PIN_PULL_UP>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
I tried pinmux and gpio generated from orin excel, but even with it, I’m not able to hotplug sdcard. I’m only able to detected SDcard during boot.
Schematics: