drivers/intel/fsp2_0: Add simple reset handler
Any FSP API call may request a reset. This is indicated in API function return code. Add trivial reset handler code. BUG=chrome-os-partner:54149 BRANCH=none TEST=none Change-Id: Ieb5e2d52ffdaf3c3ed416603f6dbb4f9c25a1a7b Signed-off-by: Andrey Petrov <andrey.petrov@intel.com> Reviewed-on: https://review.coreboot.org/15334 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
committed by
Martin Roth
parent
3dbea29ee6
commit
901e43c904
@ -18,6 +18,7 @@
|
||||
#include <lib.h>
|
||||
#include <memrange.h>
|
||||
#include <program_loading.h>
|
||||
#include <reset.h>
|
||||
#include <string.h>
|
||||
|
||||
static bool looks_like_fsp_header(const uint8_t *raw_hdr)
|
||||
@ -160,3 +161,26 @@ enum cb_err fsp_load_binary(struct fsp_header *hdr,
|
||||
|
||||
return CB_SUCCESS;
|
||||
}
|
||||
|
||||
void fsp_handle_reset(enum fsp_status status)
|
||||
{
|
||||
switch(status) {
|
||||
case FSP_STATUS_RESET_REQUIRED_COLD:
|
||||
hard_reset();
|
||||
break;
|
||||
case FSP_STATUS_RESET_REQUIRED_WARM:
|
||||
soft_reset();
|
||||
break;
|
||||
case FSP_STATUS_RESET_REQUIRED_GLOBAL_RESET:
|
||||
global_reset();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool fsp_reset_requested(enum fsp_status status)
|
||||
{
|
||||
return (status >= FSP_STATUS_RESET_REQUIRED_COLD &&
|
||||
status <= FSP_STATUS_RESET_REQUIRED_GLOBAL_RESET);
|
||||
}
|
||||
|
Reference in New Issue
Block a user