summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerard Salvatella <gerard.salvatella@toradex.com>2018-06-04 13:00:49 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2018-06-06 13:13:50 +0200
commitcd3e271cc5236d6f254607e4173c233a437ec727 (patch)
tree2b0a67d3aba547f2ab582bbedc7d39944f29990c
parentaddb87df8d83ac36cf574abddb8b24a44b33b1f0 (diff)
colibri-imx6: added nreset gpio on reboot
RGMII_RD1 pin (active high, GPIO6_IO27) is triggered on reboot during the SPL phase. This asserts (active low) nReset_Out from the PMIC. Only V1.1 and later Colibri iMX6 modules implement this in hw. Previous versions do not use this pin, so it is safe to leave it enabled at all times. Signed-off-by: Gerard Salvatella <gerard.salvatella@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
-rw-r--r--board/toradex/colibri_imx6/colibri_imx6.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/board/toradex/colibri_imx6/colibri_imx6.c b/board/toradex/colibri_imx6/colibri_imx6.c
index 76d999affc..5a3678e506 100644
--- a/board/toradex/colibri_imx6/colibri_imx6.c
+++ b/board/toradex/colibri_imx6/colibri_imx6.c
@@ -36,6 +36,7 @@
#include <mmc.h>
#include <netdev.h>
#include <libfdt.h>
+#include <cpu.h>
#include "../common/tdx-cfg-block.h"
#ifdef CONFIG_TDX_CMD_IMX_MFGR
@@ -1119,6 +1120,26 @@ static void spl_dram_init(void)
udelay(100);
}
+static iomux_v3_cfg_t const gpio_reset_pad[] = {
+ MX6_PAD_RGMII_RD1__GPIO6_IO27 | MUX_PAD_CTRL(NO_PAD_CTRL)
+#define GPIO_NRESET IMX_GPIO_NR(6, 27)
+};
+
+static void nreset_out(void) {
+
+ #define IMX_RESET_CAUSE_POR 0x00011
+ int reset_cause;
+ reset_cause = get_imx_reset_cause();
+
+ if (reset_cause != IMX_RESET_CAUSE_POR) {
+ imx_iomux_v3_setup_multiple_pads(gpio_reset_pad,
+ ARRAY_SIZE(gpio_reset_pad));
+ gpio_direction_output(GPIO_NRESET, 1);
+ udelay(100);
+ gpio_direction_output(GPIO_NRESET, 0);
+ }
+}
+
void board_init_f(ulong dummy)
{
/* setup AIPS and disable watchdog */
@@ -1145,6 +1166,9 @@ void board_init_f(ulong dummy)
/* Clear the BSS. */
memset(__bss_start, 0, __bss_end - __bss_start);
+ /* Assert nReset_Out */
+ nreset_out();
+
/* load/boot image from boot device */
board_init_r(NULL, 0);
}