Skip to contentSkip to conversation

Support UART over MicroSD slot on Transformer T20

PATCH In review Artur Kowalski 2 participants 13 messages Mar 30, 2025 – Apr 22, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover Support UART over MicroSD slot on Transformer T20

v2 no longer forces UARTA to SDB/SDD on Transformer 20. Instead CONFIG_TEGRA_UARTA_MICROSD is used for this purpose. Additionally, user does not needs to configure additional DT files as that is handled internally with preprocessor directives.

Changes in v2:
- fixed indentation of preprocessor directives
- added TEGRA_UARTA_MICROSD Kconfig option
- removed .dtsi for enabling UART over microSD
- modified transformer DT to use UARTA and correct pinmux when TEGRA_UARTA_MICROSD is enabled; it is enough to flip a single switch to enable/disable UART over microSD

Artur Kowalski (3):
tegra: add funcmux for exposing UART over uSD slot on Tegra 20
tegra: respect CONFIG_TEGRA_ENABLE_UART* options on Transformer T20
tegra: allow to expose UART on microSD slot

 arch/arm/dts/tegra20-asus-transformer.dtsi  | 24 +++++++++++++++++++++
 arch/arm/include/asm/arch-tegra20/funcmux.h |  1 +
 arch/arm/mach-tegra/board.c                 |  2 ++
 arch/arm/mach-tegra/tegra20/Kconfig         | 18 ++++++++++++++++
 drivers/pinctrl/tegra/funcmux-tegra20.c     |  9 +++++++-
 include/configs/transformer-t20.h           | 10 +++++++++
 6 files changed, 63 insertions(+), 1 deletion(-)
Signature · 1 line
2.48.1
#1 lore raw

PATCH v2 1/3 tegra: add funcmux for exposing UART over uSD slot on Tegra 20

UART-A can be exposed through uSD, this was tested on Transformer T20 but should work on all Ventana-based boards.

TX is exported on SDD pingroup corresponding to uSD CLK pin RX is exported on SDB which is CMD pin in uSD slot

---

Changes in v2:
- fixed indentation of preprocessor directives

 arch/arm/include/asm/arch-tegra20/funcmux.h | 1 +
 arch/arm/mach-tegra/board.c                 | 2 ++
 arch/arm/mach-tegra/tegra20/Kconfig         | 3 +++
 drivers/pinctrl/tegra/funcmux-tegra20.c     | 9 ++++++++-
 4 files changed, 14 insertions(+), 1 deletion(-)
