blob: 8bf9db583048442156691587ae46245c4f96ce70 [file] [log] [blame]
Angel Pons3bd1e3d2020-04-05 15:47:17 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Rizwan Qureshi1222a732016-08-23 14:31:23 +05302
Furquan Shaikhb13bd1e2020-09-21 22:44:27 +00003#include <cf9_reset.h>
Furquan Shaikhb13bd1e2020-09-21 22:44:27 +00004#include <intelblocks/pmclib.h>
Patrick Rudolphf677d172018-10-01 19:17:11 +02005#include <soc/intel/common/reset.h>
Furquan Shaikhb13bd1e2020-09-21 22:44:27 +00006#include <soc/me.h>
7#include <soc/pm.h>
8
9static void do_force_global_reset(void)
10{
11 /*
12 * BIOS should ensure it does a global reset
13 * to reset both host and Intel ME by setting
14 * PCH PMC [B0:D31:F2 register offset 0xAC bit 20]
15 */
16 pmc_global_reset_enable(true);
17
18 /* Now BIOS can write 0x06 or 0x0E to 0xCF9 port
19 * to global reset platform */
20 do_full_reset();
21}
22
23void do_global_reset(void)
24{
25 if (!send_global_reset()) {
26 /* If ME unable to reset platform then
27 * force global reset using PMC CF9GR register*/
28 do_force_global_reset();
29 }
30}