summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h70
-rw-r--r--src/soc/amd/common/block/include/amdblocks/agesawrapper.h8
-rw-r--r--src/soc/amd/common/block/pi/agesawrapper.c17
-rw-r--r--src/soc/amd/common/block/pi/def_callouts.c45
-rw-r--r--src/soc/amd/common/block/pi/heapmanager.c61
-rw-r--r--src/soc/amd/stoneyridge/BiosCallOuts.c13
-rw-r--r--src/soc/amd/stoneyridge/northbridge.c4
7 files changed, 117 insertions, 101 deletions
diff --git a/src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h b/src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h
index 3d5ae8f2f9..829630bd96 100644
--- a/src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h
+++ b/src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h
@@ -23,51 +23,59 @@
#define BSP_STACK_BASE_ADDR 0x30000
typedef struct _BIOS_HEAP_MANAGER {
- UINT32 StartOfAllocatedNodes;
- UINT32 StartOfFreedNodes;
+ uint32_t StartOfAllocatedNodes;
+ uint32_t StartOfFreedNodes;
} BIOS_HEAP_MANAGER;
typedef struct _BIOS_BUFFER_NODE {
- UINT32 BufferHandle;
- UINT32 BufferSize;
- UINT32 NextNodeOffset;
+ uint32_t BufferHandle;
+ uint32_t BufferSize;
+ uint32_t NextNodeOffset;
} BIOS_BUFFER_NODE;
-AGESA_STATUS agesa_GetTempHeapBase(UINT32 Func, UINTN Data, VOID *ConfigPtr);
-AGESA_STATUS agesa_HeapRebase(UINT32 Func, UINTN Data, VOID *ConfigPtr);
+AGESA_STATUS agesa_GetTempHeapBase(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr);
+AGESA_STATUS agesa_HeapRebase(uint32_t Func, uintptr_t Data, void *ConfigPtr);
-AGESA_STATUS agesa_AllocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr);
-AGESA_STATUS agesa_DeallocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr);
-AGESA_STATUS agesa_LocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr);
+AGESA_STATUS agesa_AllocateBuffer(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr);
+AGESA_STATUS agesa_DeallocateBuffer(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr);
+AGESA_STATUS agesa_LocateBuffer(uint32_t Func, uintptr_t Data, void *ConfigPtr);
-AGESA_STATUS agesa_NoopUnsupported(UINT32 Func, UINTN Data, VOID *ConfigPtr);
-AGESA_STATUS agesa_NoopSuccess(UINT32 Func, UINTN Data, VOID *ConfigPtr);
-AGESA_STATUS agesa_EmptyIdsInitData(UINT32 Func, UINTN Data, VOID *ConfigPtr);
-AGESA_STATUS agesa_Reset(UINT32 Func, UINTN Data, VOID *ConfigPtr);
-AGESA_STATUS agesa_RunFuncOnAp(UINT32 Func, UINTN Data, VOID *ConfigPtr);
-AGESA_STATUS agesa_GfxGetVbiosImage(UINT32 Func, UINTN FchData,
- VOID *ConfigPrt);
+AGESA_STATUS agesa_NoopUnsupported(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr);
+AGESA_STATUS agesa_NoopSuccess(uint32_t Func, uintptr_t Data, void *ConfigPtr);
+AGESA_STATUS agesa_EmptyIdsInitData(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr);
+AGESA_STATUS agesa_Reset(uint32_t Func, uintptr_t Data, void *ConfigPtr);
+AGESA_STATUS agesa_RunFuncOnAp(uint32_t Func, uintptr_t Data, void *ConfigPtr);
+AGESA_STATUS agesa_GfxGetVbiosImage(uint32_t Func, uintptr_t FchData,
+ void *ConfigPrt);
-AGESA_STATUS agesa_ReadSpd(UINT32 Func, UINTN Data, VOID *ConfigPtr);
-AGESA_STATUS agesa_RunFcnOnAllAps(UINT32 Func, UINTN Data, VOID *ConfigPtr);
-AGESA_STATUS agesa_PcieSlotResetControl(UINT32 Func, UINTN Data,
- VOID *ConfigPtr);
-AGESA_STATUS agesa_WaitForAllApsFinished(UINT32 Func, UINTN Data,
- VOID *ConfigPtr);
-AGESA_STATUS agesa_IdleAnAp(UINT32 Func, UINTN Data, VOID *ConfigPtr);
+AGESA_STATUS agesa_ReadSpd(uint32_t Func, uintptr_t Data, void *ConfigPtr);
+AGESA_STATUS agesa_RunFcnOnAllAps(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr);
+AGESA_STATUS agesa_PcieSlotResetControl(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr);
+AGESA_STATUS agesa_WaitForAllApsFinished(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr);
+AGESA_STATUS agesa_IdleAnAp(uint32_t Func, uintptr_t Data, void *ConfigPtr);
-AGESA_STATUS GetBiosCallout(UINT32 Func, UINTN Data, VOID *ConfigPtr);
+AGESA_STATUS GetBiosCallout(uint32_t Func, uintptr_t Data, void *ConfigPtr);
-AGESA_STATUS agesa_fch_initreset(UINT32 Func, UINTN FchData, VOID *ConfigPtr);
-AGESA_STATUS agesa_fch_initenv(UINT32 Func, UINTN FchData, VOID *ConfigPtr);
-AGESA_STATUS agesa_HaltThisAp(UINT32 Func, UINTN Data, VOID *ConfigPtr);
+AGESA_STATUS agesa_fch_initreset(uint32_t Func, uintptr_t FchData,
+ void *ConfigPtr);
+AGESA_STATUS agesa_fch_initenv(uint32_t Func, uintptr_t FchData,
+ void *ConfigPtr);
+AGESA_STATUS agesa_HaltThisAp(uint32_t Func, uintptr_t Data, void *ConfigPtr);
void platform_FchParams_reset(FCH_RESET_DATA_BLOCK *FchParams_reset);
void platform_FchParams_env(FCH_DATA_BLOCK *FchParams_env);
-AGESA_STATUS platform_PcieSlotResetControl(UINT32 Func, UINTN Data,
- VOID *ConfigPtr);
+AGESA_STATUS platform_PcieSlotResetControl(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr);
typedef struct {
- UINT32 CalloutName;
+ uint32_t CalloutName;
CALLOUT_ENTRY CalloutPtr;
} BIOS_CALLOUT_STRUCT;
diff --git a/src/soc/amd/common/block/include/amdblocks/agesawrapper.h b/src/soc/amd/common/block/include/amdblocks/agesawrapper.h
index 713f76cc47..43bd8deaf4 100644
--- a/src/soc/amd/common/block/include/amdblocks/agesawrapper.h
+++ b/src/soc/amd/common/block/include/amdblocks/agesawrapper.h
@@ -41,7 +41,7 @@ AGESA_STATUS agesawrapper_amdinitlate(void);
AGESA_STATUS agesawrapper_amdinitpost(void);
AGESA_STATUS agesawrapper_amdinitmid(void);
void *agesawrapper_getlateinitptr(int pick);
-AGESA_STATUS agesawrapper_amdlaterunaptask(UINT32 Func, UINTN Data,
+AGESA_STATUS agesawrapper_amdlaterunaptask(uint32_t Func, uintptr_t Data,
void *ConfigPtr);
AGESA_STATUS agesawrapper_amdinitrtb(void);
AGESA_STATUS agesawrapper_amdinitresume(void);
@@ -51,9 +51,9 @@ AGESA_STATUS agesawrapper_amds3finalrestore(void);
AGESA_STATUS agesawrapper_fchs3earlyrestore(void);
AGESA_STATUS agesawrapper_fchs3laterestore(void);
-VOID OemCustomizeInitEarly(IN OUT AMD_EARLY_PARAMS *InitEarly);
-VOID amd_initcpuio(void);
-const void *agesawrapper_locate_module(const CHAR8 name[8]);
+void OemCustomizeInitEarly(AMD_EARLY_PARAMS *InitEarly);
+void amd_initcpuio(void);
+const void *agesawrapper_locate_module(const char name[8]);
void SetFchResetParams(FCH_RESET_INTERFACE *params);
void OemPostParams(AMD_POST_PARAMS *PostParams);
diff --git a/src/soc/amd/common/block/pi/agesawrapper.c b/src/soc/amd/common/block/pi/agesawrapper.c
index 181eafd843..9c10fec407 100644
--- a/src/soc/amd/common/block/pi/agesawrapper.c
+++ b/src/soc/amd/common/block/pi/agesawrapper.c
@@ -49,7 +49,7 @@ static void *AcpiAlib;
static void *AcpiIvrs;
static void *AcpiCrat;
-static AGESA_STATUS agesawrapper_readeventlog(UINT8 HeapStatus)
+static AGESA_STATUS agesawrapper_readeventlog(uint8_t HeapStatus)
{
AGESA_STATUS Status;
EVENT_PARAMS AmdEventParams = {
@@ -190,7 +190,7 @@ AGESA_STATUS agesawrapper_amdinitpost(void)
PostParams->MemConfig.UmaMode = CONFIG_GFXUMA ? UMA_AUTO : UMA_NONE;
PostParams->MemConfig.UmaSize = 0;
- PostParams->MemConfig.BottomIo = (UINT16)
+ PostParams->MemConfig.BottomIo = (uint16_t)
(CONFIG_BOTTOMIO_POSITION >> 24);
SetMemParams(PostParams);
@@ -257,7 +257,7 @@ AGESA_STATUS agesawrapper_amdinitenv(void)
return status;
}
-VOID *agesawrapper_getlateinitptr(int pick)
+void *agesawrapper_getlateinitptr(int pick)
{
switch (pick) {
case PICK_DMI:
@@ -326,7 +326,8 @@ AGESA_STATUS agesawrapper_amdinitlate(void)
const struct device *dev = dev_find_slot(0, IOMMU_DEVFN);
if (dev && dev->enabled) {
- LateParams->GnbLateConfiguration.GnbIoapicId = CONFIG_MAX_CPUS + 1;
+ LateParams->GnbLateConfiguration.GnbIoapicId = CONFIG_MAX_CPUS
+ + 1;
LateParams->GnbLateConfiguration.FchIoapicId = CONFIG_MAX_CPUS;
}
@@ -359,8 +360,8 @@ AGESA_STATUS agesawrapper_amdinitlate(void)
return Status;
}
-AGESA_STATUS agesawrapper_amdlaterunaptask(UINT32 Func, UINTN Data,
- VOID *ConfigPtr)
+AGESA_STATUS agesawrapper_amdlaterunaptask(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr)
{
AGESA_STATUS Status;
AP_EXE_PARAMS ApExeParams;
@@ -585,7 +586,7 @@ static const char *get_agesa_cbfs_name(void)
return CONFIG_AGESA_POST_MEMORY_CBFS_NAME;
}
-const void *agesawrapper_locate_module(const CHAR8 name[8])
+const void *agesawrapper_locate_module(const char name[8])
{
const void *agesa;
const AMD_IMAGE_HEADER *image;
@@ -627,7 +628,7 @@ static MODULE_ENTRY agesa_dispatcher CAR_GLOBAL;
MODULE_ENTRY agesa_get_dispatcher(void)
{
const AMD_MODULE_HEADER *module;
- static const CHAR8 id[8] = AGESA_ID;
+ static const char id[8] = AGESA_ID;
MODULE_ENTRY val = car_get_var(agesa_dispatcher);
if (val != NULL)
diff --git a/src/soc/amd/common/block/pi/def_callouts.c b/src/soc/amd/common/block/pi/def_callouts.c
index 60bfad1f3a..0fffaf345b 100644
--- a/src/soc/amd/common/block/pi/def_callouts.c
+++ b/src/soc/amd/common/block/pi/def_callouts.c
@@ -74,9 +74,9 @@ const BIOS_CALLOUT_STRUCT BiosCallouts[] = {
const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts);
-AGESA_STATUS GetBiosCallout(UINT32 Func, UINTN Data, VOID *ConfigPtr)
+AGESA_STATUS GetBiosCallout(uint32_t Func, uintptr_t Data, void *ConfigPtr)
{
- UINTN i;
+ uintptr_t i;
for (i = 0 ; i < BiosCalloutsLen ; i++) {
if (BiosCallouts[i].CalloutName == Func)
@@ -92,17 +92,19 @@ AGESA_STATUS GetBiosCallout(UINT32 Func, UINTN Data, VOID *ConfigPtr)
return BiosCallouts[i].CalloutPtr(Func, Data, ConfigPtr);
}
-AGESA_STATUS agesa_NoopUnsupported(UINT32 Func, UINTN Data, VOID *ConfigPtr)
+AGESA_STATUS agesa_NoopUnsupported(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr)
{
return AGESA_UNSUPPORTED;
}
-AGESA_STATUS agesa_NoopSuccess(UINT32 Func, UINTN Data, VOID *ConfigPtr)
+AGESA_STATUS agesa_NoopSuccess(uint32_t Func, uintptr_t Data, void *ConfigPtr)
{
return AGESA_SUCCESS;
}
-AGESA_STATUS agesa_EmptyIdsInitData(UINT32 Func, UINTN Data, VOID *ConfigPtr)
+AGESA_STATUS agesa_EmptyIdsInitData(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr)
{
IDS_NV_ITEM *IdsPtr = ((IDS_CALLOUT_STRUCT *) ConfigPtr)->IdsNvPtr;
if (Data == IDS_CALLOUT_INIT)
@@ -110,10 +112,10 @@ AGESA_STATUS agesa_EmptyIdsInitData(UINT32 Func, UINTN Data, VOID *ConfigPtr)
return AGESA_SUCCESS;
}
-AGESA_STATUS agesa_Reset(UINT32 Func, UINTN Data, VOID *ConfigPtr)
+AGESA_STATUS agesa_Reset(uint32_t Func, uintptr_t Data, void *ConfigPtr)
{
AGESA_STATUS Status;
- UINTN ResetType;
+ uintptr_t ResetType;
AMD_CONFIG_PARAMS *StdHeader;
ResetType = Data;
@@ -143,8 +145,8 @@ AGESA_STATUS agesa_Reset(UINT32 Func, UINTN Data, VOID *ConfigPtr)
return Status;
}
-AGESA_STATUS agesa_GfxGetVbiosImage(UINT32 Func, UINTN FchData,
- VOID *ConfigPrt)
+AGESA_STATUS agesa_GfxGetVbiosImage(uint32_t Func, uintptr_t FchData,
+ void *ConfigPrt)
{
GFX_VBIOS_IMAGE_INFO *pVbiosImageInfo;
@@ -157,16 +159,16 @@ AGESA_STATUS agesa_GfxGetVbiosImage(UINT32 Func, UINTN FchData,
return pVbiosImageInfo->ImagePtr ? AGESA_SUCCESS : AGESA_WARNING;
}
-AGESA_STATUS __weak platform_PcieSlotResetControl(UINT32 Func,
- UINTN Data, VOID *ConfigPtr)
+AGESA_STATUS __weak platform_PcieSlotResetControl(uint32_t Func,
+ uintptr_t Data, void *ConfigPtr)
{
printk(BIOS_WARNING, "Warning - AGESA callout: %s not supported\n",
__func__);
return AGESA_UNSUPPORTED;
}
-AGESA_STATUS agesa_PcieSlotResetControl(UINT32 Func, UINTN Data,
- VOID *ConfigPtr)
+AGESA_STATUS agesa_PcieSlotResetControl(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr)
{
return platform_PcieSlotResetControl(Func, Data, ConfigPtr);
}
@@ -184,9 +186,9 @@ AGESA_STATUS agesa_PcieSlotResetControl(UINT32 Func, UINTN Data,
* Passed from the AGESA_Callout for the agesawrapper_amdlaterunaptask.
*/
static struct agesa_data {
- UINT32 Func;
- UINTN Data;
- VOID *ConfigPtr;
+ uint32_t Func;
+ uintptr_t Data;
+ void *ConfigPtr;
} agesadata;
/*
@@ -213,7 +215,7 @@ static void callout_ap_entry(void *unused)
lapicid(), decodeAGESA_STATUS(Status));
}
-AGESA_STATUS agesa_RunFuncOnAp(UINT32 Func, UINTN Data, VOID *ConfigPtr)
+AGESA_STATUS agesa_RunFuncOnAp(uint32_t Func, uintptr_t Data, void *ConfigPtr)
{
printk(BIOS_DEBUG, "%s\n", __func__);
@@ -226,7 +228,8 @@ AGESA_STATUS agesa_RunFuncOnAp(UINT32 Func, UINTN Data, VOID *ConfigPtr)
return AGESA_SUCCESS;
}
-AGESA_STATUS agesa_RunFcnOnAllAps(UINT32 Func, UINTN Data, VOID *ConfigPtr)
+AGESA_STATUS agesa_RunFcnOnAllAps(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr)
{
printk(BIOS_DEBUG, "%s\n", __func__);
@@ -239,8 +242,8 @@ AGESA_STATUS agesa_RunFcnOnAllAps(UINT32 Func, UINTN Data, VOID *ConfigPtr)
return AGESA_SUCCESS;
}
-AGESA_STATUS agesa_WaitForAllApsFinished(UINT32 Func, UINTN Data,
- VOID *ConfigPtr)
+AGESA_STATUS agesa_WaitForAllApsFinished(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr)
{
printk(BIOS_WARNING, "Warning - AGESA callout: %s not supported\n",
__func__);
@@ -249,7 +252,7 @@ AGESA_STATUS agesa_WaitForAllApsFinished(UINT32 Func, UINTN Data,
return Status;
}
-AGESA_STATUS agesa_IdleAnAp(UINT32 Func, UINTN Data, VOID *ConfigPtr)
+AGESA_STATUS agesa_IdleAnAp(uint32_t Func, uintptr_t Data, void *ConfigPtr)
{
printk(BIOS_WARNING, "Warning - AGESA callout: %s no supported\n",
__func__);
diff --git a/src/soc/amd/common/block/pi/heapmanager.c b/src/soc/amd/common/block/pi/heapmanager.c
index 6fd006934a..683a572bbc 100644
--- a/src/soc/amd/common/block/pi/heapmanager.c
+++ b/src/soc/amd/common/block/pi/heapmanager.c
@@ -44,7 +44,8 @@ static void EmptyHeap(int unused)
* Status Indicates whether TempHeapAddress was successfully
* set.
*/
-AGESA_STATUS agesa_GetTempHeapBase(UINT32 Func, UINTN Data, VOID *ConfigPtr)
+AGESA_STATUS agesa_GetTempHeapBase(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr)
{
AGESA_TEMP_HEAP_BASE_PARAMS *pTempHeapBase;
@@ -67,12 +68,12 @@ AGESA_STATUS agesa_GetTempHeapBase(UINT32 Func, UINTN Data, VOID *ConfigPtr)
* Status Indicates whether HeapAddress was successfully
* set.
*/
-AGESA_STATUS agesa_HeapRebase(UINT32 Func, UINTN Data, VOID *ConfigPtr)
+AGESA_STATUS agesa_HeapRebase(uint32_t Func, uintptr_t Data, void *ConfigPtr)
{
AGESA_REBASE_PARAMS *Rebase;
Rebase = (AGESA_REBASE_PARAMS *)ConfigPtr;
- Rebase->HeapAddress = (UINTN)agesa_heap_base();
+ Rebase->HeapAddress = (uintptr_t)agesa_heap_base();
if (!Rebase->HeapAddress)
Rebase->HeapAddress = CONFIG_PI_AGESA_CAR_HEAP_BASE;
@@ -94,8 +95,8 @@ AGESA_STATUS agesa_HeapRebase(UINT32 Func, UINTN Data, VOID *ConfigPtr)
static AGESA_STATUS FindAllocatedNode(uint32_t handle,
BIOS_BUFFER_NODE **last_allocd_or_match)
{
- UINT32 AllocNodeOffset;
- UINT8 *BiosHeapBaseAddr;
+ uint32_t AllocNodeOffset;
+ uint8_t *BiosHeapBaseAddr;
BIOS_BUFFER_NODE *AllocNodePtr;
BIOS_HEAP_MANAGER *BiosHeapBasePtr;
AGESA_STATUS Status = AGESA_SUCCESS;
@@ -141,7 +142,8 @@ static void ConcatenateNodes(BIOS_BUFFER_NODE *FirstNodePtr,
ROMSTAGE_CBMEM_INIT_HOOK(EmptyHeap)
-AGESA_STATUS agesa_AllocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr)
+AGESA_STATUS agesa_AllocateBuffer(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr)
{
/*
* Size variables explanation:
@@ -155,17 +157,17 @@ AGESA_STATUS agesa_AllocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr)
* down into 2 nodes, once a node is selected as
* the best fit.
*/
- UINT32 AvailableHeapSize;
- UINT8 *BiosHeapBaseAddr;
- UINT32 CurrNodeOffset;
- UINT32 PrevNodeOffset;
- UINT32 FreedNodeOffset;
- UINT32 FreedNodeSize;
- UINT32 BestFitNodeOffset;
- UINT32 BestFitNodeSize;
- UINT32 BestFitPrevNodeOffset;
- UINT32 NextFreeOffset;
- UINT32 MinimumSize;
+ uint32_t AvailableHeapSize;
+ uint8_t *BiosHeapBaseAddr;
+ uint32_t CurrNodeOffset;
+ uint32_t PrevNodeOffset;
+ uint32_t FreedNodeOffset;
+ uint32_t FreedNodeSize;
+ uint32_t BestFitNodeOffset;
+ uint32_t BestFitNodeSize;
+ uint32_t BestFitPrevNodeOffset;
+ uint32_t NextFreeOffset;
+ uint32_t MinimumSize;
BIOS_BUFFER_NODE *CurrNodePtr;
BIOS_BUFFER_NODE *FreedNodePtr;
BIOS_BUFFER_NODE *BestFitNodePtr;
@@ -192,7 +194,7 @@ AGESA_STATUS agesa_AllocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr)
CurrNodePtr->BufferHandle = AllocParams->BufferHandle;
CurrNodePtr->BufferSize = AllocParams->BufferLength;
CurrNodePtr->NextNodeOffset = 0;
- AllocParams->BufferPointer = (UINT8 *)CurrNodePtr
+ AllocParams->BufferPointer = (uint8_t *)CurrNodePtr
+ sizeof(BIOS_BUFFER_NODE);
/* Update the remaining free space */
@@ -309,22 +311,23 @@ AGESA_STATUS agesa_AllocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr)
BestFitNodePtr->BufferHandle = AllocParams->BufferHandle;
BestFitNodePtr->NextNodeOffset = 0;
- AllocParams->BufferPointer = (UINT8 *)BestFitNodePtr +
+ AllocParams->BufferPointer = (uint8_t *)BestFitNodePtr +
sizeof(BIOS_BUFFER_NODE);
}
return AGESA_SUCCESS;
}
-AGESA_STATUS agesa_DeallocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr)
+AGESA_STATUS agesa_DeallocateBuffer(uint32_t Func, uintptr_t Data,
+ void *ConfigPtr)
{
- UINT8 *BiosHeapBaseAddr;
- UINT32 AllocNodeOffset;
- UINT32 PrevNodeOffset;
- UINT32 NextNodeOffset;
- UINT32 FreedNodeOffset;
- UINT32 EndNodeOffset;
+ uint8_t *BiosHeapBaseAddr;
+ uint32_t AllocNodeOffset;
+ uint32_t PrevNodeOffset;
+ uint32_t NextNodeOffset;
+ uint32_t FreedNodeOffset;
+ uint32_t EndNodeOffset;
BIOS_BUFFER_NODE *AllocNodePtr;
BIOS_BUFFER_NODE *PrevNodePtr;
BIOS_BUFFER_NODE *FreedNodePtr;
@@ -358,7 +361,7 @@ AGESA_STATUS agesa_DeallocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr)
PrevNodePtr->NextNodeOffset = AllocNodePtr->NextNodeOffset;
/* Zero out the buffer, and clear the BufferHandle */
- memset((UINT8 *)AllocNodePtr + sizeof(BIOS_BUFFER_NODE), 0,
+ memset((uint8_t *)AllocNodePtr + sizeof(BIOS_BUFFER_NODE), 0,
AllocNodePtr->BufferSize);
AllocNodePtr->BufferHandle = 0;
@@ -429,7 +432,7 @@ AGESA_STATUS agesa_DeallocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr)
return AGESA_SUCCESS;
}
-AGESA_STATUS agesa_LocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr)
+AGESA_STATUS agesa_LocateBuffer(uint32_t Func, uintptr_t Data, void *ConfigPtr)
{
BIOS_BUFFER_NODE *AllocNodePtr;
AGESA_BUFFER_PARAMS *AllocParams;
@@ -440,7 +443,7 @@ AGESA_STATUS agesa_LocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr)
Status = FindAllocatedNode(AllocParams->BufferHandle, &AllocNodePtr);
if (Status == AGESA_SUCCESS) {
- AllocParams->BufferPointer = (UINT8 *)((UINT8 *)AllocNodePtr
+ AllocParams->BufferPointer = (uint8_t *)((uint8_t *)AllocNodePtr
+ sizeof(BIOS_BUFFER_NODE));
AllocParams->BufferLength = AllocNodePtr->BufferSize;
}
diff --git a/src/soc/amd/stoneyridge/BiosCallOuts.c b/src/soc/amd/stoneyridge/BiosCallOuts.c
index 5e6c899268..fdef166c62 100644
--- a/src/soc/amd/stoneyridge/BiosCallOuts.c
+++ b/src/soc/amd/stoneyridge/BiosCallOuts.c
@@ -27,10 +27,10 @@
#include "chip.h"
#include <amdblocks/car.h>
-void __weak platform_FchParams_reset(
- FCH_RESET_DATA_BLOCK *FchParams_reset) {}
+void __weak platform_FchParams_reset(FCH_RESET_DATA_BLOCK *FchParams_reset) {}
-AGESA_STATUS agesa_fch_initreset(UINT32 Func, UINTN FchData, VOID *ConfigPtr)
+AGESA_STATUS agesa_fch_initreset(uint32_t Func, uintptr_t FchData,
+ void *ConfigPtr)
{
AMD_CONFIG_PARAMS *StdHeader = ConfigPtr;
@@ -48,7 +48,8 @@ AGESA_STATUS agesa_fch_initreset(UINT32 Func, UINTN FchData, VOID *ConfigPtr)
return AGESA_SUCCESS;
}
-AGESA_STATUS agesa_fch_initenv(UINT32 Func, UINTN FchData, VOID *ConfigPtr)
+AGESA_STATUS agesa_fch_initenv(uint32_t Func, uintptr_t FchData,
+ void *ConfigPtr)
{
AMD_CONFIG_PARAMS *StdHeader = ConfigPtr;
const struct device *dev = dev_find_slot(0, SATA_DEVFN);
@@ -92,7 +93,7 @@ AGESA_STATUS agesa_fch_initenv(UINT32 Func, UINTN FchData, VOID *ConfigPtr)
return AGESA_SUCCESS;
}
-AGESA_STATUS agesa_ReadSpd(UINT32 Func, UINTN Data, VOID *ConfigPtr)
+AGESA_STATUS agesa_ReadSpd(uint32_t Func, uintptr_t Data, void *ConfigPtr)
{
uint8_t spd_address;
int err;
@@ -137,7 +138,7 @@ AGESA_STATUS agesa_ReadSpd(UINT32 Func, UINTN Data, VOID *ConfigPtr)
return AGESA_SUCCESS;
}
-AGESA_STATUS agesa_HaltThisAp(UINT32 Func, UINTN Data, VOID *ConfigPtr)
+AGESA_STATUS agesa_HaltThisAp(uint32_t Func, uintptr_t Data, void *ConfigPtr)
{
AGESA_HALT_THIS_AP_PARAMS *info = ConfigPtr;
uint32_t flags = 0;
diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c
index e95e8ec181..749eefe1b7 100644
--- a/src/soc/amd/stoneyridge/northbridge.c
+++ b/src/soc/amd/stoneyridge/northbridge.c
@@ -186,12 +186,12 @@ static unsigned long acpi_fill_hest(acpi_hest_t *hest)
addr = agesawrapper_getlateinitptr(PICK_WHEA_MCE);
if (addr != NULL)
current += acpi_create_hest_error_source(hest, current, 0,
- (void *)((u32)addr + 2), *(UINT16 *)addr - 2);
+ (void *)((u32)addr + 2), *(uint16_t *)addr - 2);
addr = agesawrapper_getlateinitptr(PICK_WHEA_CMC);
if (addr != NULL)
current += acpi_create_hest_error_source(hest, current, 1,
- (void *)((u32)addr + 2), *(UINT16 *)addr - 2);
+ (void *)((u32)addr + 2), *(uint16_t *)addr - 2);
return (unsigned long)current;
}