summaryrefslogtreecommitdiff
path: root/board/keymile
diff options
context:
space:
mode:
authorBoschung, Rainer <Rainer.Boschung@keymile.com>2014-06-03 09:05:17 +0200
committerYork Sun <yorksun@freescale.com>2014-08-01 14:18:40 -0700
commit807d93d6de5f54cfdcc98bb6c392b2b1f4237dc8 (patch)
treeec5aaf23ced4ca4b7239f61cab488ef0d9d36759 /board/keymile
parent88ac6ffabbe741b67ea94e33894fb1fdca57e776 (diff)
kmp204x/qrio: prepare support for the CPU watchdog reset reason
To achieve this, the qrio_cpuwd_flag() function that sets the CPU watchdog flag in the REASON1 reg is added. Signed-off-by: Rainer Boschung <rainer.boschung@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com> Reviewed-by: York Sun <yorksun@freescale.com>
Diffstat (limited to 'board/keymile')
-rw-r--r--board/keymile/kmp204x/kmp204x.h2
-rw-r--r--board/keymile/kmp204x/qrio.c15
2 files changed, 17 insertions, 0 deletions
diff --git a/board/keymile/kmp204x/kmp204x.h b/board/keymile/kmp204x/kmp204x.h
index afede994f17..64c0afb1be9 100644
--- a/board/keymile/kmp204x/kmp204x.h
+++ b/board/keymile/kmp204x/kmp204x.h
@@ -24,5 +24,7 @@ void qrio_wdmask(u8 bit, bool wden);
void qrio_prstcfg(u8 bit, u8 mode);
void qrio_set_leds(void);
void qrio_enable_app_buffer(void);
+void qrio_cpuwd_flag(bool flag);
+int qrio_reset_reason(void);
void pci_of_setup(void *blob, bd_t *bd);
diff --git a/board/keymile/kmp204x/qrio.c b/board/keymile/kmp204x/qrio.c
index b6ba93ada8f..92e80227315 100644
--- a/board/keymile/kmp204x/qrio.c
+++ b/board/keymile/kmp204x/qrio.c
@@ -173,3 +173,18 @@ void qrio_enable_app_buffer(void)
ctrll |= (CTRLL_WRB_BUFENA);
out_8(qrio_base + CTRLL_OFF, ctrll);
}
+
+#define REASON1_OFF 0x12
+#define REASON1_CPUWD 0x01
+
+void qrio_cpuwd_flag(bool flag)
+{
+ u8 reason1;
+ void __iomem *qrio_base = (void *)CONFIG_SYS_QRIO_BASE;
+ reason1 = in_8(qrio_base + REASON1_OFF);
+ if (flag)
+ reason1 |= REASON1_CPUWD;
+ else
+ reason1 &= ~REASON1_CPUWD;
+ out_8(qrio_base + REASON1_OFF, reason1);
+}