Angel Pons | ae59387 | 2020-04-04 18:50:57 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 2 | |
| 3 | #include <arch/io.h> |
Felix Held | 5d7fa16 | 2020-12-09 02:18:00 +0100 | [diff] [blame] | 4 | #include <cf9_reset.h> |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 5 | #include <reset.h> |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 6 | #include <soc/southbridge.h> |
| 7 | #include <amdblocks/acpimmio.h> |
| 8 | #include <amdblocks/reset.h> |
| 9 | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 10 | void do_cold_reset(void) |
| 11 | { |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 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); |
Felix Held | 5d7fa16 | 2020-12-09 02:18:00 +0100 | [diff] [blame] | 15 | outb(RST_CPU | SYS_RST, RST_CNT); |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 16 | } |
| 17 | |
| 18 | void do_warm_reset(void) |
| 19 | { |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 20 | /* Assert reset signals only. */ |
Felix Held | 5d7fa16 | 2020-12-09 02:18:00 +0100 | [diff] [blame] | 21 | outb(RST_CPU | SYS_RST, RST_CNT); |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | void do_board_reset(void) |
| 25 | { |
| 26 | /* TODO: Would a warm_reset() suffice? */ |
| 27 | do_cold_reset(); |
| 28 | } |