summaryrefslogtreecommitdiff
path: root/src/drivers/intel
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/intel')
-rw-r--r--src/drivers/intel/fsp2_0/include/fsp/api.h9
-rw-r--r--src/drivers/intel/fsp2_0/include/fsp/util.h12
-rw-r--r--src/drivers/intel/fsp2_0/util.c26
3 files changed, 33 insertions, 14 deletions
diff --git a/src/drivers/intel/fsp2_0/include/fsp/api.h b/src/drivers/intel/fsp2_0/include/fsp/api.h
index 31137cc8f5..48cc54fb70 100644
--- a/src/drivers/intel/fsp2_0/include/fsp/api.h
+++ b/src/drivers/intel/fsp2_0/include/fsp/api.h
@@ -22,9 +22,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 f4638e5caa..9f4d67ae3f 100644
--- a/src/drivers/intel/fsp2_0/include/fsp/util.h
+++ b/src/drivers/intel/fsp2_0/include/fsp/util.h
@@ -42,9 +42,15 @@ enum cb_err fsp_validate_component(struct fsp_header *hdr,
/* Load a vbt.bin file for graphics. Returns 0 if a valid VBT is not found. */
uintptr_t fsp_load_vbt(void);
-/* Trivial handling of reset exit statuses */
+/*
+ * Handle FSP reboot request status. Chipset/soc is expected to provide
+ * chipset_handle_reset() that deals with reset type codes specific to given
+ * SoC. If the requested status is not a reboot status or unhandled, this
+ * function does nothing.
+ */
void 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);
+
+/* SoC/chipset must provide this to handle platform-specific reset codes */
+void chipset_handle_reset(enum fsp_status status);
#endif /* _FSP2_0_UTIL_H_ */
diff --git a/src/drivers/intel/fsp2_0/util.c b/src/drivers/intel/fsp2_0/util.c
index faf1dd3a02..1d3c744f32 100644
--- a/src/drivers/intel/fsp2_0/util.c
+++ b/src/drivers/intel/fsp2_0/util.c
@@ -134,8 +134,19 @@ enum cb_err fsp_validate_component(struct fsp_header *hdr,
return CB_SUCCESS;
}
+static bool fsp_reset_requested(enum fsp_status status)
+{
+ return (status >= FSP_STATUS_RESET_REQUIRED_COLD &&
+ status <= FSP_STATUS_RESET_REQUIRED_8);
+}
+
void fsp_handle_reset(enum fsp_status status)
{
+ if (!fsp_reset_requested(status))
+ return;
+
+ printk(BIOS_DEBUG, "FSP: handling reset type %x\n", status);
+
switch(status) {
case FSP_STATUS_RESET_REQUIRED_COLD:
hard_reset();
@@ -143,16 +154,15 @@ void fsp_handle_reset(enum fsp_status status)
case FSP_STATUS_RESET_REQUIRED_WARM:
soft_reset();
break;
- case FSP_STATUS_RESET_REQUIRED_GLOBAL_RESET:
- global_reset();
+ case FSP_STATUS_RESET_REQUIRED_3:
+ case FSP_STATUS_RESET_REQUIRED_4:
+ case FSP_STATUS_RESET_REQUIRED_5:
+ case FSP_STATUS_RESET_REQUIRED_6:
+ case FSP_STATUS_RESET_REQUIRED_7:
+ case FSP_STATUS_RESET_REQUIRED_8:
+ chipset_handle_reset(status);
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);
-}