summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Bigler <stefan.bigler@securiton.ch>2018-09-20 12:35:53 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2018-09-20 17:22:43 +0200
commitb8f72d3269ef81c5298dff0e2d4046242eaa1bbb (patch)
treea13c37e7b3745fe6ffc991d9c1a13a4fdab46e87
parentf1e533e5c889d76d9221422865af55a47f0440a1 (diff)
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 <stefan.bigler@securiton.ch> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
-rw-r--r--board/toradex/colibri_imx6/colibri_imx6.c8
1 files 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);