[PATCH] rockchip: ringneck-px30: put STM32_RST line in input mode instead of output

Quentin Schulz foss+uboot at 0leil.net
Fri Feb 9 14:18:09 CET 2024


From: Quentin Schulz <quentin.schulz at theobroma-systems.com>

The STM32_RST line is routed to the ATtiny microcontroller
PA0/RESET/UPDI pin. By driving the PX30 SoC pin as GPIO output high, we
prevent external UPDI to be used for flashing without first putting this
pin as GPIO input, an extra step we could avoid in userspace.

There's an external hardware pull-up strong enough to keep the STM32_RST
state high on ATtiny side but weak enough it can be overridden by
external UPDI. This also means it is safe to use for the STM32 variant,
where STM32_RST line will be in the same state as if output high was
used.

The Q7 standard specifies that MFG_NC1 and MFG_NC2 (used for UPDI for
Ringneck) pins should neither be driven by the carrierboard, nor have
pull-up or pull-down resistors. This means this commit is safe to use
regardless of the carrierboard this module would be connected to
(provided it follows the Q7 standard).

Fixes: 6acdd63e8771 ("rockchip: ringneck-px30: always reset STM32 companion controller on boot")
Cc: Quentin Schulz <foss+uboot at 0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz at theobroma-systems.com>
---
 board/theobroma-systems/ringneck_px30/ringneck-px30.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/theobroma-systems/ringneck_px30/ringneck-px30.c b/board/theobroma-systems/ringneck_px30/ringneck-px30.c
index ff7e414303d..2ab1e7a12fa 100644
--- a/board/theobroma-systems/ringneck_px30/ringneck-px30.c
+++ b/board/theobroma-systems/ringneck_px30/ringneck-px30.c
@@ -76,9 +76,9 @@ void spl_board_init(void)
 
 	mdelay(1);
 
-	ret = gpio_direction_output(STM32_RST, 1);
+	ret = gpio_direction_input(STM32_RST);
 	if (ret) {
-		debug("Failed to configure STM32_RST as output high\n");
+		debug("Failed to configure STM32_RST as input\n");
 		return;
 	}
 }

---
base-commit: a4650bf65e4b7d3ef04c90ba8031374428e4a682
change-id: 20240209-ringneck-stm32-rst-input-ca1cdfa67ff5

Best regards,
-- 
Quentin Schulz <quentin.schulz at theobroma-systems.com>



More information about the U-Boot mailing list