summaryrefslogtreecommitdiff
path: root/src/soc/marvell/mvmap2315/include
diff options
context:
space:
mode:
authorHakim Giydan <hgiydan@marvell.com>2016-09-08 10:57:28 -0700
committerMartin Roth <martinroth@google.com>2016-09-13 16:58:52 +0200
commit34c835db307666385374670123477434c99473ec (patch)
tree3de1b82fc68c4f2a87cc9af9950c152c0def284e /src/soc/marvell/mvmap2315/include
parent78785e7c413ad18c96260c7a3cf5acc20103bbd2 (diff)
soc/marvell/mvmap2315: Add WDT driver
Testing: booted successfully. Change-Id: Ie9c9297f321c838f86e5536aab29f67a0eeb053d Signed-off-by: Hakim Giydan <hgiydan@marvell.com> Reviewed-on: https://review.coreboot.org/15519 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/soc/marvell/mvmap2315/include')
-rw-r--r--src/soc/marvell/mvmap2315/include/soc/addressmap.h2
-rw-r--r--src/soc/marvell/mvmap2315/include/soc/wdt.h55
2 files changed, 57 insertions, 0 deletions
diff --git a/src/soc/marvell/mvmap2315/include/soc/addressmap.h b/src/soc/marvell/mvmap2315/include/soc/addressmap.h
index 6380e7d21d..198e8d4374 100644
--- a/src/soc/marvell/mvmap2315/include/soc/addressmap.h
+++ b/src/soc/marvell/mvmap2315/include/soc/addressmap.h
@@ -31,6 +31,8 @@
#define MVMAP2315_GPIOF_BASE 0xE0142000
#define MVMAP2315_GPIOG_BASE 0xE0142100
#define MVMAP2315_GPIOH_BASE 0xE0142200
+#define MVMAP2315_WDT0_BASE 0XE1010000
+#define MVMAP2315_WDT1_BASE 0XE1020000
#define MVMAP2315_A2BUS_BANKED_BASE 0xF0000000
#define MVMAP2315_A2BUS_ALIAS6_BASE 0xF0002000
diff --git a/src/soc/marvell/mvmap2315/include/soc/wdt.h b/src/soc/marvell/mvmap2315/include/soc/wdt.h
new file mode 100644
index 0000000000..19715872ec
--- /dev/null
+++ b/src/soc/marvell/mvmap2315/include/soc/wdt.h
@@ -0,0 +1,55 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Marvell, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __SOC_MARVELL_MVMAP2315_WDT_H__
+#define __SOC_MARVELL_MVMAP2315_WDT_H__
+
+#include <stdint.h>
+
+#include <soc/addressmap.h>
+#include <types.h>
+
+#define MVMAP2315_R4_WDT 0
+#define MVMAP2315_AP_WDT 1
+
+#define MVMAP2315_WDT_CR_RPL_SHIFT 2
+#define MVMAP2315_WDT_CR_RMOD BIT(1)
+#define MVMAP2315_WDT_CR_EN BIT(0)
+#define MVMAP2315_WDT_TORR_TOP_SHIFT 0
+#define MVMAP2315_WDT_CRR_SHIFT 0
+struct mvmap2315_wdt_regs {
+ u32 wdt_cr;
+ u32 wdt_torr;
+ u32 wdt_ccvr;
+ u32 wdt_crr;
+ u32 wdt_stat;
+ u32 wdt_eoi;
+ u8 _reserved0[0xcc];
+ u32 wdt_comp_params_5;
+ u32 wdt_comp_params_4;
+ u32 wdt_comp_params_3;
+ u32 wdt_comp_params_2;
+ u32 wdt_comp_params_1;
+ u32 wdt_comp_version;
+ u32 wdt_comp_type;
+};
+
+check_member(mvmap2315_wdt_regs, wdt_comp_type, 0xfc);
+
+
+void enable_sp_watchdog(u32 timer, u32 timeout_value);
+void reset_sp_watchdog(u32 timer, u32 timeout_value);
+
+#endif /* __SOC_MARVELL_MVMAP2315_WDT_H__ */