AGESA fam12 fam14 fam15: Common handler for AGESA_DO_RESET
This is x86 "standard" 0xcf9 reset mechanism.
Change-Id: Ieb48290b21a7cb1425881fdd65c794e96da0248f
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/5680
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
diff --git a/src/mainboard/amd/dinar/BiosCallOuts.c b/src/mainboard/amd/dinar/BiosCallOuts.c
index 4f7f7b7..90e0dc8 100644
--- a/src/mainboard/amd/dinar/BiosCallOuts.c
+++ b/src/mainboard/amd/dinar/BiosCallOuts.c
@@ -90,8 +90,8 @@
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
- {AGESA_DO_RESET, BiosReset },
{AGESA_LOCATE_BUFFER, BiosLocateBuffer},
+ {AGESA_DO_RESET, agesa_Reset },
{AGESA_READ_SPD, BiosReadSpd },
{AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
{AGESA_RUNFUNC_ONAP, BiosRunFuncOnAp },
diff --git a/src/mainboard/amd/inagua/BiosCallOuts.c b/src/mainboard/amd/inagua/BiosCallOuts.c
index ca74133..c370491 100644
--- a/src/mainboard/amd/inagua/BiosCallOuts.c
+++ b/src/mainboard/amd/inagua/BiosCallOuts.c
@@ -28,8 +28,8 @@
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
- {AGESA_DO_RESET, BiosReset },
{AGESA_LOCATE_BUFFER, BiosLocateBuffer },
+ {AGESA_DO_RESET, agesa_Reset },
{AGESA_READ_SPD, BiosReadSpd },
{AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
{AGESA_RUNFUNC_ONAP, BiosRunFuncOnAp },
diff --git a/src/mainboard/amd/persimmon/BiosCallOuts.c b/src/mainboard/amd/persimmon/BiosCallOuts.c
index b96f3d9..aac5d11 100644
--- a/src/mainboard/amd/persimmon/BiosCallOuts.c
+++ b/src/mainboard/amd/persimmon/BiosCallOuts.c
@@ -28,8 +28,8 @@
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
- {AGESA_DO_RESET, BiosReset },
{AGESA_LOCATE_BUFFER, BiosLocateBuffer },
+ {AGESA_DO_RESET, agesa_Reset },
{AGESA_READ_SPD, BiosReadSpd },
{AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
{AGESA_RUNFUNC_ONAP, BiosRunFuncOnAp },
diff --git a/src/mainboard/amd/south_station/BiosCallOuts.c b/src/mainboard/amd/south_station/BiosCallOuts.c
index b3c851d..33a409b 100644
--- a/src/mainboard/amd/south_station/BiosCallOuts.c
+++ b/src/mainboard/amd/south_station/BiosCallOuts.c
@@ -28,8 +28,8 @@
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
- {AGESA_DO_RESET, BiosReset },
{AGESA_LOCATE_BUFFER, BiosLocateBuffer },
+ {AGESA_DO_RESET, agesa_Reset },
{AGESA_READ_SPD, BiosReadSpd },
{AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
{AGESA_RUNFUNC_ONAP, BiosRunFuncOnAp },
diff --git a/src/mainboard/amd/torpedo/BiosCallOuts.c b/src/mainboard/amd/torpedo/BiosCallOuts.c
index 36fd1d6..dcd32e0 100644
--- a/src/mainboard/amd/torpedo/BiosCallOuts.c
+++ b/src/mainboard/amd/torpedo/BiosCallOuts.c
@@ -41,8 +41,8 @@
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
- {AGESA_DO_RESET, BiosReset },
{AGESA_LOCATE_BUFFER, BiosLocateBuffer },
+ {AGESA_DO_RESET, agesa_Reset },
{AGESA_READ_SPD, BiosReadSpd },
{AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
{AGESA_RUNFUNC_ONAP, BiosRunFuncOnAp },
diff --git a/src/mainboard/amd/union_station/BiosCallOuts.c b/src/mainboard/amd/union_station/BiosCallOuts.c
index b3c851d..33a409b 100644
--- a/src/mainboard/amd/union_station/BiosCallOuts.c
+++ b/src/mainboard/amd/union_station/BiosCallOuts.c
@@ -28,8 +28,8 @@
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
- {AGESA_DO_RESET, BiosReset },
{AGESA_LOCATE_BUFFER, BiosLocateBuffer },
+ {AGESA_DO_RESET, agesa_Reset },
{AGESA_READ_SPD, BiosReadSpd },
{AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
{AGESA_RUNFUNC_ONAP, BiosRunFuncOnAp },
diff --git a/src/mainboard/asrock/e350m1/BiosCallOuts.c b/src/mainboard/asrock/e350m1/BiosCallOuts.c
index 4437c46..b20a045 100644
--- a/src/mainboard/asrock/e350m1/BiosCallOuts.c
+++ b/src/mainboard/asrock/e350m1/BiosCallOuts.c
@@ -34,8 +34,8 @@
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
- {AGESA_DO_RESET, BiosReset },
{AGESA_LOCATE_BUFFER, BiosLocateBuffer },
+ {AGESA_DO_RESET, agesa_Reset },
{AGESA_READ_SPD, BiosReadSpd },
{AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
{AGESA_RUNFUNC_ONAP, BiosRunFuncOnAp },
diff --git a/src/mainboard/gizmosphere/gizmo/BiosCallOuts.c b/src/mainboard/gizmosphere/gizmo/BiosCallOuts.c
index e8e8452..ba953f8 100755
--- a/src/mainboard/gizmosphere/gizmo/BiosCallOuts.c
+++ b/src/mainboard/gizmosphere/gizmo/BiosCallOuts.c
@@ -35,8 +35,8 @@
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
- {AGESA_DO_RESET, BiosReset },
{AGESA_LOCATE_BUFFER, BiosLocateBuffer },
+ {AGESA_DO_RESET, agesa_Reset },
{AGESA_READ_SPD, BiosReadSpd_from_cbfs },
{AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
{AGESA_RUNFUNC_ONAP, BiosRunFuncOnAp },
diff --git a/src/mainboard/jetway/nf81-t56n-lf/BiosCallOuts.c b/src/mainboard/jetway/nf81-t56n-lf/BiosCallOuts.c
index eeb1875..97c9cc6 100644
--- a/src/mainboard/jetway/nf81-t56n-lf/BiosCallOuts.c
+++ b/src/mainboard/jetway/nf81-t56n-lf/BiosCallOuts.c
@@ -30,8 +30,8 @@
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
- {AGESA_DO_RESET, BiosReset },
{AGESA_LOCATE_BUFFER, BiosLocateBuffer },
+ {AGESA_DO_RESET, agesa_Reset },
{AGESA_READ_SPD, BiosReadSpd },
{AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
{AGESA_RUNFUNC_ONAP, BiosRunFuncOnAp },
diff --git a/src/mainboard/lippert/frontrunner-af/BiosCallOuts.c b/src/mainboard/lippert/frontrunner-af/BiosCallOuts.c
index 3905d43..dd6b33c 100644
--- a/src/mainboard/lippert/frontrunner-af/BiosCallOuts.c
+++ b/src/mainboard/lippert/frontrunner-af/BiosCallOuts.c
@@ -32,8 +32,8 @@
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
- {AGESA_DO_RESET, BiosReset },
{AGESA_LOCATE_BUFFER, BiosLocateBuffer },
+ {AGESA_DO_RESET, agesa_Reset },
{AGESA_READ_SPD, BiosReadSpd },
{AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
{AGESA_RUNFUNC_ONAP, BiosRunFuncOnAp },
diff --git a/src/mainboard/lippert/toucan-af/BiosCallOuts.c b/src/mainboard/lippert/toucan-af/BiosCallOuts.c
index a9570bc..682fda0 100644
--- a/src/mainboard/lippert/toucan-af/BiosCallOuts.c
+++ b/src/mainboard/lippert/toucan-af/BiosCallOuts.c
@@ -33,8 +33,8 @@
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
- {AGESA_DO_RESET, BiosReset },
{AGESA_LOCATE_BUFFER, BiosLocateBuffer },
+ {AGESA_DO_RESET, agesa_Reset },
{AGESA_READ_SPD, BiosReadSpd },
{AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
{AGESA_RUNFUNC_ONAP, BiosRunFuncOnAp },
diff --git a/src/mainboard/supermicro/h8qgi/BiosCallOuts.c b/src/mainboard/supermicro/h8qgi/BiosCallOuts.c
index 62baf24..90c0a181 100644
--- a/src/mainboard/supermicro/h8qgi/BiosCallOuts.c
+++ b/src/mainboard/supermicro/h8qgi/BiosCallOuts.c
@@ -75,8 +75,8 @@
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
- {AGESA_DO_RESET, BiosReset },
{AGESA_LOCATE_BUFFER, BiosLocateBuffer },
+ {AGESA_DO_RESET, agesa_Reset },
{AGESA_READ_SPD, BiosReadSpd },
{AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
{AGESA_RUNFUNC_ONAP, BiosRunFuncOnAp },
diff --git a/src/mainboard/supermicro/h8scm/BiosCallOuts.c b/src/mainboard/supermicro/h8scm/BiosCallOuts.c
index 09ea9b1..22dd07b 100644
--- a/src/mainboard/supermicro/h8scm/BiosCallOuts.c
+++ b/src/mainboard/supermicro/h8scm/BiosCallOuts.c
@@ -29,8 +29,8 @@
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
- {AGESA_DO_RESET, BiosReset },
{AGESA_LOCATE_BUFFER, BiosLocateBuffer },
+ {AGESA_DO_RESET, agesa_Reset },
{AGESA_READ_SPD, BiosReadSpd },
{AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
{AGESA_RUNFUNC_ONAP, BiosRunFuncOnAp },
diff --git a/src/mainboard/tyan/s8226/BiosCallOuts.c b/src/mainboard/tyan/s8226/BiosCallOuts.c
index 3a6e109..1d66f6d 100644
--- a/src/mainboard/tyan/s8226/BiosCallOuts.c
+++ b/src/mainboard/tyan/s8226/BiosCallOuts.c
@@ -83,8 +83,8 @@
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
- {AGESA_DO_RESET, BiosReset },
{AGESA_LOCATE_BUFFER, BiosLocateBuffer },
+ {AGESA_DO_RESET, agesa_Reset },
{AGESA_READ_SPD, BiosReadSpd },
{AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
{AGESA_RUNFUNC_ONAP, BiosRunFuncOnAp },
diff --git a/src/northbridge/amd/agesa/def_callouts.c b/src/northbridge/amd/agesa/def_callouts.c
index 228ac3f..f0baca5 100644
--- a/src/northbridge/amd/agesa/def_callouts.c
+++ b/src/northbridge/amd/agesa/def_callouts.c
@@ -18,6 +18,7 @@
*/
#include "AGESA.h"
+#include "amdlib.h"
#include "Ids.h"
#include "def_callouts.h"
@@ -38,3 +39,39 @@
IdsPtr[0].IdsNvValue = IdsPtr[0].IdsNvId = 0xffff;
return AGESA_SUCCESS;
}
+
+AGESA_STATUS agesa_Reset (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
+{
+ AGESA_STATUS Status;
+ UINT8 Value;
+ UINTN ResetType;
+ AMD_CONFIG_PARAMS *StdHeader;
+
+ ResetType = Data;
+ StdHeader = ConfigPtr;
+
+ //
+ // Perform the RESET based upon the ResetType. In case of
+ // WARM_RESET_WHENVER and COLD_RESET_WHENEVER, the request will go to
+ // AmdResetManager. During the critical condition, where reset is required
+ // immediately, the reset will be invoked directly by writing 0x04 to port
+ // 0xCF9 (Reset Port).
+ //
+ switch (ResetType) {
+ case WARM_RESET_WHENEVER:
+ case COLD_RESET_WHENEVER:
+ break;
+
+ case WARM_RESET_IMMEDIATELY:
+ case COLD_RESET_IMMEDIATELY:
+ Value = 0x06;
+ LibAmdIoWrite (AccessWidth8, 0xCf9, &Value, StdHeader);
+ break;
+
+ default:
+ break;
+ }
+
+ Status = 0;
+ return Status;
+}
diff --git a/src/northbridge/amd/agesa/def_callouts.h b/src/northbridge/amd/agesa/def_callouts.h
index 2a0c019..a759adb 100644
--- a/src/northbridge/amd/agesa/def_callouts.h
+++ b/src/northbridge/amd/agesa/def_callouts.h
@@ -28,5 +28,6 @@
AGESA_STATUS agesa_NoopUnsupported (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
AGESA_STATUS agesa_NoopSuccess (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
AGESA_STATUS agesa_EmptyIdsInitData (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
+AGESA_STATUS agesa_Reset (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
#endif /* CALLOUTS_AMD_AGESA_H */
diff --git a/src/northbridge/amd/agesa/family12/fam12_callouts.c b/src/northbridge/amd/agesa/family12/fam12_callouts.c
index c62a104..3627bc3 100644
--- a/src/northbridge/amd/agesa/family12/fam12_callouts.c
+++ b/src/northbridge/amd/agesa/family12/fam12_callouts.c
@@ -340,41 +340,6 @@
return Status;
}
-AGESA_STATUS BiosReset (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
-{
- AGESA_STATUS Status;
- UINT8 Value;
- UINTN ResetType;
- AMD_CONFIG_PARAMS *StdHeader;
-
- ResetType = Data;
- StdHeader = ConfigPtr;
-
- //
- // Perform the RESET based upon the ResetType. In case of
- // WARM_RESET_WHENVER and COLD_RESET_WHENEVER, the request will go to
- // AmdResetManager. During the critical condition, where reset is required
- // immediately, the reset will be invoked directly by writing 0x04 to port
- // 0xCF9 (Reset Port).
- //
- switch (ResetType) {
- case WARM_RESET_WHENEVER:
- case COLD_RESET_WHENEVER:
- break;
-
- case WARM_RESET_IMMEDIATELY:
- case COLD_RESET_IMMEDIATELY:
- Value = 0x06;
- LibAmdIoWrite (AccessWidth8, 0xCf9, &Value, StdHeader);
- break;
-
- default:
- break;
- }
-
- Status = 0;
- return Status;
-}
AGESA_STATUS BiosReadSpd (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
{
diff --git a/src/northbridge/amd/agesa/family12/fam12_callouts.h b/src/northbridge/amd/agesa/family12/fam12_callouts.h
index db8976b..5ceac83 100644
--- a/src/northbridge/amd/agesa/family12/fam12_callouts.h
+++ b/src/northbridge/amd/agesa/family12/fam12_callouts.h
@@ -48,7 +48,6 @@
AGESA_STATUS BiosDeallocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
AGESA_STATUS BiosLocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
AGESA_STATUS BiosRunFuncOnAp (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
-AGESA_STATUS BiosReset (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
/* AGESA ADVANCED CALLOUTS - MEMORY */
AGESA_STATUS BiosReadSpd (UINT32 Func,UINT32 Data,VOID *ConfigPtr);
diff --git a/src/northbridge/amd/agesa/family14/fam14_callouts.c b/src/northbridge/amd/agesa/family14/fam14_callouts.c
index 62aaac3..2677a47 100644
--- a/src/northbridge/amd/agesa/family14/fam14_callouts.c
+++ b/src/northbridge/amd/agesa/family14/fam14_callouts.c
@@ -340,41 +340,6 @@
return Status;
}
-AGESA_STATUS BiosReset (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
-{
- AGESA_STATUS Status;
- UINT8 Value;
- UINTN ResetType;
- AMD_CONFIG_PARAMS *StdHeader;
-
- ResetType = Data;
- StdHeader = ConfigPtr;
-
- //
- // Perform the RESET based upon the ResetType. In case of
- // WARM_RESET_WHENVER and COLD_RESET_WHENEVER, the request will go to
- // AmdResetManager. During the critical condition, where reset is required
- // immediately, the reset will be invoked directly by writing 0x04 to port
- // 0xCF9 (Reset Port).
- //
- switch (ResetType) {
- case WARM_RESET_WHENEVER:
- case COLD_RESET_WHENEVER:
- break;
-
- case WARM_RESET_IMMEDIATELY:
- case COLD_RESET_IMMEDIATELY:
- Value = 0x06;
- LibAmdIoWrite (AccessWidth8, 0xCf9, &Value, StdHeader);
- break;
-
- default:
- break;
- }
-
- Status = 0;
- return Status;
-}
AGESA_STATUS BiosReadSpd (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
{
diff --git a/src/northbridge/amd/agesa/family14/fam14_callouts.h b/src/northbridge/amd/agesa/family14/fam14_callouts.h
index 17f80f9..606752c 100755
--- a/src/northbridge/amd/agesa/family14/fam14_callouts.h
+++ b/src/northbridge/amd/agesa/family14/fam14_callouts.h
@@ -49,7 +49,6 @@
AGESA_STATUS BiosDeallocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
AGESA_STATUS BiosLocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
AGESA_STATUS BiosRunFuncOnAp (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
-AGESA_STATUS BiosReset (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
/* AGESA ADVANCED CALLOUTS - MEMORY */
AGESA_STATUS BiosReadSpd (UINT32 Func,UINT32 Data,VOID *ConfigPtr);
diff --git a/src/northbridge/amd/agesa/family15/fam15_callouts.c b/src/northbridge/amd/agesa/family15/fam15_callouts.c
index a9e02c7..1f64338 100644
--- a/src/northbridge/amd/agesa/family15/fam15_callouts.c
+++ b/src/northbridge/amd/agesa/family15/fam15_callouts.c
@@ -340,38 +340,3 @@
return Status;
}
-AGESA_STATUS BiosReset (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
-{
- AGESA_STATUS Status;
- UINT8 Value;
- UINTN ResetType;
- AMD_CONFIG_PARAMS *StdHeader;
-
- ResetType = Data;
- StdHeader = ConfigPtr;
-
- //
- // Perform the RESET based upon the ResetType. In case of
- // WARM_RESET_WHENVER and COLD_RESET_WHENEVER, the request will go to
- // AmdResetManager. During the critical condition, where reset is required
- // immediately, the reset will be invoked directly by writing 0x04 to port
- // 0xCF9 (Reset Port).
- //
- switch (ResetType) {
- case WARM_RESET_WHENEVER:
- case COLD_RESET_WHENEVER:
- break;
-
- case WARM_RESET_IMMEDIATELY:
- case COLD_RESET_IMMEDIATELY:
- Value = 0x06;
- LibAmdIoWrite (AccessWidth8, 0xCf9, &Value, StdHeader);
- break;
-
- default:
- break;
- }
-
- Status = 0;
- return Status;
-}
diff --git a/src/northbridge/amd/agesa/family15/fam15_callouts.h b/src/northbridge/amd/agesa/family15/fam15_callouts.h
index 2782f70..d92c3de6 100644
--- a/src/northbridge/amd/agesa/family15/fam15_callouts.h
+++ b/src/northbridge/amd/agesa/family15/fam15_callouts.h
@@ -49,7 +49,6 @@
AGESA_STATUS BiosDeallocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
AGESA_STATUS BiosLocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
AGESA_STATUS BiosRunFuncOnAp (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
-AGESA_STATUS BiosReset (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
/* AGESA ADVANCED CALLOUTS - MEMORY */
AGESA_STATUS BiosReadSpd (UINT32 Func,UINT32 Data,VOID *ConfigPtr);