[coreboot-gerrit] New patch to review for coreboot: soc/intel/apollolake: Add SoC-specific reset handling

Andrey Petrov (andrey.petrov@intel.com) gerrit at coreboot.org
Mon Jul 18 19:17:42 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/15731

-gerrit

commit d1ce2e609e10c5da0044d71ef8a41e5e22d25b52
Author: Andrey Petrov <andrey.petrov at intel.com>
Date:   Mon Jul 18 08:21:13 2016 -0700

    soc/intel/apollolake: Add SoC-specific reset handling
    
    Modify reset handling so that basic reset types are handled by
    FSP utility function and SoC code deals with its own types.
    
    Change-Id: Icf3071ab3275905599d35d8523cd7ff314ce5082
    Signed-off-by: Andrey Petrov <andrey.petrov at intel.com>
---
 src/soc/intel/apollolake/chip.c              |  3 ++-
 src/soc/intel/apollolake/include/soc/reset.h | 25 +++++++++++++++++++++++++
 src/soc/intel/apollolake/reset.c             | 19 +++++++++++++++++++
 3 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/src/soc/intel/apollolake/chip.c b/src/soc/intel/apollolake/chip.c
index accc1bb..5670716 100644
--- a/src/soc/intel/apollolake/chip.c
+++ b/src/soc/intel/apollolake/chip.c
@@ -32,6 +32,7 @@
 #include <soc/itss.h>
 #include <soc/nvs.h>
 #include <soc/pci_devs.h>
+#include <soc/reset.h>
 #include <spi-generic.h>
 #include <soc/pm.h>
 #include <soc/p2sb.h>
@@ -418,7 +419,7 @@ static void fsp_notify_dummy(void *arg)
 	if ((ret = fsp_notify(ph)) != FSP_SUCCESS) {
 		printk(BIOS_CRIT, "FspNotify failed, ret = %x!\n", ret);
 		if (fsp_reset_requested(ret))
-			fsp_handle_reset(ret);
+			handle_reset(ret);
 	}
 	/* Call END_OF_FIRMWARE Notify after READY_TO_BOOT Notify */
 	if (ph == READY_TO_BOOT) {
diff --git a/src/soc/intel/apollolake/include/soc/reset.h b/src/soc/intel/apollolake/include/soc/reset.h
new file mode 100644
index 0000000..d886e37
--- /dev/null
+++ b/src/soc/intel/apollolake/include/soc/reset.h
@@ -0,0 +1,25 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Intel Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _SOC_APOLLOLAKE_RESET_H_
+#define _SOC_APOLLOLAKE_RESET_H_
+
+#include <fsp/api.h>
+#include <reset.h>
+
+bool handle_reset(enum fsp_status status);
+
+#endif /* _SOC_APOLLOLAKE_RESET_H_ */
diff --git a/src/soc/intel/apollolake/reset.c b/src/soc/intel/apollolake/reset.c
index a425510..f17b0a7 100644
--- a/src/soc/intel/apollolake/reset.c
+++ b/src/soc/intel/apollolake/reset.c
@@ -14,9 +14,12 @@
  */
 
 #include <console/console.h>
+#include <delay.h>
+#include <fsp/util.h>
 #include <reset.h>
 #include <soc/heci.h>
 #include <soc/pm.h>
+#include <soc/reset.h>
 #include <timer.h>
 
 #define CSE_WAIT_MAX_MS							1000
@@ -56,3 +59,19 @@ void reset_prepare(void)
 	}
 	printk(BIOS_SPEW, "CSE took %lu ms\n", stopwatch_duration_msecs(&sw));
 }
+
+bool handle_reset(enum fsp_status status)
+{
+	/* Let generic handler deal with it first */
+	if (fsp_handle_reset(status))
+		return true;
+
+	switch(status) {
+	case FSP_STATUS_RESET_REQUIRED_5: /* Global reset */
+		global_reset();
+		return true;
+	default:
+		break;
+	}
+	return false;
+}



More information about the coreboot-gerrit mailing list