diff options
Diffstat (limited to 'board/theobroma-systems/lion_rk3368/lion_rk3368.c')
-rw-r--r-- | board/theobroma-systems/lion_rk3368/lion_rk3368.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/board/theobroma-systems/lion_rk3368/lion_rk3368.c b/board/theobroma-systems/lion_rk3368/lion_rk3368.c index 31e09c87b1..2c5ce7154d 100644 --- a/board/theobroma-systems/lion_rk3368/lion_rk3368.c +++ b/board/theobroma-systems/lion_rk3368/lion_rk3368.c @@ -9,7 +9,9 @@ #include <spl.h> #include <syscon.h> #include <asm/io.h> +#include <asm/gpio.h> #include <asm/arch/clock.h> +#include <asm/arch/cru_rk3368.h> #include <asm/arch/grf_rk3368.h> #include <asm/arch/timer.h> #include <power/regulator.h> @@ -34,11 +36,35 @@ int board_init(void) return 0; } +static void rk3368_force_power_on_reset(void) +{ + ofnode node; + struct gpio_desc sysreset_gpio; + + debug("%s: trying to force a power-on reset\n", __func__); + + node = ofnode_path("/config"); + if (!ofnode_valid(node)) { + debug("%s: no /config node?\n", __func__); + return; + } + + if (gpio_request_by_name_nodev(node, "sysreset-gpio", 0, + &sysreset_gpio, GPIOD_IS_OUT)) { + debug("%s: could not find a /config/sysreset-gpio\n", __func__); + return; + } + + dm_gpio_set_value(&sysreset_gpio, 1); +} + void spl_board_init(void) { int ret; + struct rk3368_cru *cru = rockchip_get_cru(); - debug("%s: calling regulators_enable_boot_on\n", __func__); + if (cru->glb_rst_st != 0) + rk3368_force_power_on_reset(); ret = regulators_enable_boot_on(false); if (ret) |