Felix Held | 44f4153 | 2020-12-09 02:01:16 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <arch/io.h> |
| 4 | #include <cf9_reset.h> |
| 5 | #include <reset.h> |
Felix Held | 44f4153 | 2020-12-09 02:01:16 +0100 | [diff] [blame] | 6 | #include <soc/southbridge.h> |
| 7 | #include <amdblocks/acpimmio.h> |
| 8 | #include <amdblocks/reset.h> |
| 9 | |
Felix Held | 44f4153 | 2020-12-09 02:01:16 +0100 | [diff] [blame] | 10 | void do_cold_reset(void) |
| 11 | { |
| 12 | /* De-assert and then assert all PwrGood signals on CF9 reset. */ |
| 13 | pm_write16(PWR_RESET_CFG, pm_read16(PWR_RESET_CFG) | |
| 14 | TOGGLE_ALL_PWR_GOOD); |
| 15 | outb(RST_CPU | SYS_RST, RST_CNT); |
| 16 | } |
| 17 | |
| 18 | void do_warm_reset(void) |
| 19 | { |
Marshall Dawson | 3e1943e | 2021-05-06 16:08:09 -0600 | [diff] [blame] | 20 | /* Warm resets are not supported and must be executed as cold */ |
| 21 | pm_write16(PWR_RESET_CFG, pm_read16(PWR_RESET_CFG) | |
| 22 | TOGGLE_ALL_PWR_GOOD); |
Felix Held | 44f4153 | 2020-12-09 02:01:16 +0100 | [diff] [blame] | 23 | outb(RST_CPU | SYS_RST, RST_CNT); |
| 24 | } |
| 25 | |
| 26 | void do_board_reset(void) |
| 27 | { |
Felix Held | 44f4153 | 2020-12-09 02:01:16 +0100 | [diff] [blame] | 28 | do_cold_reset(); |
| 29 | } |