diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-05-04 23:13:54 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-05-26 09:28:09 +0200 |
commit | 5e19fa4c510a09abd9338fcc615be0c6cfbe3d6e (patch) | |
tree | 016577d2e910fe7ea81c850c3c6bc9db589fbc5e /src/northbridge/amd/agesa/def_callouts.c | |
parent | f1bb19abee7a81d5463c5885b57fe2cbc5d21715 (diff) |
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>
Diffstat (limited to 'src/northbridge/amd/agesa/def_callouts.c')
-rw-r--r-- | src/northbridge/amd/agesa/def_callouts.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/northbridge/amd/agesa/def_callouts.c b/src/northbridge/amd/agesa/def_callouts.c index 228ac3f5cb..f0baca5349 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 @@ AGESA_STATUS agesa_EmptyIdsInitData (UINT32 Func, UINT32 Data, VOID *ConfigPtr) 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; +} |