diff options
author | Tom Rini <trini@ti.com> | 2014-08-04 13:35:50 -0400 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-08-06 08:38:18 -0400 |
commit | dcdb61a084bd3840d0987a5d01ae506c11efca1b (patch) | |
tree | 576fed73a7425aff29b2833ea7a132a1fc373c43 /board/keymile/kmp204x/qrio.c | |
parent | aa159e681ec22a19ee4dd68ad4ec08b748e14d10 (diff) | |
parent | e3917b21c05776b41663bdfcc7666aca11a381a0 (diff) | |
download | u-boot-dcdb61a084bd3840d0987a5d01ae506c11efca1b.tar.gz u-boot-dcdb61a084bd3840d0987a5d01ae506c11efca1b.tar.xz u-boot-dcdb61a084bd3840d0987a5d01ae506c11efca1b.zip |
Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
Diffstat (limited to 'board/keymile/kmp204x/qrio.c')
-rw-r--r-- | board/keymile/kmp204x/qrio.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/board/keymile/kmp204x/qrio.c b/board/keymile/kmp204x/qrio.c index b6ba93ada8..edf3bf11a8 100644 --- a/board/keymile/kmp204x/qrio.c +++ b/board/keymile/kmp204x/qrio.c @@ -173,3 +173,35 @@ 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); +} + +#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); +} |