1 /* SPDX-License-Identifier: GPL-2.0-only */
6 #include <soc/northbridge.h>
7 #include <soc/pci_devs.h>
8 #include <device/pci_ops.h>
9 #include <soc/southbridge.h>
10 #include <amdblocks/acpimmio.h>
11 #include <amdblocks/reset.h>
13 void set_warm_reset_flag(void)
16 htic
= pci_read_config32(SOC_HT_DEV
, HT_INIT_CONTROL
);
17 htic
|= HTIC_COLD_RST_DET
;
18 pci_write_config32(SOC_HT_DEV
, HT_INIT_CONTROL
, htic
);
21 int is_warm_reset(void)
24 htic
= pci_read_config32(SOC_HT_DEV
, HT_INIT_CONTROL
);
25 return !!(htic
& HTIC_COLD_RST_DET
);
28 /* Clear bits 5, 9 & 10, used to signal the reset type */
29 static void clear_bios_reset(void)
32 htic
= pci_read_config32(SOC_HT_DEV
, HT_INIT_CONTROL
);
33 htic
&= ~HTIC_BIOSR_DETECT
;
34 pci_write_config32(SOC_HT_DEV
, HT_INIT_CONTROL
, htic
);
37 void do_cold_reset(void)
41 /* De-assert and then assert all PwrGood signals on CF9 reset. */
42 pm_write16(PWR_RESET_CFG
, pm_read16(PWR_RESET_CFG
) |
44 outb(RST_CPU
| SYS_RST
, RST_CNT
);
47 void do_warm_reset(void)
49 set_warm_reset_flag();
52 /* Assert reset signals only. */
53 outb(RST_CPU
| SYS_RST
, RST_CNT
);
56 void do_board_reset(void)
58 /* TODO: Would a warm_reset() suffice? */