[coreboot-gerrit] New patch to review for coreboot: soc/intel/apollolake: Add handling of global reset
Andrey Petrov (andrey.petrov@intel.com)
gerrit at coreboot.org
Tue Jun 21 02:04:36 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/15280
-gerrit
commit 12f045657516de663edfa01760e513c337c9166b
Author: Andrey Petrov <andrey.petrov at intel.com>
Date: Thu Jun 16 20:14:58 2016 -0700
soc/intel/apollolake: Add handling of global reset
Add basic handling of FSP reset return codes and use them in
FspNotify stage.
BUG=chrome-os-partner:54149
BRANCH=none
TEST=with FSP that returns reset codes, do cold boot, check
that reboot sequence occurs properly.
Change-Id: I55542aa37e60edb17ca24ac358b61df72679b83e
Signed-off-by: Andrey Petrov <andrey.petrov at intel.com>
---
src/soc/intel/apollolake/chip.c | 8 ++++++--
src/soc/intel/apollolake/include/soc/reset.h | 2 ++
src/soc/intel/apollolake/reset.c | 15 +++++++++++++++
3 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/src/soc/intel/apollolake/chip.c b/src/soc/intel/apollolake/chip.c
index a19dd3c..434fcdc 100644
--- a/src/soc/intel/apollolake/chip.c
+++ b/src/soc/intel/apollolake/chip.c
@@ -32,6 +32,7 @@
#include <soc/nvs.h>
#include <soc/pci_devs.h>
#include <soc/pm.h>
+#include <soc/reset.h>
#include "chip.h"
@@ -156,9 +157,12 @@ static void fsp_notify_dummy(void *arg)
{
enum fsp_notify_phase ph = (enum fsp_notify_phase) arg;
+ enum fsp_status ret;
- if (fsp_notify(ph) != FSP_SUCCESS)
- printk(BIOS_CRIT, "FspNotify failed!\n");
+ if ((ret = fsp_notify(ph)) != FSP_SUCCESS)
+ printk(BIOS_CRIT, "FspNotify failed, %x!\n", ret);
+
+ handle_fsp_reset(ret);
/* Call END_OF_FIRMWARE Notify after READY_TO_BOOT Notify */
if (ph == READY_TO_BOOT)
fsp_notify_dummy((void *)END_OF_FIRMWARE);
diff --git a/src/soc/intel/apollolake/include/soc/reset.h b/src/soc/intel/apollolake/include/soc/reset.h
index 3049aef..9975cef 100644
--- a/src/soc/intel/apollolake/include/soc/reset.h
+++ b/src/soc/intel/apollolake/include/soc/reset.h
@@ -17,8 +17,10 @@
#ifndef _SOC_APOLLOLAKE_RESET_H_
#define _SOC_APOLLOLAKE_RESET_H_
+#include <fsp/api.h>
#include <reset.h>
void global_reset(void);
+void handle_fsp_reset(enum fsp_status status);
#endif
diff --git a/src/soc/intel/apollolake/reset.c b/src/soc/intel/apollolake/reset.c
index 1bd6e4a..236f4ae 100644
--- a/src/soc/intel/apollolake/reset.c
+++ b/src/soc/intel/apollolake/reset.c
@@ -17,6 +17,7 @@
#include <arch/hlt.h>
#include <arch/io.h>
+#include <fsp/api.h>
#include <halt.h>
#include <soc/pm.h>
#include <soc/reset.h>
@@ -53,3 +54,17 @@ void global_reset(void)
hard_reset();
halt();
}
+
+void handle_fsp_reset(enum fsp_status status)
+{
+ switch(status) {
+ case FSP_STATUS_RESET_REQUIRED_COLD:
+ hard_reset();
+ case FSP_STATUS_RESET_REQUIRED_WARM:
+ soft_reset();
+ case FSP_STATUS_RESET_REQUIRED_GLOBAL_RESET:
+ global_reset();
+ default:
+ break;
+ }
+}
More information about the coreboot-gerrit
mailing list