arch/arm/include/asm/arch-tegra20/funcmux.h +1 -0
index e9e96c1f933..bafcf857620 100644
@@ -19,6 +19,7 @@ enum {
 	FUNCMUX_UART1_UAA_UAB,
 	FUNCMUX_UART1_GPU,
 	FUNCMUX_UART1_SDIO1,
+	FUNCMUX_UART1_SDB_SDD,
 	FUNCMUX_UART2_UAD = 0,
 	FUNCMUX_UART4_GMC = 0,
 
arch/arm/mach-tegra/board.c +2 -0
index 7ca56a3b081..7597034fa48 100644
@@ -169,6 +169,8 @@ static int uart_configs[] = {
 	FUNCMUX_UART1_GPU,
  #elif defined(CONFIG_TEGRA_UARTA_SDIO1)
 	FUNCMUX_UART1_SDIO1,
+ #elif defined(CONFIG_TEGRA_UARTA_SDB_SDD)
+	FUNCMUX_UART1_SDB_SDD,
  #else
 	FUNCMUX_UART1_IRRX_IRTX,
 #endif
arch/arm/mach-tegra/tegra20/Kconfig +3 -0
index e2735d93e28..3349f1e2786 100644
@@ -17,6 +17,9 @@ config TEGRA_UARTA_GPU
 config TEGRA_UARTA_SDIO1
 	bool
 
+config TEGRA_UARTA_SDB_SDD
+	bool
+
 choice
 	prompt "Tegra20 board select"
 	optional
drivers/pinctrl/tegra/funcmux-tegra20.c +8 -1
index 951ae196161..f60d5aad3a4 100644
@@ -62,8 +62,15 @@ int funcmux_select(enum periph_id id, int config)
 			pinmux_tristate_disable(PMUX_PINGRP_SDIO1);
 			bad_config = 0;
 			break;
+		case FUNCMUX_UART1_SDB_SDD:
+			pinmux_set_func(PMUX_PINGRP_SDB, PMUX_FUNC_UARTA);
+			pinmux_set_func(PMUX_PINGRP_SDD, PMUX_FUNC_UARTA);
+			pinmux_tristate_disable(PMUX_PINGRP_SDB);
+			pinmux_tristate_disable(PMUX_PINGRP_SDD);
+			bad_config = 0;
+			break;
 		}
-		if (!bad_config) {
+		if (!bad_config && config != FUNCMUX_UART1_SDB_SDD) {
 			/*
 			 * Tegra appears to boot with function UARTA pre-
 			 * selected on mux group SDB. If two mux groups are
Signature · 1 line
2.48.1
Reviewed-by on v2 1/3
#2 lore raw

Re: [PATCH v2 1/3] tegra: add funcmux for exposing UART over uSD slot on Tegra 20

нд, 30 бер. 2025 р. о 22:27 Artur Kowalski <[email protected]> пише:

Quoted 10 lines

UART-A can be exposed through uSD, this was tested on Transformer T20 but should work on all Ventana-based boards.

TX is exported on SDD pingroup corresponding to uSD CLK pin RX is exported on SDB which is CMD pin in uSD slot

---

Quoted 9 lines

Changes in v2:
- fixed indentation of preprocessor directives

 arch/arm/include/asm/arch-tegra20/funcmux.h | 1 +
 arch/arm/mach-tegra/board.c                 | 2 ++
 arch/arm/mach-tegra/tegra20/Kconfig         | 3 +++
 drivers/pinctrl/tegra/funcmux-tegra20.c     | 9 ++++++++-
 4 files changed, 14 insertions(+), 1 deletion(-)
#3 lore raw

Re: [PATCH v2 1/3] tegra: add funcmux for exposing UART over uSD slot on Tegra 20

пн, 31 бер. 2025 р. о 08:42 Svyatoslav Ryhel <[email protected]> пише:

Quoted 15 lines

нд, 30 бер. 2025 р. о 22:27 Artur Kowalski <[email protected]> пише:

Quoted 13 lines

UART-A can be exposed through uSD, this was tested on Transformer T20 but should work on all Ventana-based boards.

TX is exported on SDD pingroup corresponding to uSD CLK pin RX is exported on SDB which is CMD pin in uSD slot

---

Changes in v2:
- fixed indentation of preprocessor directives

Quoted 8 lines
Quoted 6 lines
 arch/arm/include/asm/arch-tegra20/funcmux.h | 1 +
 arch/arm/mach-tegra/board.c                 | 2 ++
 arch/arm/mach-tegra/tegra20/Kconfig         | 3 +++
 drivers/pinctrl/tegra/funcmux-tegra20.c     | 9 ++++++++-
 4 files changed, 14 insertions(+), 1 deletion(-)

Applied to u-boot-tegra/staging.
Thank you.

#4 lore raw

PATCH v2 2/3 tegra: respect CONFIG_TEGRA_ENABLE_UART* options on Transformer T20

In reply to Artur Kowalski

If debug UART is set to anything other than UARTD, U-Boot's SPL hangs trying to communicate with UARTD which clock won't be ungated. With this patch it is possible to boot with UARTA enabled.

---

(no changes since v1)

 include/configs/transformer-t20.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
include/configs/transformer-t20.h +10 -0
index 6a3d9b24036..d3a98cc5a70 100644
@@ -16,7 +16,17 @@
 #define CFG_TEGRA_BOARD_STRING		"ASUS Transformer"
 
 /* Board-specific serial config */
+#if defined(CONFIG_TEGRA_ENABLE_UARTA)
+#define CFG_SYS_NS16550_COM1		NV_PA_APB_UARTA_BASE
+#elif defined(CONFIG_TEGRA_ENABLE_UARTB)
+#define CFG_SYS_NS16550_COM1		NV_PA_APB_UARTB_BASE
+#elif defined(CONFIG_TEGRA_ENABLE_UARTC)
+#define CFG_SYS_NS16550_COM1		NV_PA_APB_UARCD_BASE
+#elif defined(CONFIG_TEGRA_ENABLE_UARTD)
 #define CFG_SYS_NS16550_COM1		NV_PA_APB_UARTD_BASE
+#elif defined(CONFIG_TEGRA_ENABLE_UARTE)
+#define CFG_SYS_NS16550_COM1		NV_PA_APB_UARTE_BASE
+#endif
 
 #include "tegra-common-post.h"
 
Signature · 1 line
2.48.1
#5 lore raw

Re: [PATCH v2 2/3] tegra: respect CONFIG_TEGRA_ENABLE_UART* options on Transformer T20

нд, 30 бер. 2025 р. о 22:27 Artur Kowalski <[email protected]> пише:

Quoted 23 lines

If debug UART is set to anything other than UARTD, U-Boot's SPL hangs trying to communicate with UARTD which clock won't be ungated. With this patch it is possible to boot with UARTA enabled.

---

(no changes since v1)

 include/configs/transformer-t20.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
include/configs/transformer-t20.h +2 -0
index 6a3d9b24036..d3a98cc5a70 100644
@@ -16,7 +16,17 @@
 #define CFG_TEGRA_BOARD_STRING         "ASUS Transformer"
 
 /* Board-specific serial config */
+#if defined(CONFIG_TEGRA_ENABLE_UARTA)
+#define CFG_SYS_NS16550_COM1           NV_PA_APB_UARTA_BASE

include/configs/transformer-t20.h line 30

Quoted 10 lines
include/configs/transformer-t20.h +8 -0
+#elif defined(CONFIG_TEGRA_ENABLE_UARTB)
+#define CFG_SYS_NS16550_COM1           NV_PA_APB_UARTB_BASE
+#elif defined(CONFIG_TEGRA_ENABLE_UARTC)
+#define CFG_SYS_NS16550_COM1           NV_PA_APB_UARCD_BASE
+#elif defined(CONFIG_TEGRA_ENABLE_UARTD)
 #define CFG_SYS_NS16550_COM1           NV_PA_APB_UARTD_BASE
+#elif defined(CONFIG_TEGRA_ENABLE_UARTE)
+#define CFG_SYS_NS16550_COM1           NV_PA_APB_UARTE_BASE
+#endif
 

Here you are actually hitting much much deeper thing. You are applying fix to the result, not the cause. Adjustment should be done in the tegra board itself with amending all existing tegra boards. As a maintainer I cannot insist on you doing this unless you willingly agree. You have time to answer till 02.03.25 and if no answer I will apply patch on my own to custodian tegra/staging branch.

Quoted 5 lines
include/configs/transformer-t20.h +0 -1
 #include "tegra-common-post.h"
 
--

2.48.1

#6 lore raw

Re: [PATCH v2 2/3] tegra: respect CONFIG_TEGRA_ENABLE_UART* options on Transformer T20

W dniu 31.03.2025 o 07:48, Svyatoslav Ryhel pisze:

Quoted 31 lines

нд, 30 бер. 2025 р. о 22:27 Artur Kowalski <[email protected]> пише:

Quoted 30 lines

If debug UART is set to anything other than UARTD, U-Boot's SPL hangs trying to communicate with UARTD which clock won't be ungated. With this patch it is possible to boot with UARTA enabled.

---

(no changes since v1)

  include/configs/transformer-t20.h | 10 ++++++++++
  1 file changed, 10 insertions(+)
include/configs/transformer-t20.h +9 -0
index 6a3d9b24036..d3a98cc5a70 100644
@@ -16,7 +16,17 @@
  #define CFG_TEGRA_BOARD_STRING         "ASUS Transformer"
 
  /* Board-specific serial config */
+#if defined(CONFIG_TEGRA_ENABLE_UARTA)
+#define CFG_SYS_NS16550_COM1           NV_PA_APB_UARTA_BASE
+#elif defined(CONFIG_TEGRA_ENABLE_UARTB)
+#define CFG_SYS_NS16550_COM1           NV_PA_APB_UARTB_BASE
+#elif defined(CONFIG_TEGRA_ENABLE_UARTC)
+#define CFG_SYS_NS16550_COM1           NV_PA_APB_UARCD_BASE
+#elif defined(CONFIG_TEGRA_ENABLE_UARTD)
  #define CFG_SYS_NS16550_COM1           NV_PA_APB_UARTD_BASE
+#elif defined(CONFIG_TEGRA_ENABLE_UARTE)
+#define CFG_SYS_NS16550_COM1           NV_PA_APB_UARTE_BASE
Quoted 8 lines

include/configs/transformer-t20.h line 30

Quoted 2 lines
include/configs/transformer-t20.h +1 -0
+#endif
 

Here you are actually hitting much much deeper thing. You are applying fix to the result, not the cause. Adjustment should be done in the tegra board itself with amending all existing tegra boards. As a maintainer I cannot insist on you doing this unless you willingly agree. You have time to answer till 02.03.25 and if no answer I will apply patch on my own to custodian tegra/staging branch.

I'd like to do it but unfortunately I won't have enought time this week.

Quoted 5 lines
Quoted 5 lines
include/configs/transformer-t20.h +0 -1
  #include "tegra-common-post.h"
 
--

2.48.1

#7 lore raw

Re: [PATCH v2 2/3] tegra: respect CONFIG_TEGRA_ENABLE_UART* options on Transformer T20

вт, 1 квіт. 2025 р. о 16:30 Artur Kowalski <[email protected]> пише:

Quoted 42 lines

W dniu 31.03.2025 o 07:48, Svyatoslav Ryhel pisze:

Quoted 31 lines

нд, 30 бер. 2025 р. о 22:27 Artur Kowalski <[email protected]> пише:

Quoted 30 lines

If debug UART is set to anything other than UARTD, U-Boot's SPL hangs trying to communicate with UARTD which clock won't be ungated. With this patch it is possible to boot with UARTA enabled.

---

(no changes since v1)

  include/configs/transformer-t20.h | 10 ++++++++++
  1 file changed, 10 insertions(+)
include/configs/transformer-t20.h +9 -0
index 6a3d9b24036..d3a98cc5a70 100644
@@ -16,7 +16,17 @@
  #define CFG_TEGRA_BOARD_STRING         "ASUS Transformer"
 
  /* Board-specific serial config */
+#if defined(CONFIG_TEGRA_ENABLE_UARTA)
+#define CFG_SYS_NS16550_COM1           NV_PA_APB_UARTA_BASE
+#elif defined(CONFIG_TEGRA_ENABLE_UARTB)
+#define CFG_SYS_NS16550_COM1           NV_PA_APB_UARTB_BASE
+#elif defined(CONFIG_TEGRA_ENABLE_UARTC)
+#define CFG_SYS_NS16550_COM1           NV_PA_APB_UARCD_BASE
+#elif defined(CONFIG_TEGRA_ENABLE_UARTD)
  #define CFG_SYS_NS16550_COM1           NV_PA_APB_UARTD_BASE
+#elif defined(CONFIG_TEGRA_ENABLE_UARTE)
+#define CFG_SYS_NS16550_COM1           NV_PA_APB_UARTE_BASE
Quoted 8 lines

include/configs/transformer-t20.h line 30

Quoted 2 lines
include/configs/transformer-t20.h +1 -0
+#endif
 

Here you are actually hitting much much deeper thing. You are applying fix to the result, not the cause. Adjustment should be done in the tegra board itself with amending all existing tegra boards. As a maintainer I cannot insist on you doing this unless you willingly agree. You have time to answer till 02.03.25 and if no answer I will apply patch on my own to custodian tegra/staging branch.

Quoted 1 line

I'd like to do it but unfortunately I won't have enought time this week.

Thanks for responding. Don't worry, I was planning to remove per-device headers anyway so I will include you into patchset which should address the root of this issue you are facing.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
include/configs/transformer-t20.h +0 -1
  #include "tegra-common-post.h"
 
--

2.48.1

#8 lore raw

PATCH v2 3/3 tegra: allow to expose UART on microSD slot

In reply to Artur Kowalski

Tegra20 has mux allowing to repurpose microSD as UART on boards which use sdmmc3 controller for microSD. Add TEGRA_UARTA_MICROSD to enable this feature. It is currently supported on Transformer T20, support for other boards may require Device Tree changes.

Update Transformer T20 DTS to select correct pinmux and stdout-path based on TEGRA_UARTA_MICROSD.

---

Changes in v2:
- added TEGRA_UARTA_MICROSD Kconfig option
- removed .dtsi for enabling UART over microSD
- modified transformer DT to use UARTA and correct pinmux when TEGRA_UARTA_MICROSD is enabled; it is enough to flip a single switch to enable/disable UART over microSD

 arch/arm/dts/tegra20-asus-transformer.dtsi | 24 ++++++++++++++++++++++
 arch/arm/mach-tegra/tegra20/Kconfig        | 15 ++++++++++++++
 2 files changed, 39 insertions(+)
arch/arm/dts/tegra20-asus-transformer.dtsi +24 -0
index 49efabbfd92..9ea323c81f3 100644
@@ -5,7 +5,13 @@
 
 / {
 	chosen {
+#if CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTA)
+		stdout-path = &uarta;
+#elif CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTD)
 		stdout-path = &uartd;
+#else
+#error Unsupported UART
+#endif
 	};
 
 	aliases {
@@ -195,10 +201,17 @@
 				nvidia,function = "i2c1";
 			};
 
+#if CONFIG_IS_ENABLED(TEGRA_UARTA_SDB_SDD)
+			dbguart {
+				nvidia,pins = "sdb", "sdd";
+				nvidia,function = "uarta";
+			};
+#else
 			sdb {
 				nvidia,pins = "sdb", "sdc", "sdd", "slxc", "slxk";
 				nvidia,function = "sdio3";
 			};
+#endif
 
 			sdio1 {
 				nvidia,pins = "sdio1";
@@ -376,7 +389,13 @@
 		};
 	};
 
+#if CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTA)
+	uarta: serial@70006000 {
+#elif CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTD)
 	uartd: serial@70006300 {
+#else
+#error Unsupported UART
+#endif
 		status = "okay";
 		clock-frequency = <216000000>;
 	};
@@ -434,7 +453,12 @@
 	};
 
 	sdmmc3: sdhci@c8000400 {
+#if CONFIG_IS_ENABLED(TEGRA_UARTA_MICROSD)
+		/* Can't use both at the same time */
+		status = "disabled";
+#else
 		status = "okay";
+#endif
 		bus-width = <4>;
 
 		cd-gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
arch/arm/mach-tegra/tegra20/Kconfig +15 -0
index 3349f1e2786..c2c51660216 100644
@@ -77,6 +77,21 @@ endchoice
 config SYS_SOC
 	default "tegra20"
 
+config TEGRA_UARTA_MICROSD
+	bool "UARTA on MicroSD breakout board"
+	default n
+	depends on TEGRA_ENABLE_UARTA && TARGET_TRANSFORMER_T20
+	select TEGRA_UARTA_SDB_SDD
+	help
+	  Repurpose the SD card slot for getting access to the UARTA serial
+	  console. Primarily useful only for low level u-boot debugging on
+	  tablets, where normal UARTD is difficult to access and requires
+	  device disassembly and/or soldering. Enabling this option causes
+	  UARTA TX to become exposed on SDD and RX on SDB pins which correspond
+	  to microSD CLK and CMD pins respectively. Currently this is supported
+	  only on Transformer T20, support for other platforms may require DT
+	  and configs (from include/configs/*) updates.
+
 source "board/nvidia/harmony/Kconfig"
 source "board/avionic-design/medcom-wide/Kconfig"
 source "board/compal/paz00/Kconfig"
Signature · 1 line
2.48.1
#9 lore raw

Re: [PATCH v2 3/3] tegra: allow to expose UART on microSD slot

нд, 30 бер. 2025 р. о 22:27 Artur Kowalski <[email protected]> пише:

Quoted 113 lines

Tegra20 has mux allowing to repurpose microSD as UART on boards which use sdmmc3 controller for microSD. Add TEGRA_UARTA_MICROSD to enable this feature. It is currently supported on Transformer T20, support for other boards may require Device Tree changes.

Update Transformer T20 DTS to select correct pinmux and stdout-path based on TEGRA_UARTA_MICROSD.

---

Changes in v2:
- added TEGRA_UARTA_MICROSD Kconfig option
- removed .dtsi for enabling UART over microSD
- modified transformer DT to use UARTA and correct pinmux when TEGRA_UARTA_MICROSD is enabled; it is enough to flip a single switch to enable/disable UART over microSD

 arch/arm/dts/tegra20-asus-transformer.dtsi | 24 ++++++++++++++++++++++
 arch/arm/mach-tegra/tegra20/Kconfig        | 15 ++++++++++++++
 2 files changed, 39 insertions(+)
arch/arm/dts/tegra20-asus-transformer.dtsi +24 -0
index 49efabbfd92..9ea323c81f3 100644
@@ -5,7 +5,13 @@
 
 / {
        chosen {
+#if CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTA)
+               stdout-path = &uarta;
+#elif CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTD)
                stdout-path = &uartd;
+#else
+#error Unsupported UART
+#endif
        };
 
        aliases {
@@ -195,10 +201,17 @@
                                nvidia,function = "i2c1";
                        };
 
+#if CONFIG_IS_ENABLED(TEGRA_UARTA_SDB_SDD)
+                       dbguart {
+                               nvidia,pins = "sdb", "sdd";
+                               nvidia,function = "uarta";
+                       };
+#else
                        sdb {
                                nvidia,pins = "sdb", "sdc", "sdd", "slxc", "slxk";
                                nvidia,function = "sdio3";
                        };
+#endif
 
                        sdio1 {
                                nvidia,pins = "sdio1";
@@ -376,7 +389,13 @@
                };
        };
 
+#if CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTA)
+       uarta: serial@70006000 {
+#elif CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTD)
        uartd: serial@70006300 {
+#else
+#error Unsupported UART
+#endif
                status = "okay";
                clock-frequency = <216000000>;
        };
@@ -434,7 +453,12 @@
        };
 
        sdmmc3: sdhci@c8000400 {
+#if CONFIG_IS_ENABLED(TEGRA_UARTA_MICROSD)
+               /* Can't use both at the same time */
+               status = "disabled";
+#else
                status = "okay";
+#endif
                bus-width = <4>;
 
                cd-gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
arch/arm/mach-tegra/tegra20/Kconfig +15 -1
index 3349f1e2786..c2c51660216 100644
@@ -77,6 +77,21 @@ endchoice
 config SYS_SOC
        default "tegra20"
 
+config TEGRA_UARTA_MICROSD
+       bool "UARTA on MicroSD breakout board"
+       default n
+       depends on TEGRA_ENABLE_UARTA && TARGET_TRANSFORMER_T20
+       select TEGRA_UARTA_SDB_SDD
+       help
+         Repurpose the SD card slot for getting access to the UARTA serial
+         console. Primarily useful only for low level u-boot debugging on
+         tablets, where normal UARTD is difficult to access and requires
+         device disassembly and/or soldering. Enabling this option causes
+         UARTA TX to become exposed on SDD and RX on SDB pins which correspond
+         to microSD CLK and CMD pins respectively. Currently this is supported
+         only on Transformer T20, support for other platforms may require DT
+         and configs (from include/configs/*) updates.
+
 source "board/nvidia/harmony/Kconfig"
 source "board/avionic-design/medcom-wide/Kconfig"
 source "board/compal/paz00/Kconfig"
--
Quoted 2 lines

2.48.1

This is not applicable since this is a hack by nature, BUT if you contain this in the transformer t20 board and Kconfig (no dts changes), this may be applied.

#10 lore raw

Re: [PATCH v2 3/3] tegra: allow to expose UART on microSD slot

W dniu 31.03.2025 o 07:51, Svyatoslav Ryhel pisze:

Quoted 110 lines

нд, 30 бер. 2025 р. о 22:27 Artur Kowalski <[email protected]> пише:

Quoted 109 lines

Tegra20 has mux allowing to repurpose microSD as UART on boards which use sdmmc3 controller for microSD. Add TEGRA_UARTA_MICROSD to enable this feature. It is currently supported on Transformer T20, support for other boards may require Device Tree changes.

Update Transformer T20 DTS to select correct pinmux and stdout-path based on TEGRA_UARTA_MICROSD.

---

Changes in v2:
- added TEGRA_UARTA_MICROSD Kconfig option
- removed .dtsi for enabling UART over microSD
- modified transformer DT to use UARTA and correct pinmux when TEGRA_UARTA_MICROSD is enabled; it is enough to flip a single switch to enable/disable UART over microSD

  arch/arm/dts/tegra20-asus-transformer.dtsi | 24 ++++++++++++++++++++++
  arch/arm/mach-tegra/tegra20/Kconfig        | 15 ++++++++++++++
  2 files changed, 39 insertions(+)
arch/arm/dts/tegra20-asus-transformer.dtsi +24 -0
index 49efabbfd92..9ea323c81f3 100644
@@ -5,7 +5,13 @@
 
  / {
         chosen {
+#if CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTA)
+               stdout-path = &uarta;
+#elif CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTD)
                 stdout-path = &uartd;
+#else
+#error Unsupported UART
+#endif
         };
 
         aliases {
@@ -195,10 +201,17 @@
                                 nvidia,function = "i2c1";
                         };
 
+#if CONFIG_IS_ENABLED(TEGRA_UARTA_SDB_SDD)
+                       dbguart {
+                               nvidia,pins = "sdb", "sdd";
+                               nvidia,function = "uarta";
+                       };
+#else
                         sdb {
                                 nvidia,pins = "sdb", "sdc", "sdd", "slxc", "slxk";
                                 nvidia,function = "sdio3";
                         };
+#endif
 
                         sdio1 {
                                 nvidia,pins = "sdio1";
@@ -376,7 +389,13 @@
                 };
         };
 
+#if CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTA)
+       uarta: serial@70006000 {
+#elif CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTD)
         uartd: serial@70006300 {
+#else
+#error Unsupported UART
+#endif
                 status = "okay";
                 clock-frequency = <216000000>;
         };
@@ -434,7 +453,12 @@
         };
 
         sdmmc3: sdhci@c8000400 {
+#if CONFIG_IS_ENABLED(TEGRA_UARTA_MICROSD)
+               /* Can't use both at the same time */
+               status = "disabled";
+#else
                 status = "okay";
+#endif
                 bus-width = <4>;
 
                 cd-gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
arch/arm/mach-tegra/tegra20/Kconfig +15 -0
index 3349f1e2786..c2c51660216 100644
@@ -77,6 +77,21 @@ endchoice
  config SYS_SOC
         default "tegra20"
 
+config TEGRA_UARTA_MICROSD
+       bool "UARTA on MicroSD breakout board"
+       default n
+       depends on TEGRA_ENABLE_UARTA && TARGET_TRANSFORMER_T20
+       select TEGRA_UARTA_SDB_SDD
+       help
+         Repurpose the SD card slot for getting access to the UARTA serial
+         console. Primarily useful only for low level u-boot debugging on
+         tablets, where normal UARTD is difficult to access and requires
+         device disassembly and/or soldering. Enabling this option causes
+         UARTA TX to become exposed on SDD and RX on SDB pins which correspond
+         to microSD CLK and CMD pins respectively. Currently this is supported
+         only on Transformer T20, support for other platforms may require DT
+         and configs (from include/configs/*) updates.
+
  source "board/nvidia/harmony/Kconfig"
Quoted 8 lines
Quoted 5 lines
arch/arm/mach-tegra/tegra20/Kconfig +0 -1
  source "board/avionic-design/medcom-wide/Kconfig"
  source "board/compal/paz00/Kconfig"
--

2.48.1

This is not applicable since this is a hack by nature, BUT if you contain this in the transformer t20 board and Kconfig (no dts changes), this may be applied.

Ok, then I'll drop DTS changes. I will add few words about this option in Transformer documentation and a note in Kconfig help to not surprise users with not booting U-Boot as enabling this option without changing DTS causes U-Boot to hang.

#11 lore raw

Re: [PATCH v2 3/3] tegra: allow to expose UART on microSD slot

вт, 1 квіт. 2025 р. о 16:34 Artur Kowalski <[email protected]> пише:

Quoted 121 lines

W dniu 31.03.2025 o 07:51, Svyatoslav Ryhel pisze:

Quoted 110 lines

нд, 30 бер. 2025 р. о 22:27 Artur Kowalski <[email protected]> пише:

Quoted 109 lines

Tegra20 has mux allowing to repurpose microSD as UART on boards which use sdmmc3 controller for microSD. Add TEGRA_UARTA_MICROSD to enable this feature. It is currently supported on Transformer T20, support for other boards may require Device Tree changes.

Update Transformer T20 DTS to select correct pinmux and stdout-path based on TEGRA_UARTA_MICROSD.

---

Changes in v2:
- added TEGRA_UARTA_MICROSD Kconfig option
- removed .dtsi for enabling UART over microSD
- modified transformer DT to use UARTA and correct pinmux when TEGRA_UARTA_MICROSD is enabled; it is enough to flip a single switch to enable/disable UART over microSD

  arch/arm/dts/tegra20-asus-transformer.dtsi | 24 ++++++++++++++++++++++
  arch/arm/mach-tegra/tegra20/Kconfig        | 15 ++++++++++++++
  2 files changed, 39 insertions(+)
arch/arm/dts/tegra20-asus-transformer.dtsi +24 -0
index 49efabbfd92..9ea323c81f3 100644
@@ -5,7 +5,13 @@
 
  / {
         chosen {
+#if CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTA)
+               stdout-path = &uarta;
+#elif CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTD)
                 stdout-path = &uartd;
+#else
+#error Unsupported UART
+#endif
         };
 
         aliases {
@@ -195,10 +201,17 @@
                                 nvidia,function = "i2c1";
                         };
 
+#if CONFIG_IS_ENABLED(TEGRA_UARTA_SDB_SDD)
+                       dbguart {
+                               nvidia,pins = "sdb", "sdd";
+                               nvidia,function = "uarta";
+                       };
+#else
                         sdb {
                                 nvidia,pins = "sdb", "sdc", "sdd", "slxc", "slxk";
                                 nvidia,function = "sdio3";
                         };
+#endif
 
                         sdio1 {
                                 nvidia,pins = "sdio1";
@@ -376,7 +389,13 @@
                 };
         };
 
+#if CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTA)
+       uarta: serial@70006000 {
+#elif CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTD)
         uartd: serial@70006300 {
+#else
+#error Unsupported UART
+#endif
                 status = "okay";
                 clock-frequency = <216000000>;
         };
@@ -434,7 +453,12 @@
         };
 
         sdmmc3: sdhci@c8000400 {
+#if CONFIG_IS_ENABLED(TEGRA_UARTA_MICROSD)
+               /* Can't use both at the same time */
+               status = "disabled";
+#else
                 status = "okay";
+#endif
                 bus-width = <4>;
 
                 cd-gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
arch/arm/mach-tegra/tegra20/Kconfig +15 -0
index 3349f1e2786..c2c51660216 100644
@@ -77,6 +77,21 @@ endchoice
  config SYS_SOC
         default "tegra20"
 
+config TEGRA_UARTA_MICROSD
+       bool "UARTA on MicroSD breakout board"
+       default n
+       depends on TEGRA_ENABLE_UARTA && TARGET_TRANSFORMER_T20
+       select TEGRA_UARTA_SDB_SDD
+       help
+         Repurpose the SD card slot for getting access to the UARTA serial
+         console. Primarily useful only for low level u-boot debugging on
+         tablets, where normal UARTD is difficult to access and requires
+         device disassembly and/or soldering. Enabling this option causes
+         UARTA TX to become exposed on SDD and RX on SDB pins which correspond
+         to microSD CLK and CMD pins respectively. Currently this is supported
+         only on Transformer T20, support for other platforms may require DT
+         and configs (from include/configs/*) updates.
+
  source "board/nvidia/harmony/Kconfig"
Quoted 8 lines
Quoted 5 lines
arch/arm/mach-tegra/tegra20/Kconfig +0 -1
  source "board/avionic-design/medcom-wide/Kconfig"
  source "board/compal/paz00/Kconfig"
--

2.48.1

This is not applicable since this is a hack by nature, BUT if you contain this in the transformer t20 board and Kconfig (no dts changes), this may be applied.

Quoted 5 lines

Ok, then I'll drop DTS changes. I will add few words about this option in Transformer documentation
and a note in Kconfig help to not surprise users with not booting U-Boot as enabling this option without
changing DTS causes U-Boot to hang.

You should remove then Kconfig option as well. Add a new chapter to Transformer T20 documentation which describes this method, here[1] you may find a similar approach but info is in the commit message of tegra30 uart-e funcmux. Additionally, as I have said previously, these changes can be contained in the transformer t20 board file by using some device tree manipulations from there.

---
1 https://source.denx.de/u-boot/u-boot/-/commit/b515d7ae0de51a26f73b2ddb5ea4db0d95b67d7a

#12 lore raw

Re: [PATCH v2 3/3] tegra: allow to expose UART on microSD slot

W dniu 01.04.2025 o 15:48, Svyatoslav Ryhel pisze:

Quoted 126 lines

вт, 1 квіт. 2025 р. о 16:34 Artur Kowalski <[email protected]> пише:

Quoted 120 lines

W dniu 31.03.2025 o 07:51, Svyatoslav Ryhel pisze:

Quoted 110 lines

нд, 30 бер. 2025 р. о 22:27 Artur Kowalski <[email protected]> пише:

Quoted 109 lines

Tegra20 has mux allowing to repurpose microSD as UART on boards which use sdmmc3 controller for microSD. Add TEGRA_UARTA_MICROSD to enable this feature. It is currently supported on Transformer T20, support for other boards may require Device Tree changes.

Update Transformer T20 DTS to select correct pinmux and stdout-path based on TEGRA_UARTA_MICROSD.

---

Changes in v2:
- added TEGRA_UARTA_MICROSD Kconfig option
- removed .dtsi for enabling UART over microSD
- modified transformer DT to use UARTA and correct pinmux when TEGRA_UARTA_MICROSD is enabled; it is enough to flip a single switch to enable/disable UART over microSD

   arch/arm/dts/tegra20-asus-transformer.dtsi | 24 ++++++++++++++++++++++
   arch/arm/mach-tegra/tegra20/Kconfig        | 15 ++++++++++++++
   2 files changed, 39 insertions(+)
arch/arm/dts/tegra20-asus-transformer.dtsi +24 -0
index 49efabbfd92..9ea323c81f3 100644
@@ -5,7 +5,13 @@
 
   / {
          chosen {
+#if CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTA)
+               stdout-path = &uarta;
+#elif CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTD)
                  stdout-path = &uartd;
+#else
+#error Unsupported UART
+#endif
          };
 
          aliases {
@@ -195,10 +201,17 @@
                                  nvidia,function = "i2c1";
                          };
 
+#if CONFIG_IS_ENABLED(TEGRA_UARTA_SDB_SDD)
+                       dbguart {
+                               nvidia,pins = "sdb", "sdd";
+                               nvidia,function = "uarta";
+                       };
+#else
                          sdb {
                                  nvidia,pins = "sdb", "sdc", "sdd", "slxc", "slxk";
                                  nvidia,function = "sdio3";
                          };
+#endif
 
                          sdio1 {
                                  nvidia,pins = "sdio1";
@@ -376,7 +389,13 @@
                  };
          };
 
+#if CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTA)
+       uarta: serial@70006000 {
+#elif CONFIG_IS_ENABLED(TEGRA_ENABLE_UARTD)
          uartd: serial@70006300 {
+#else
+#error Unsupported UART
+#endif
                  status = "okay";
                  clock-frequency = <216000000>;
          };
@@ -434,7 +453,12 @@
          };
 
          sdmmc3: sdhci@c8000400 {
+#if CONFIG_IS_ENABLED(TEGRA_UARTA_MICROSD)
+               /* Can't use both at the same time */
+               status = "disabled";
+#else
                  status = "okay";
+#endif
                  bus-width = <4>;
 
                  cd-gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
arch/arm/mach-tegra/tegra20/Kconfig +15 -0
index 3349f1e2786..c2c51660216 100644
@@ -77,6 +77,21 @@ endchoice
   config SYS_SOC
          default "tegra20"
 
+config TEGRA_UARTA_MICROSD
+       bool "UARTA on MicroSD breakout board"
+       default n
+       depends on TEGRA_ENABLE_UARTA && TARGET_TRANSFORMER_T20
+       select TEGRA_UARTA_SDB_SDD
+       help
+         Repurpose the SD card slot for getting access to the UARTA serial
+         console. Primarily useful only for low level u-boot debugging on
+         tablets, where normal UARTD is difficult to access and requires
+         device disassembly and/or soldering. Enabling this option causes
+         UARTA TX to become exposed on SDD and RX on SDB pins which correspond
+         to microSD CLK and CMD pins respectively. Currently this is supported
+         only on Transformer T20, support for other platforms may require DT
+         and configs (from include/configs/*) updates.
+
   source "board/nvidia/harmony/Kconfig"
Quoted 8 lines
Quoted 5 lines
arch/arm/mach-tegra/tegra20/Kconfig +0 -1
   source "board/avionic-design/medcom-wide/Kconfig"
   source "board/compal/paz00/Kconfig"
--

2.48.1

This is not applicable since this is a hack by nature, BUT if you contain this in the transformer t20 board and Kconfig (no dts changes), this may be applied.

Quoted 5 lines

Ok, then I'll drop DTS changes. I will add few words about this option in Transformer documentation
and a note in Kconfig help to not surprise users with not booting U-Boot as enabling this option without
changing DTS causes U-Boot to hang.

Quoted 6 lines

You should remove then Kconfig option as well. Add a new chapter to Transformer T20 documentation which describes this method, here[1] you may find a similar approach but info is in the commit message of tegra30 uart-e funcmux. Additionally, as I have said previously, these changes can be contained in the transformer t20 board file by using some device tree manipulations from there.

Currently I'm working on few other things both in U-Boot in OS, some of patches probably I will send to upstream in the coming weeks, but eventually, I will come back to this.

Quoted 2 lines

---
1 https://source.denx.de/u-boot/u-boot/-/commit/b515d7ae0de51a26f73b2ddb5ea4db0d95b67d7a