[PATCH/RFC] board: amlogic: Fix Odroid-C4 SD card reboot issue
Neil Armstrong
narmstrong at baylibre.com
Fri Dec 18 09:36:34 CET 2020
Hi,
On 17/12/2020 10:06, Marek Szyprowski wrote:
> For the proper reboot Odroid C4 board requires to switch TFLASH_VDD_EN
> pin to the input (high impedance?) mode, otherwise the board is stuck
> in the middle of loading early stages of the bootloader from SD card.
Did you try taking the regulator-tflash_vdd and doing a disable/enable sequence
to reset the card ?
The GPIOAO_3 has a default pull-up, so I don't see why moving it to input could change
anything.
So maybe simply doing a 0->1 transition could do the same, using the regulator
would be much better.
Can't we add "shutdown" or equivalent method to the mmc driver that could do this
directly with the vdd regulator ?
@tobetter, could you provide us a summary of how to fix the reboot issues on the
N2, N2+, C4 and HC4 ?
Thanks,
Neil
>
> This has been achieved by hijacking reset_misc() callback from the PSCI
> firmware in the Odroid board code. The common meson cpu_reset() function,
> which is called later during the reboot procedure, will call PSCI reboot
> anyway.
>
> This issue doesn't happen if board is booted from eMMC.
>
> Signed-off-by: Marek Szyprowski <m.szyprowski at samsung.com>
> ---
> board/amlogic/odroid-n2/odroid-n2.c | 15 +++++++++++++++
> configs/odroid-c4_defconfig | 1 +
> 2 files changed, 16 insertions(+)
>
> diff --git a/board/amlogic/odroid-n2/odroid-n2.c b/board/amlogic/odroid-n2/odroid-n2.c
> index caf7fd6810..ad91de7ac5 100644
> --- a/board/amlogic/odroid-n2/odroid-n2.c
> +++ b/board/amlogic/odroid-n2/odroid-n2.c
> @@ -10,6 +10,7 @@
> #include <init.h>
> #include <net.h>
> #include <asm/io.h>
> +#include <asm/gpio.h>
> #include <asm/arch/sm.h>
> #include <asm/arch/eth.h>
>
> @@ -47,3 +48,17 @@ int misc_init_r(void)
>
> return 0;
> }
> +
> +#ifndef CONFIG_PSCI_RESET
> +void reset_misc(void)
> +{
> + if (of_machine_is_compatible("hardkernel,odroid-c4")) {
> + unsigned int gpio;
> + const char *str_gpio = "aobus-banks3";
> +
> + gpio_lookup_name(str_gpio, NULL, NULL, &gpio);
> + gpio_request(gpio, "reboot");
> + gpio_direction_input(gpio);
> + }
> +}
> +#endif
> diff --git a/configs/odroid-c4_defconfig b/configs/odroid-c4_defconfig
> index 367d22db0b..ca0ab71a7a 100644
> --- a/configs/odroid-c4_defconfig
> +++ b/configs/odroid-c4_defconfig
> @@ -14,6 +14,7 @@ CONFIG_DEBUG_UART=y
> CONFIG_OF_BOARD_SETUP=y
> # CONFIG_DISPLAY_CPUINFO is not set
> CONFIG_MISC_INIT_R=y
> +# CONFIG_PSCI_RESET is not set
> # CONFIG_CMD_BDI is not set
> # CONFIG_CMD_IMI is not set
> CONFIG_CMD_GPIO=y
>
More information about the U-Boot
mailing list