]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/keymile/kmp204x/qrio.c
kmp204x/qrio: prepare support for the CPU watchdog reset reason
[karo-tx-uboot.git] / board / keymile / kmp204x / qrio.c
index b6ba93ada8f0bebd6d583d9ca85a3508d862b2c0..92e80227315c4306eeeef017a425684a271b18cc 100644 (file)
@@ -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);
+}