From b8f72d3269ef81c5298dff0e2d4046242eaa1bbb Mon Sep 17 00:00:00 2001 From: Stefan Bigler Date: Thu, 20 Sep 2018 12:35:53 +0200 Subject: colibri_imx6: apply nreset_out only if no power-on Fix the nreset_out() and only pull-down nRESET_OUT reset case was not a power-on reset. Cannot use get_imx_reset_cause() because static variable reset_cause is not initialized, normal done by get_reset_cause() much later. Signed-off-by: Stefan Bigler Acked-by: Marcel Ziswiler --- board/toradex/colibri_imx6/colibri_imx6.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/board/toradex/colibri_imx6/colibri_imx6.c b/board/toradex/colibri_imx6/colibri_imx6.c index f97e292f01..c4e24fcda7 100644 --- a/board/toradex/colibri_imx6/colibri_imx6.c +++ b/board/toradex/colibri_imx6/colibri_imx6.c @@ -1134,11 +1134,13 @@ static iomux_v3_cfg_t const gpio_reset_pad[] = { static void nreset_out(void) { - #define IMX_RESET_CAUSE_POR 0x00011 + #define IMX_RESET_CAUSE_POR_MASK 0x00001 int reset_cause; - reset_cause = get_imx_reset_cause(); - if (reset_cause != IMX_RESET_CAUSE_POR) { + struct src *src_regs = (struct src *)SRC_BASE_ADDR; + reset_cause = readl(&src_regs->srsr); + + if (!(reset_cause & IMX_RESET_CAUSE_POR_MASK)) { imx_iomux_v3_setup_multiple_pads(gpio_reset_pad, ARRAY_SIZE(gpio_reset_pad)); gpio_direction_output(GPIO_NRESET, 1); -- cgit v1.2.3