summaryrefslogtreecommitdiff
path: root/src/southbridge/nvidia
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2017-05-18 16:03:26 -0700
committerJulius Werner <jwerner@chromium.org>2017-06-13 20:53:09 +0200
commit01f9aa5e54cf55ecca1b35185373835e61f10615 (patch)
tree8cd1ecb517bd948ac2dc2616de789a84a999a911 /src/southbridge/nvidia
parentd9762f70acc1cc2db5b3905756f5f5a995b9a21a (diff)
downloadcoreboot-01f9aa5e54cf55ecca1b35185373835e61f10615.tar.xz
Consolidate reset API, add generic reset_prepare mechanism
There are many good reasons why we may want to run some sort of generic callback before we're executing a reset. Unfortunateley, that is really hard right now: code that wants to reset simply calls the hard_reset() function (or one of its ill-differentiated cousins) which is directly implemented by a myriad of different mainboards, northbridges, SoCs, etc. More recent x86 SoCs have tried to solve the problem in their own little corner of soc/intel/common, but it's really something that would benefit all of coreboot. This patch expands the concept onto all boards: hard_reset() and friends get implemented in a generic location where they can run hooks before calling the platform-specific implementation that is now called do_hard_reset(). The existing Intel reset_prepare() gets generalized as soc_reset_prepare() (and other hooks for arch, mainboard, etc. can now easily be added later if necessary). We will also use this central point to ensure all platforms flush their cache before reset, which is generally useful for all cases where we're trying to persist information in RAM across reboots (like the new persistent CBMEM console does). Also remove cpu_reset() completely since it's not used anywhere and doesn't seem very useful compared to the others. Change-Id: I41b89ce4a923102f0748922496e1dd9bce8a610f Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/19789 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/southbridge/nvidia')
-rw-r--r--src/southbridge/nvidia/ck804/early_setup.c4
-rw-r--r--src/southbridge/nvidia/ck804/early_setup_car.c4
-rw-r--r--src/southbridge/nvidia/ck804/reset.c2
-rw-r--r--src/southbridge/nvidia/mcp55/early_ctrl.c4
-rw-r--r--src/southbridge/nvidia/mcp55/reset.c2
5 files changed, 8 insertions, 8 deletions
diff --git a/src/southbridge/nvidia/ck804/early_setup.c b/src/southbridge/nvidia/ck804/early_setup.c
index 1d4999ccbc..79c9eff050 100644
--- a/src/southbridge/nvidia/ck804/early_setup.c
+++ b/src/southbridge/nvidia/ck804/early_setup.c
@@ -310,7 +310,7 @@ static int ck804_early_setup_x(void)
return set_ht_link_ck804(4);
}
-void hard_reset(void)
+void do_hard_reset(void)
{
set_bios_reset();
@@ -319,7 +319,7 @@ void hard_reset(void)
outb(0x0e, 0x0cf9);
}
-void soft_reset(void)
+void do_soft_reset(void)
{
set_bios_reset();
diff --git a/src/southbridge/nvidia/ck804/early_setup_car.c b/src/southbridge/nvidia/ck804/early_setup_car.c
index 689f98985f..aeea41b551 100644
--- a/src/southbridge/nvidia/ck804/early_setup_car.c
+++ b/src/southbridge/nvidia/ck804/early_setup_car.c
@@ -357,7 +357,7 @@ static int ck804_early_setup_x(void)
return set_ht_link_ck804(4);
}
-void hard_reset(void)
+void do_hard_reset(void)
{
set_bios_reset();
@@ -366,7 +366,7 @@ void hard_reset(void)
outb(0x0e, 0x0cf9);
}
-void soft_reset(void)
+void do_soft_reset(void)
{
set_bios_reset();
diff --git a/src/southbridge/nvidia/ck804/reset.c b/src/southbridge/nvidia/ck804/reset.c
index ad994dedc4..bcb6dfc8f8 100644
--- a/src/southbridge/nvidia/ck804/reset.c
+++ b/src/southbridge/nvidia/ck804/reset.c
@@ -21,7 +21,7 @@
#include "../../../northbridge/amd/amdk8/reset_test.c"
-void hard_reset(void)
+void do_hard_reset(void)
{
set_bios_reset();
/* Try rebooting through port 0xcf9. */
diff --git a/src/southbridge/nvidia/mcp55/early_ctrl.c b/src/southbridge/nvidia/mcp55/early_ctrl.c
index 1f80316b8f..cb3e2f0ae5 100644
--- a/src/southbridge/nvidia/mcp55/early_ctrl.c
+++ b/src/southbridge/nvidia/mcp55/early_ctrl.c
@@ -25,7 +25,7 @@
#endif
#include "mcp55.h"
-void soft_reset(void)
+void do_soft_reset(void)
{
set_bios_reset();
/* link reset */
@@ -33,7 +33,7 @@ void soft_reset(void)
outb(0x06, 0x0cf9);
}
-void hard_reset(void)
+void do_hard_reset(void)
{
set_bios_reset();
diff --git a/src/southbridge/nvidia/mcp55/reset.c b/src/southbridge/nvidia/mcp55/reset.c
index a381cd31a9..7be98d7a2f 100644
--- a/src/southbridge/nvidia/mcp55/reset.c
+++ b/src/southbridge/nvidia/mcp55/reset.c
@@ -24,7 +24,7 @@
#include "../../../northbridge/amd/amdk8/reset_test.c"
-void hard_reset(void)
+void do_hard_reset(void)
{
set_bios_reset();
/* Try rebooting through port 0xcf9 */