soc: Remove copyright notices
[coreboot.git] / src / soc / amd / picasso / reset.c
blob5c62a4990fb0db0b4f8a4b9599d0e3c48da7a118
1 /*
2 * This file is part of the coreboot project.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
15 #include <arch/io.h>
16 #include <reset.h>
17 #include <soc/northbridge.h>
18 #include <soc/pci_devs.h>
19 #include <device/pci_ops.h>
20 #include <soc/southbridge.h>
21 #include <amdblocks/acpimmio.h>
22 #include <amdblocks/reset.h>
24 void set_warm_reset_flag(void)
26 uint8_t ncp = inw(NCP_ERR);
28 outb(NCP_ERR, ncp | NCP_WARM_BOOT);
31 int is_warm_reset(void)
33 return !!(inb(NCP_ERR) & NCP_WARM_BOOT);
36 void do_cold_reset(void)
38 /* De-assert and then assert all PwrGood signals on CF9 reset. */
39 pm_write16(PWR_RESET_CFG, pm_read16(PWR_RESET_CFG) |
40 TOGGLE_ALL_PWR_GOOD);
41 outb(RST_CMD | SYS_RST, SYS_RESET);
44 void do_warm_reset(void)
46 set_warm_reset_flag();
48 /* Assert reset signals only. */
49 outb(RST_CMD | SYS_RST, SYS_RESET);
52 void do_board_reset(void)
54 /* TODO: Would a warm_reset() suffice? */
55 do_cold_reset();