Commit 6d09863801695d975060fbc240147a9067dbafbf

Authored by Ye Li
1 parent 40d2612bdf

MLK-14422 imx7d: wdog: Overwrite the reset_cpu to turn off internal reset signal

Set wdog WCR register SRS bit to turn off internal reset signal WDOG_RESET_B_DEB
for mx7d. So that the warm reset is disabled.
The WDA is cleared to output WDOG_B immediately to reset the board.

Signed-off-by: Ye Li <ye.li@nxp.com>

Showing 1 changed file with 15 additions and 0 deletions Side-by-side Diff

arch/arm/cpu/armv7/mx7/soc.c
1 1 /*
2 2 * Copyright (C) 2015 Freescale Semiconductor, Inc.
  3 + * Copyright 2017 NXP
3 4 *
4 5 * SPDX-License-Identifier: GPL-2.0+
5 6 */
... ... @@ -17,6 +18,7 @@
17 18 #include <asm/arch/crm_regs.h>
18 19 #include <dm.h>
19 20 #include <imx_thermal.h>
  21 +#include <fsl_wdog.h>
20 22  
21 23 #if defined(CONFIG_IMX_THERMAL)
22 24 static const struct imx_thermal_plat imx7_thermal_plat = {
... ... @@ -461,5 +463,19 @@
461 463 #ifdef CONFIG_VIDEO_MXS
462 464 lcdif_power_down();
463 465 #endif
  466 +}
  467 +
  468 +void reset_cpu(ulong addr)
  469 +{
  470 + struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
  471 +
  472 + /* Clear WDA to trigger WDOG_B immediately */
  473 + writew((WCR_WDE | WCR_SRS), &wdog->wcr);
  474 +
  475 + while (1) {
  476 + /*
  477 + * spin for .5 seconds before reset
  478 + */
  479 + }
464 480 }