summaryrefslogtreecommitdiff
path: root/board/renesas/common/rza1-common.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-07-10 16:44:08 -0600
committerTom Rini <trini@konsulko.com>2025-07-10 16:44:08 -0600
commit6bb0679377abb01a82db1ce69b5bf1d40aa02ace (patch)
tree1049a2319a61e7caaff8cbca3ca4b082075dfcfe /board/renesas/common/rza1-common.c
parentf074616014179eefbca6f4b86b1fa6336711ba80 (diff)
parent25adecf09467c6a2823bcdfaf3fb0b59b2389669 (diff)
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh
- SH Ether clean ups, RZ/A1 clean ups, RZ/A1 Genmai support - Gen3 EEPROM DT node clean up - V4H SA0 BootROM compatible binman etype, SCIF compatible SREC generation for Gen4
Diffstat (limited to 'board/renesas/common/rza1-common.c')
-rw-r--r--board/renesas/common/rza1-common.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/board/renesas/common/rza1-common.c b/board/renesas/common/rza1-common.c
new file mode 100644
index 00000000000..5027319a58a
--- /dev/null
+++ b/board/renesas/common/rza1-common.c
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2017 Renesas Electronics
+ * Copyright (C) Chris Brandt
+ */
+
+#include <init.h>
+#include <asm/io.h>
+
+#define RZA1_WDT_BASE 0xfcfe0000
+#define WTCSR 0x00
+#define WTCNT 0x02
+#define WRCSR 0x04
+
+void __weak reset_cpu(void)
+{
+ /* Dummy read (must read WRCSR:WOVF at least once before clearing) */
+ readb(RZA1_WDT_BASE + WRCSR);
+
+ writew(0xa500, RZA1_WDT_BASE + WRCSR);
+ writew(0x5a5f, RZA1_WDT_BASE + WRCSR);
+ writew(0x5a00, RZA1_WDT_BASE + WTCNT);
+ writew(0xa578, RZA1_WDT_BASE + WTCSR);
+
+ for (;;)
+ asm volatile("wfi");
+}