From 6025efa3472f38d719d850d2143dae0b215db0f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Mon, 5 May 2014 13:20:56 +0300 Subject: AGESA: Use common GetBiosCallout() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I9c8f7cc98c65102486e17ec49fa2246211dffc4f Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/5688 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan Reviewed-by: Patrick Georgi --- src/mainboard/tyan/s8226/BiosCallOuts.c | 25 +++---------------------- src/mainboard/tyan/s8226/BiosCallOuts.h | 2 -- src/mainboard/tyan/s8226/agesawrapper.h | 5 ----- 3 files changed, 3 insertions(+), 29 deletions(-) (limited to 'src/mainboard/tyan/s8226') diff --git a/src/mainboard/tyan/s8226/BiosCallOuts.c b/src/mainboard/tyan/s8226/BiosCallOuts.c index 0d1817aecb..2812836701 100644 --- a/src/mainboard/tyan/s8226/BiosCallOuts.c +++ b/src/mainboard/tyan/s8226/BiosCallOuts.c @@ -25,6 +25,7 @@ #include "heapManager.h" #include #include +#include #ifdef __PRE_RAM__ /* These defines are used to select the appropriate socket for the SPD read @@ -81,7 +82,7 @@ static void restore_socket(UINT8 original_value) static AGESA_STATUS board_ReadSpd (UINT32 Func,UINT32 Data, VOID *ConfigPtr); -STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] = +const BIOS_CALLOUT_STRUCT BiosCallouts[] = { {AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer }, {AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer }, @@ -95,27 +96,7 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] = {AGESA_HOOKBEFORE_DRAM_INIT, agesa_NoopSuccess }, {AGESA_HOOKBEFORE_EXIT_SELF_REF, agesa_NoopSuccess }, }; - -AGESA_STATUS GetBiosCallout (UINT32 Func, UINT32 Data, VOID *ConfigPtr) -{ - UINTN i; - AGESA_STATUS CalloutStatus; - UINTN CallOutCount = sizeof (BiosCallouts) / sizeof (BiosCallouts [0]); - - for (i = 0; i < CallOutCount; i++) { - if (BiosCallouts[i].CalloutName == Func) { - break; - } - } - - if(i >= CallOutCount) { - return AGESA_UNSUPPORTED; - } - - CalloutStatus = BiosCallouts[i].CalloutPtr (Func, Data, ConfigPtr); - - return CalloutStatus; -} +const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts); static AGESA_STATUS board_ReadSpd (UINT32 Func, UINT32 Data, VOID *ConfigPtr) { diff --git a/src/mainboard/tyan/s8226/BiosCallOuts.h b/src/mainboard/tyan/s8226/BiosCallOuts.h index f733c3f727..c53a687506 100644 --- a/src/mainboard/tyan/s8226/BiosCallOuts.h +++ b/src/mainboard/tyan/s8226/BiosCallOuts.h @@ -23,8 +23,6 @@ #include #include -/* CALLOUT Initialization */ -AGESA_STATUS GetBiosCallout(UINT32 Func, UINT32 Data, VOID *ConfigPtr); #define SB_GPIO_REG02 2 #define SB_GPIO_REG09 9 diff --git a/src/mainboard/tyan/s8226/agesawrapper.h b/src/mainboard/tyan/s8226/agesawrapper.h index 7abf826a39..4f5a6934b0 100644 --- a/src/mainboard/tyan/s8226/agesawrapper.h +++ b/src/mainboard/tyan/s8226/agesawrapper.h @@ -53,11 +53,6 @@ enum { *---------------------------------------------------------------------------------------- */ -typedef struct { - UINT32 CalloutName; - AGESA_STATUS (*CalloutPtr)(UINT32 Func, UINT32 Data, VOID* ConfigPtr); -} BIOS_CALLOUT_STRUCT; - /*---------------------------------------------------------------------------------------- * P R O T O T Y P E S O F L O C A L F U N C T I O N S *---------------------------------------------------------------------------------------- -- cgit v1.2.3