]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mx6: Disable Power Down Bit of watchdog
authorFabio Estevam <fabio.estevam@freescale.com>
Thu, 7 Feb 2013 06:45:23 +0000 (06:45 +0000)
committerStefano Babic <sbabic@denx.de>
Tue, 12 Feb 2013 12:54:34 +0000 (13:54 +0100)
On a mx6qsabresd revision C board with rev1.2 mx6q, the system gets resetted
and it is not able to reach the Linux prompt.

Comparing the watchdog behaviour on a revB versus revC board:

- On a mx6qsabresd revB:

U-Boot > reset
resetting ...

U-Boot 2013.01-10524-g432a3aa-dirty (Feb 07 2013 - 13:34:46)

CPU:   Freescale i.MX6Q rev1.1 at 792 MHz
Reset cause: WDOG
...

- On a mx6qsabresd revC:

U-Boot > reset
resetting ...

U-Boot 2013.01-10524-g432a3aa-dirty (Feb 07 2013 - 13:34:46)

CPU:   Freescale i.MX6Q rev1.1 at 792 MHz
Reset cause: POR

So due to revC POR/watchdog circuitry whenever a watchdog occurs, it causes a POR.

Clearing the PDE - Power Down Enable bit of WMCR registers fixes the problem and
is also safe for all mx6 boards.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Acked-by: Stefano Babic <sbabic@denx.de>
arch/arm/cpu/armv7/mx6/soc.c
arch/arm/include/asm/arch-mx6/imx-regs.h

index a8aad5dd0a6c8548277021ebe8f6e159dbf31b9b..efe4136bc3b2f773cf2a28b449e9ce82d6e7a79f 100644 (file)
@@ -30,6 +30,7 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/imx-common/boot_mode.h>
+#include <stdbool.h>
 
 struct scu_regs {
        u32     ctrl;
@@ -121,12 +122,23 @@ void set_vddsoc(u32 mv)
        writel(reg, &anatop->reg_core);
 }
 
+static void imx_set_wdog_powerdown(bool enable)
+{
+       struct wdog_regs *wdog1 = (struct wdog_regs *)WDOG1_BASE_ADDR;
+       struct wdog_regs *wdog2 = (struct wdog_regs *)WDOG2_BASE_ADDR;
+
+       /* Write to the PDE (Power Down Enable) bit */
+       writew(enable, &wdog1->wmcr);
+       writew(enable, &wdog2->wmcr);
+}
+
 int arch_cpu_init(void)
 {
        init_aips();
 
        set_vddsoc(1200);       /* Set VDDSOC to 1.2V */
 
+       imx_set_wdog_powerdown(false); /* Disable PDE bit of WMCR register */
        return 0;
 }
 
index 3eb0081ca8088ac913ba46d5f6cdb6e5d0d5b1c1..eaa7439486a1f46ae78e7444f3df0985f9f79440 100644 (file)
@@ -601,5 +601,13 @@ struct iomuxc_base_regs {
        u32     daisy[104];     /* 0x7b0..94c */
 };
 
+struct wdog_regs {
+       u16     wcr;    /* Control */
+       u16     wsr;    /* Service */
+       u16     wrsr;   /* Reset Status */
+       u16     wicr;   /* Interrupt Control */
+       u16     wmcr;   /* Miscellaneous Control */
+};
+
 #endif /* __ASSEMBLER__*/
 #endif /* __ASM_ARCH_MX6_IMX_REGS_H__ */