* [U-Boot] [PATCH] warp7: Fix watchdog reset
@ 2016-06-10 17:45 Marco Franchi
2016-06-10 21:27 ` Fabio Estevam
2016-06-18 8:35 ` Stefano Babic
0 siblings, 2 replies; 3+ messages in thread
From: Marco Franchi @ 2016-06-10 17:45 UTC (permalink / raw)
To: u-boot
The latest version of warp7 board provides the connection of the
WDOG1_B pin to the PMIC.
Program the watchdog to enable the WDOG1_B output which causes
a POR reset.
Based on the imx7dsabresd code.
Signed-off-by: Marco Franchi <marco.franchi@nxp.com>
---
board/warp7/warp7.c | 21 +++++++++++++++++++++
include/configs/warp7.h | 1 +
2 files changed, 22 insertions(+)
diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
index 8c5bf9a..27e31f3 100644
--- a/board/warp7/warp7.c
+++ b/board/warp7/warp7.c
@@ -32,6 +32,10 @@ int dram_init(void)
return 0;
}
+static iomux_v3_cfg_t const wdog_pads[] = {
+ MX7D_PAD_GPIO1_IO00__WDOG1_WDOG_B | MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+
static iomux_v3_cfg_t const uart1_pads[] = {
MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
@@ -100,3 +104,20 @@ int board_usb_phy_mode(int port)
{
return USB_INIT_DEVICE;
}
+
+int board_late_init(void)
+{
+ struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR;
+
+ imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads));
+
+ set_wdog_reset(wdog);
+
+ /*
+ * Do not assert internal WDOG_RESET_B_DEB(controlled by bit 4),
+ * since we use PMIC_PWRON to reset the board.
+ */
+ clrsetbits_le16(&wdog->wcr, 0, 0x10);
+
+ return 0;
+}
diff --git a/include/configs/warp7.h b/include/configs/warp7.h
index b57065b..3d0b6dd 100644
--- a/include/configs/warp7.h
+++ b/include/configs/warp7.h
@@ -20,6 +20,7 @@
#define CONFIG_SYS_MALLOC_LEN (35 * SZ_1M)
#define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_BOARD_LATE_INIT
/* MMC Config*/
#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC3_BASE_ADDR
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* [U-Boot] [PATCH] warp7: Fix watchdog reset
2016-06-10 17:45 [U-Boot] [PATCH] warp7: Fix watchdog reset Marco Franchi
@ 2016-06-10 21:27 ` Fabio Estevam
2016-06-18 8:35 ` Stefano Babic
1 sibling, 0 replies; 3+ messages in thread
From: Fabio Estevam @ 2016-06-10 21:27 UTC (permalink / raw)
To: u-boot
On Fri, Jun 10, 2016 at 2:45 PM, Marco Franchi <marco.franchi@nxp.com> wrote:
> The latest version of warp7 board provides the connection of the
> WDOG1_B pin to the PMIC.
>
> Program the watchdog to enable the WDOG1_B output which causes
> a POR reset.
>
> Based on the imx7dsabresd code.
>
> Signed-off-by: Marco Franchi <marco.franchi@nxp.com>
Acked-by: Fabio Estevam <fabio.estevam@nxp.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] warp7: Fix watchdog reset
2016-06-10 17:45 [U-Boot] [PATCH] warp7: Fix watchdog reset Marco Franchi
2016-06-10 21:27 ` Fabio Estevam
@ 2016-06-18 8:35 ` Stefano Babic
1 sibling, 0 replies; 3+ messages in thread
From: Stefano Babic @ 2016-06-18 8:35 UTC (permalink / raw)
To: u-boot
On 10/06/2016 19:45, Marco Franchi wrote:
> The latest version of warp7 board provides the connection of the
> WDOG1_B pin to the PMIC.
>
> Program the watchdog to enable the WDOG1_B output which causes
> a POR reset.
>
> Based on the imx7dsabresd code.
>
> Signed-off-by: Marco Franchi <marco.franchi@nxp.com>
> ---
Applied to master (bug fix), thanks !
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-18 8:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-10 17:45 [U-Boot] [PATCH] warp7: Fix watchdog reset Marco Franchi
2016-06-10 21:27 ` Fabio Estevam
2016-06-18 8:35 ` Stefano Babic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox