aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86/include/cf9_reset.h
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2018-10-10 22:44:20 +0200
committerPatrick Georgi <pgeorgi@google.com>2018-10-22 08:35:08 +0000
commit33fcaf91ff825ad0adf0a2a483e6a296ed4e0e31 (patch)
tree0d4c9dfb483b0bdea6aa490bede17a6051337335 /src/arch/x86/include/cf9_reset.h
parent73c11194b0ea6a4fb93456fdff36cbd91838d4ec (diff)
arch/x86: Implement common CF9 reset
It's very common across many x86 silicon vendors, so place it in `arch/x86/`. Change-Id: I06c27afa31e5eecfdb7093c02f703bdaabf0594c Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/29054 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/arch/x86/include/cf9_reset.h')
-rw-r--r--src/arch/x86/include/cf9_reset.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/arch/x86/include/cf9_reset.h b/src/arch/x86/include/cf9_reset.h
new file mode 100644
index 0000000000..c0dcc92bd1
--- /dev/null
+++ b/src/arch/x86/include/cf9_reset.h
@@ -0,0 +1,40 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2017 Intel Corp.
+ *
+ * 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 X86_CF9_RESET_H
+#define X86_CF9_RESET_H
+
+/* Reset control port */
+#define RST_CNT 0xcf9
+#define FULL_RST (1 << 3)
+#define RST_CPU (1 << 2)
+#define SYS_RST (1 << 1)
+
+/* Implement the bare reset, i.e. write to cf9. */
+void do_system_reset(void);
+void do_full_reset(void);
+
+/* Called by functions below before reset. */
+#if IS_ENABLED(CONFIG_HAVE_CF9_RESET_PREPARE)
+void cf9_reset_prepare(void);
+#else
+static inline void cf9_reset_prepare(void) {}
+#endif
+
+/* Prepare for reset, run do_*_reset(), halt. */
+__noreturn void system_reset(void);
+__noreturn void full_reset(void);
+
+#endif /* X86_CF9_RESET_H */