[coreboot-gerrit] New patch to review for coreboot: driver/intel/fsp2_0: Limit reset handling logic to spec

Andrey Petrov (andrey.petrov@intel.com) gerrit at coreboot.org
Mon Jul 18 19:17:41 CEST 2016


Andrey Petrov (andrey.petrov at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15730

-gerrit

commit d4e3fb213a060787cfd083571ee3485aa33b6026
Author: Andrey Petrov <andrey.petrov at intel.com>
Date:   Mon Jul 18 00:15:41 2016 -0700

    driver/intel/fsp2_0: Limit reset handling logic to spec
    
    FSP 2.0 spec only defines 2 reset request (COLD, WARM) exit codes. The
    rest 6 codes are platform-specific and may vary. Modify helper so that
    only basic types are handled and let SoC code deal with others.
    
    Change-Id: Ib2f446e0449301407b135933a2088bcffc3ac32a
    Signed-off-by: Andrey Petrov <andrey.petrov at intel.com>
---
 src/drivers/intel/fsp2_0/include/fsp/api.h  |  9 ++++++---
 src/drivers/intel/fsp2_0/include/fsp/util.h |  2 +-
 src/drivers/intel/fsp2_0/util.c             | 12 +++++-------
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/drivers/intel/fsp2_0/include/fsp/api.h b/src/drivers/intel/fsp2_0/include/fsp/api.h
index aa45d97..2fd576d 100644
--- a/src/drivers/intel/fsp2_0/include/fsp/api.h
+++ b/src/drivers/intel/fsp2_0/include/fsp/api.h
@@ -23,9 +23,12 @@ enum fsp_status {
 	FSP_SUCCESS = 0x00000000,
 	FSP_STATUS_RESET_REQUIRED_COLD = 0x40000001,
 	FSP_STATUS_RESET_REQUIRED_WARM = 0x40000002,
-	FSP_STATUS_RESET_REQUIRED_SHUTDOWN = 0x40000003,
-	FSP_STATUS_RESET_REQUIRED_UNDEFINED = 0x40000004,
-	FSP_STATUS_RESET_REQUIRED_GLOBAL_RESET = 0x40000005,
+	FSP_STATUS_RESET_REQUIRED_3 = 0x40000003,
+	FSP_STATUS_RESET_REQUIRED_4 = 0x40000004,
+	FSP_STATUS_RESET_REQUIRED_5 = 0x40000005,
+	FSP_STATUS_RESET_REQUIRED_6 = 0x40000006,
+	FSP_STATUS_RESET_REQUIRED_7 = 0x40000007,
+	FSP_STATUS_RESET_REQUIRED_8 = 0x40000008,
 	FSP_INVALID_PARAMETER = 0x80000002,
 	FSP_UNSUPPORTED = 0x80000003,
 	FSP_NOT_READY = 0x80000006,
diff --git a/src/drivers/intel/fsp2_0/include/fsp/util.h b/src/drivers/intel/fsp2_0/include/fsp/util.h
index d546c11..ad5d4be 100644
--- a/src/drivers/intel/fsp2_0/include/fsp/util.h
+++ b/src/drivers/intel/fsp2_0/include/fsp/util.h
@@ -41,7 +41,7 @@ enum cb_err fsp_load_binary(struct fsp_header *hdr, const char *name,
 uintptr_t fsp_load_vbt(void);
 
 /* Trivial handling of reset exit statuses */
-void fsp_handle_reset(enum fsp_status status);
+bool fsp_handle_reset(enum fsp_status status);
 /* Returns true if the non-success status is a reset request */
 bool fsp_reset_requested(enum fsp_status status);
 
diff --git a/src/drivers/intel/fsp2_0/util.c b/src/drivers/intel/fsp2_0/util.c
index b47b898..4bb49d2 100644
--- a/src/drivers/intel/fsp2_0/util.c
+++ b/src/drivers/intel/fsp2_0/util.c
@@ -162,25 +162,23 @@ enum cb_err fsp_load_binary(struct fsp_header *hdr,
 	return CB_SUCCESS;
 }
 
-void fsp_handle_reset(enum fsp_status status)
+bool fsp_handle_reset(enum fsp_status status)
 {
 	switch(status) {
 	case FSP_STATUS_RESET_REQUIRED_COLD:
 		hard_reset();
-		break;
+		return true;
 	case FSP_STATUS_RESET_REQUIRED_WARM:
 		soft_reset();
-		break;
-	case FSP_STATUS_RESET_REQUIRED_GLOBAL_RESET:
-		global_reset();
-		break;
+		return true;
 	default:
 		break;
 	}
+	return false;
 }
 
 bool fsp_reset_requested(enum fsp_status status)
 {
 	return (status >= FSP_STATUS_RESET_REQUIRED_COLD &&
-		status <= FSP_STATUS_RESET_REQUIRED_GLOBAL_RESET);
+		status <= FSP_STATUS_RESET_REQUIRED_8);
 }



More information about the coreboot-gerrit mailing list