From 01f9aa5e54cf55ecca1b35185373835e61f10615 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Thu, 18 May 2017 16:03:26 -0700 Subject: 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 Reviewed-on: https://review.coreboot.org/19789 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- src/mainboard/asus/a8v-e_deluxe/romstage.c | 2 +- src/mainboard/asus/a8v-e_se/romstage.c | 2 +- src/mainboard/asus/k8v-x/romstage.c | 2 +- src/mainboard/asus/m2v-mx_se/romstage.c | 2 +- src/mainboard/asus/m2v/romstage.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mainboard/asus') diff --git a/src/mainboard/asus/a8v-e_deluxe/romstage.c b/src/mainboard/asus/a8v-e_deluxe/romstage.c index 3601e50090..a19b46af26 100644 --- a/src/mainboard/asus/a8v-e_deluxe/romstage.c +++ b/src/mainboard/asus/a8v-e_deluxe/romstage.c @@ -55,7 +55,7 @@ int spd_read_byte(unsigned int device, unsigned int address) } #include -void soft_reset(void) +void do_soft_reset(void) { uint8_t tmp; diff --git a/src/mainboard/asus/a8v-e_se/romstage.c b/src/mainboard/asus/a8v-e_se/romstage.c index fdb8577a72..706b8592b5 100644 --- a/src/mainboard/asus/a8v-e_se/romstage.c +++ b/src/mainboard/asus/a8v-e_se/romstage.c @@ -55,7 +55,7 @@ int spd_read_byte(unsigned device, unsigned address) } #include -void soft_reset(void) +void do_soft_reset(void) { uint8_t tmp; diff --git a/src/mainboard/asus/k8v-x/romstage.c b/src/mainboard/asus/k8v-x/romstage.c index f1477c3e2e..1df033ad90 100644 --- a/src/mainboard/asus/k8v-x/romstage.c +++ b/src/mainboard/asus/k8v-x/romstage.c @@ -53,7 +53,7 @@ int spd_read_byte(unsigned device, unsigned address) } #include -void soft_reset(void) +void do_soft_reset(void) { uint8_t tmp; diff --git a/src/mainboard/asus/m2v-mx_se/romstage.c b/src/mainboard/asus/m2v-mx_se/romstage.c index 7864f96274..13113b4019 100644 --- a/src/mainboard/asus/m2v-mx_se/romstage.c +++ b/src/mainboard/asus/m2v-mx_se/romstage.c @@ -81,7 +81,7 @@ static void ldtstop_sb(void) #include "cpu/amd/model_fxx/fidvid.c" #include "northbridge/amd/amdk8/resourcemap.c" -void soft_reset(void) +void do_soft_reset(void) { uint8_t tmp; diff --git a/src/mainboard/asus/m2v/romstage.c b/src/mainboard/asus/m2v/romstage.c index 89948b7c7f..61d7488653 100644 --- a/src/mainboard/asus/m2v/romstage.c +++ b/src/mainboard/asus/m2v/romstage.c @@ -64,7 +64,7 @@ int spd_read_byte(unsigned device, unsigned address) #include "cpu/amd/model_fxx/fidvid.c" #include "northbridge/amd/amdk8/resourcemap.c" -void soft_reset(void) +void do_soft_reset(void) { uint8_t tmp; -- cgit v1.2.3