Patrick Georgi | 11f0079 | 2020-03-04 15:10:45 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Nico Huber | 33fcaf9 | 2018-10-10 22:44:20 +0200 | [diff] [blame] | 2 | |
| 3 | #ifndef X86_CF9_RESET_H |
| 4 | #define X86_CF9_RESET_H |
| 5 | |
| 6 | /* Reset control port */ |
| 7 | #define RST_CNT 0xcf9 |
| 8 | #define FULL_RST (1 << 3) |
| 9 | #define RST_CPU (1 << 2) |
| 10 | #define SYS_RST (1 << 1) |
| 11 | |
| 12 | /* Implement the bare reset, i.e. write to cf9. */ |
| 13 | void do_system_reset(void); |
| 14 | void do_full_reset(void); |
| 15 | |
| 16 | /* Called by functions below before reset. */ |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 17 | #if CONFIG(HAVE_CF9_RESET_PREPARE) |
Nico Huber | 33fcaf9 | 2018-10-10 22:44:20 +0200 | [diff] [blame] | 18 | void cf9_reset_prepare(void); |
| 19 | #else |
| 20 | static inline void cf9_reset_prepare(void) {} |
| 21 | #endif |
| 22 | |
| 23 | /* Prepare for reset, run do_*_reset(), halt. */ |
| 24 | __noreturn void system_reset(void); |
| 25 | __noreturn void full_reset(void); |
| 26 | |
| 27 | #endif /* X86_CF9_RESET_H */ |