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>
This commit is contained in:
parent
f1bb19abee
commit
5e19fa4c51
|
@ -90,8 +90,8 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
|
|||
{
|
||||
{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 },
|
||||
|
|
|
@ -28,8 +28,8 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
|
|||
{
|
||||
{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 },
|
||||
|
|
|
@ -28,8 +28,8 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
|
|||
{
|
||||
{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 },
|
||||
|
|
|
@ -28,8 +28,8 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
|
|||
{
|
||||
{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 },
|
||||
|
|
|
@ -41,8 +41,8 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
|
|||
{
|
||||
{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 },
|
||||
|
|
|
@ -28,8 +28,8 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
|
|||
{
|
||||
{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 },
|
||||
|
|
|
@ -34,8 +34,8 @@ CONST BIOS_CALLOUT_STRUCT BiosCallouts[] =
|
|||
{
|
||||
{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 },
|
||||
|
|
|
@ -35,8 +35,8 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
|
|||
{
|
||||
{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 },
|
||||
|
|
|
@ -30,8 +30,8 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
|
|||
{
|
||||
{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 },
|
||||
|
|
|
@ -32,8 +32,8 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
|
|||
{
|
||||
{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 },
|
||||
|
|
|
@ -33,8 +33,8 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
|
|||
{
|
||||
{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 },
|
||||
|
|
|
@ -75,8 +75,8 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
|
|||
{
|
||||
{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 },
|
||||
|
|
|
@ -29,8 +29,8 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
|
|||
{
|
||||
{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 },
|
||||
|
|
|
@ -83,8 +83,8 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
|
|||
{
|
||||
{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 },
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -340,41 +340,6 @@ AGESA_STATUS BiosRunFuncOnAp (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -48,7 +48,6 @@ AGESA_STATUS BiosAllocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
|
|||
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);
|
||||
|
|
|
@ -340,41 +340,6 @@ AGESA_STATUS BiosRunFuncOnAp (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -49,7 +49,6 @@ AGESA_STATUS BiosAllocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
|
|||
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);
|
||||
|
|
|
@ -340,38 +340,3 @@ AGESA_STATUS BiosRunFuncOnAp (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@ AGESA_STATUS BiosAllocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue