From e7a1e7d3c49e980774985f3f6fae697dcb129420 Mon Sep 17 00:00:00 2001 From: Lijian Zhao Date: Mon, 9 Oct 2017 18:39:30 -0700 Subject: soc/intel/cannonlake: Fix HECI error on reset Move HECI init from bootblock to romstage, the HECI bar saved by CAR_GLOBAL, which will be lost on different stage. HECI BAR in ramstage will be read back from PCI. Also add fail safe option to reset in case of HECI command not successful. TEST= Force global reset from FSP and read back HECI bar in debug print. Change-Id: I46c4b8db0a80995fa05e92d61357128c2a77de4b Signed-off-by: Lijian Zhao Reviewed-on: https://review.coreboot.org/21930 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/soc/intel/cannonlake/bootblock/pch.c | 3 --- src/soc/intel/cannonlake/include/soc/iomap.h | 2 +- src/soc/intel/cannonlake/reset.c | 9 +++++---- src/soc/intel/cannonlake/romstage/romstage.c | 4 ++++ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/soc/intel/cannonlake/bootblock/pch.c b/src/soc/intel/cannonlake/bootblock/pch.c index 091e6f7cbc..0deece6521 100644 --- a/src/soc/intel/cannonlake/bootblock/pch.c +++ b/src/soc/intel/cannonlake/bootblock/pch.c @@ -15,7 +15,6 @@ */ #include -#include #include #include #include @@ -194,6 +193,4 @@ void pch_early_init(void) smbus_common_init(); enable_rtc_upper_bank(); - - heci_init(HECI1_BASE_ADDRESS); } diff --git a/src/soc/intel/cannonlake/include/soc/iomap.h b/src/soc/intel/cannonlake/include/soc/iomap.h index add5ee8a75..22430f055b 100644 --- a/src/soc/intel/cannonlake/include/soc/iomap.h +++ b/src/soc/intel/cannonlake/include/soc/iomap.h @@ -63,7 +63,7 @@ #define GPIO_BASE_SIZE 0x10000 -#define HECI1_BASE_ADDRESS 0xFEDA2000 +#define HECI1_BASE_ADDRESS 0xfeda2000 /* PTT registers */ #define PTT_TXT_BASE_ADDRESS 0xfed30800 diff --git a/src/soc/intel/cannonlake/reset.c b/src/soc/intel/cannonlake/reset.c index ca82bd6ac4..8192e89029 100644 --- a/src/soc/intel/cannonlake/reset.c +++ b/src/soc/intel/cannonlake/reset.c @@ -16,10 +16,12 @@ #include #include #include +#include #include #include #include #include +#include /* Reset Request */ #define MKHI_GLOBAL_RESET 0x0b @@ -82,10 +84,9 @@ void do_global_reset(void) { /* Ask CSE to do the global reset */ send_heci_reset_message(); - /* - * TODO: Presumbily we shouldn't return. But if we did, fallback to - * alternative way of triggered global reset provided by pmclib. - */ + /* global reset if CSE fail to reset */ + pmc_global_reset_enable(1); + hard_reset(); } void chipset_handle_reset(uint32_t status) diff --git a/src/soc/intel/cannonlake/romstage/romstage.c b/src/soc/intel/cannonlake/romstage/romstage.c index eb72a25ea0..94b54a66d3 100644 --- a/src/soc/intel/cannonlake/romstage/romstage.c +++ b/src/soc/intel/cannonlake/romstage/romstage.c @@ -21,8 +21,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -41,6 +43,8 @@ asmlinkage void car_stage_entry(void) /* Program MCHBAR, DMIBAR, GDXBAR and EDRAMBAR */ systemagent_early_init(); + /* initialize Heci interface */ + heci_init(HECI1_BASE_ADDRESS); timestamp_add_now(TS_START_ROMSTAGE); s3wake = pmc_fill_power_state(ps) == ACPI_S3; -- cgit v1.2.3