summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoschung, Rainer <Rainer.Boschung@keymile.com>2014-06-03 09:05:19 +0200
committerYork Sun <yorksun@freescale.com>2014-08-01 14:18:53 -0700
commit6caa185abd8bc42362c576a571792d5c63fa349d (patch)
tree24dad9a459c54a2c05ac48c0203d122018b3fdd7
parenta09f470d49c4a6355f16fee6455d964211021e3d (diff)
downloadu-boot-imx-6caa185abd8bc42362c576a571792d5c63fa349d.zip
u-boot-imx-6caa185abd8bc42362c576a571792d5c63fa349d.tar.gz
u-boot-imx-6caa185abd8bc42362c576a571792d5c63fa349d.tar.bz2
kmp204x/qrio: support for setting the CPU reset request mode
To acheive this, the qrio_uprstreq() function that sets the UPRSTREQN flag in the qrio RESCNF 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>
-rw-r--r--board/keymile/kmp204x/kmp204x.h5
-rw-r--r--board/keymile/kmp204x/qrio.c17
2 files changed, 22 insertions, 0 deletions
diff --git a/board/keymile/kmp204x/kmp204x.h b/board/keymile/kmp204x/kmp204x.h
index 64c0afb..e90e8ab 100644
--- a/board/keymile/kmp204x/kmp204x.h
+++ b/board/keymile/kmp204x/kmp204x.h
@@ -27,4 +27,9 @@ void qrio_enable_app_buffer(void);
void qrio_cpuwd_flag(bool flag);
int qrio_reset_reason(void);
+#define UPREQ_UNIT_RST 0x0
+#define UPREQ_CORE_RST 0x1
+
+void qrio_uprstreq(u8 mode);
+
void pci_of_setup(void *blob, bd_t *bd);
diff --git a/board/keymile/kmp204x/qrio.c b/board/keymile/kmp204x/qrio.c
index 92e8022..edf3bf1 100644
--- a/board/keymile/kmp204x/qrio.c
+++ b/board/keymile/kmp204x/qrio.c
@@ -188,3 +188,20 @@ void qrio_cpuwd_flag(bool flag)
reason1 &= ~REASON1_CPUWD;
out_8(qrio_base + REASON1_OFF, reason1);
}
+
+#define RSTCFG_OFF 0x11
+
+void qrio_uprstreq(u8 mode)
+{
+ u32 rstcfg;
+ void __iomem *qrio_base = (void *)CONFIG_SYS_QRIO_BASE;
+
+ rstcfg = in_8(qrio_base + RSTCFG_OFF);
+
+ if (mode & UPREQ_CORE_RST)
+ rstcfg |= UPREQ_CORE_RST;
+ else
+ rstcfg &= ~UPREQ_CORE_RST;
+
+ out_8(qrio_base + RSTCFG_OFF, rstcfg);
+}