summaryrefslogtreecommitdiff
path: root/board/keymile/kmp204x/kmp204x.c
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2014-08-11 10:21:03 +0200
committerStefano Babic <sbabic@denx.de>2014-08-11 10:21:03 +0200
commite82abaeb7f2a0833fccf90460c48b9f2100258f8 (patch)
treede701f5c90b7373966412d566b5c00d3837954bc /board/keymile/kmp204x/kmp204x.c
parentf93f21906e374d46c6abfbdf4eb9cb1ab51b6384 (diff)
parent1899fac925eda817e12234aef3d01d354788662e (diff)
downloadu-boot-imx-e82abaeb7f2a0833fccf90460c48b9f2100258f8.zip
u-boot-imx-e82abaeb7f2a0833fccf90460c48b9f2100258f8.tar.gz
u-boot-imx-e82abaeb7f2a0833fccf90460c48b9f2100258f8.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-arm
Conflicts: boards.cfg Signed-off-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'board/keymile/kmp204x/kmp204x.c')
-rw-r--r--board/keymile/kmp204x/kmp204x.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/board/keymile/kmp204x/kmp204x.c b/board/keymile/kmp204x/kmp204x.c
index 6bc8eb8..cd08379 100644
--- a/board/keymile/kmp204x/kmp204x.c
+++ b/board/keymile/kmp204x/kmp204x.c
@@ -80,14 +80,29 @@ int get_scl(void)
#define ZL30158_RST 8
#define BFTIC4_RST 0
+#define RSTRQSR1_WDT_RR 0x00200000
+#define RSTRQSR1_SW_RR 0x00100000
int board_early_init_f(void)
{
ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+ bool cpuwd_flag = false;
+
+ /* configure mode for uP reset request */
+ qrio_uprstreq(UPREQ_CORE_RST);
/* board only uses the DDR_MCK0, so disable the DDR_MCK1/2/3 */
setbits_be32(&gur->ddrclkdr, 0x001f000f);
+ /* set reset reason according CPU register */
+ if ((gur->rstrqsr1 & (RSTRQSR1_WDT_RR | RSTRQSR1_SW_RR)) ==
+ RSTRQSR1_WDT_RR)
+ cpuwd_flag = true;
+
+ qrio_cpuwd_flag(cpuwd_flag);
+ /* clear CPU bits by writing 1 */
+ setbits_be32(&gur->rstrqsr1, RSTRQSR1_WDT_RR | RSTRQSR1_SW_RR);
+
/* set the BFTIC's prstcfg to reset at power-up and unit reset only */
qrio_prstcfg(BFTIC4_RST, PRSTCFG_POWUP_UNIT_RST);
/* and enable WD on it */