1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <console/console.h>
6 #include <intelblocks/pmclib.h>
8 #include <soc/intel/common/reset.h>
12 #define CSE_WAIT_MAX_MS 1000
14 void do_global_reset(void)
16 pmc_global_reset_enable(1);
20 void cf9_reset_prepare(void)
25 * If CSE state is something else than 'normal', it is probably in some
26 * recovery state. In this case there is no point in waiting for it to
27 * get ready so we cross fingers and reset.
29 if (!heci_cse_normal()) {
30 printk(BIOS_DEBUG
, "CSE is not in normal state, resetting\n");
34 /* Reset if CSE is ready */
38 printk(BIOS_SPEW
, "CSE is not yet ready, waiting\n");
39 stopwatch_init_msecs_expire(&sw
, CSE_WAIT_MAX_MS
);
40 while (!heci_cse_done()) {
41 if (stopwatch_expired(&sw
)) {
42 printk(BIOS_SPEW
, "CSE timed out. Resetting\n");
47 printk(BIOS_SPEW
, "CSE took %lld ms\n", stopwatch_duration_msecs(&sw
));