summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>2024-02-09 14:18:09 +0100
committerQuentin Schulz <quentin.schulz@theobroma-systems.com>2024-02-09 14:24:05 +0100
commitda00a86b79dd00c70f4a1264694eaff4a871cf12 (patch)
tree0bd44cad6f7ff2b76168000eb3d315a4707cd05d
parent1d895b4d67ab1a193c5afe0d1fabe95a60873e2f (diff)
FROMLIST: rockchip: ringneck-px30: put STM32_RST line in input mode instead of output
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@0leil.net> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Fixes: 2a07d38d2bc3 ("FROMLIST: rockchip: ringneck-px30: always reset STM32 companion controller on boot") Link: https://lore.kernel.org/r/20240209-ringneck-stm32-rst-input-v1-1-fa9d23ac8ebe@theobroma-systems.com Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
-rw-r--r--board/theobroma-systems/ringneck_px30/ringneck-px30.c4
1 files 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 4fb0d454dc..c66629b135 100644
--- a/board/theobroma-systems/ringneck_px30/ringneck-px30.c
+++ b/board/theobroma-systems/ringneck_px30/ringneck-px30.c
@@ -220,9 +220,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;
}
}