summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2014-05-05 13:20:56 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2014-06-06 13:30:52 +0200
commit6025efa3472f38d719d850d2143dae0b215db0f3 (patch)
treef324d7b97a5c3fe488d2d3d67ad8cc1296b9128e /src
parent83cc3b0ed5f522e8ab23b9a9cab8f89bbb65c9c3 (diff)
AGESA: Use common GetBiosCallout()
Change-Id: I9c8f7cc98c65102486e17ec49fa2246211dffc4f Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/5688 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')
-rw-r--r--src/mainboard/amd/dinar/BiosCallOuts.c28
-rw-r--r--src/mainboard/amd/dinar/BiosCallOuts.h2
-rw-r--r--src/mainboard/amd/dinar/agesawrapper.h5
-rw-r--r--src/mainboard/amd/inagua/BiosCallOuts.c22
-rw-r--r--src/mainboard/amd/inagua/BiosCallOuts.h2
-rw-r--r--src/mainboard/amd/inagua/agesawrapper.h5
-rw-r--r--src/mainboard/amd/olivehill/BiosCallOuts.c24
-rw-r--r--src/mainboard/amd/olivehill/BiosCallOuts.h2
-rw-r--r--src/mainboard/amd/olivehill/agesawrapper.h5
-rw-r--r--src/mainboard/amd/parmer/BiosCallOuts.c24
-rw-r--r--src/mainboard/amd/parmer/BiosCallOuts.h2
-rw-r--r--src/mainboard/amd/parmer/agesawrapper.h5
-rw-r--r--src/mainboard/amd/persimmon/BiosCallOuts.c26
-rw-r--r--src/mainboard/amd/persimmon/BiosCallOuts.h2
-rw-r--r--src/mainboard/amd/persimmon/agesawrapper.h5
-rw-r--r--src/mainboard/amd/south_station/BiosCallOuts.c24
-rw-r--r--src/mainboard/amd/south_station/BiosCallOuts.h2
-rw-r--r--src/mainboard/amd/south_station/agesawrapper.h5
-rw-r--r--src/mainboard/amd/thatcher/BiosCallOuts.c24
-rw-r--r--src/mainboard/amd/thatcher/BiosCallOuts.h2
-rw-r--r--src/mainboard/amd/thatcher/agesawrapper.h5
-rw-r--r--src/mainboard/amd/torpedo/BiosCallOuts.c29
-rw-r--r--src/mainboard/amd/torpedo/BiosCallOuts.h2
-rw-r--r--src/mainboard/amd/torpedo/agesawrapper.h5
-rw-r--r--src/mainboard/amd/union_station/BiosCallOuts.c24
-rw-r--r--src/mainboard/amd/union_station/BiosCallOuts.h2
-rw-r--r--src/mainboard/amd/union_station/agesawrapper.h5
-rw-r--r--src/mainboard/asrock/e350m1/BiosCallOuts.c28
-rw-r--r--src/mainboard/asrock/e350m1/BiosCallOuts.h2
-rw-r--r--src/mainboard/asrock/e350m1/agesawrapper.h5
-rw-r--r--src/mainboard/asrock/imb-a180/BiosCallOuts.c24
-rw-r--r--src/mainboard/asrock/imb-a180/BiosCallOuts.h2
-rw-r--r--src/mainboard/asrock/imb-a180/agesawrapper.h5
-rw-r--r--src/mainboard/asus/f2a85-m/BiosCallOuts.c24
-rw-r--r--src/mainboard/asus/f2a85-m/BiosCallOuts.h2
-rw-r--r--src/mainboard/asus/f2a85-m/agesawrapper.h5
-rwxr-xr-xsrc/mainboard/gizmosphere/gizmo/BiosCallOuts.c26
-rwxr-xr-xsrc/mainboard/gizmosphere/gizmo/BiosCallOuts.h2
-rwxr-xr-xsrc/mainboard/gizmosphere/gizmo/agesawrapper.h5
-rw-r--r--src/mainboard/hp/pavilion_m6_1035dx/BiosCallOuts.c24
-rw-r--r--src/mainboard/hp/pavilion_m6_1035dx/BiosCallOuts.h2
-rw-r--r--src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.h5
-rw-r--r--src/mainboard/jetway/nf81-t56n-lf/BiosCallOuts.c26
-rw-r--r--src/mainboard/jetway/nf81-t56n-lf/BiosCallOuts.h2
-rw-r--r--src/mainboard/jetway/nf81-t56n-lf/agesawrapper.h5
-rw-r--r--src/mainboard/lippert/frontrunner-af/BiosCallOuts.c26
-rw-r--r--src/mainboard/lippert/frontrunner-af/BiosCallOuts.h2
-rw-r--r--src/mainboard/lippert/frontrunner-af/agesawrapper.h5
-rw-r--r--src/mainboard/lippert/toucan-af/BiosCallOuts.c26
-rw-r--r--src/mainboard/lippert/toucan-af/BiosCallOuts.h2
-rw-r--r--src/mainboard/lippert/toucan-af/agesawrapper.h5
-rw-r--r--src/mainboard/supermicro/h8qgi/BiosCallOuts.c25
-rw-r--r--src/mainboard/supermicro/h8qgi/BiosCallOuts.h2
-rw-r--r--src/mainboard/supermicro/h8qgi/agesawrapper.h5
-rw-r--r--src/mainboard/supermicro/h8scm/BiosCallOuts.c25
-rw-r--r--src/mainboard/supermicro/h8scm/BiosCallOuts.h2
-rw-r--r--src/mainboard/supermicro/h8scm/agesawrapper.h5
-rw-r--r--src/mainboard/tyan/s8226/BiosCallOuts.c25
-rw-r--r--src/mainboard/tyan/s8226/BiosCallOuts.h2
-rw-r--r--src/mainboard/tyan/s8226/agesawrapper.h5
-rw-r--r--src/northbridge/amd/agesa/def_callouts.c15
-rw-r--r--src/northbridge/amd/agesa/def_callouts.h11
62 files changed, 86 insertions, 584 deletions
diff --git a/src/mainboard/amd/dinar/BiosCallOuts.c b/src/mainboard/amd/dinar/BiosCallOuts.c
index eb9ecd1621..8caa7bf876 100644
--- a/src/mainboard/amd/dinar/BiosCallOuts.c
+++ b/src/mainboard/amd/dinar/BiosCallOuts.c
@@ -26,6 +26,7 @@
#include "SB700.h"
#include <northbridge/amd/agesa/family15/dimmSpd.h>
#include "OEM.h" /* SMBUS0_BASE_ADDRESS */
+#include <stdlib.h>
#ifndef SB_GPIO_REG01
#define SB_GPIO_REG01 1
@@ -88,7 +89,7 @@ static void restore_socket(void)
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 },
@@ -104,30 +105,7 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_HOOKBEFORE_DQS_TRAINING, 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/amd/dinar/BiosCallOuts.h b/src/mainboard/amd/dinar/BiosCallOuts.h
index cc878134bc..2c86e2f648 100644
--- a/src/mainboard/amd/dinar/BiosCallOuts.h
+++ b/src/mainboard/amd/dinar/BiosCallOuts.h
@@ -23,8 +23,6 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family15/fam15_callouts.h>
-/* 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/amd/dinar/agesawrapper.h b/src/mainboard/amd/dinar/agesawrapper.h
index 091e015d59..186c9e3c02 100644
--- a/src/mainboard/amd/dinar/agesawrapper.h
+++ b/src/mainboard/amd/dinar/agesawrapper.h
@@ -99,11 +99,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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/amd/inagua/BiosCallOuts.c b/src/mainboard/amd/inagua/BiosCallOuts.c
index a76431364a..bb7c557e46 100644
--- a/src/mainboard/amd/inagua/BiosCallOuts.c
+++ b/src/mainboard/amd/inagua/BiosCallOuts.c
@@ -23,11 +23,12 @@
#include "heapManager.h"
#include "SB800.h"
#include <northbridge/amd/agesa/family14/dimmSpd.h>
+#include <stdlib.h>
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
static AGESA_STATUS board_GnbPcieSlotReset (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
-STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
@@ -42,24 +43,7 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_HOOKBEFORE_DQS_TRAINING, 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]);
-
- CalloutStatus = AGESA_UNSUPPORTED;
-
- for (i = 0; i < CallOutCount; i++) {
- if (BiosCallouts[i].CalloutName == Func) {
- CalloutStatus = BiosCallouts[i].CalloutPtr (Func, Data, ConfigPtr);
- return CalloutStatus;
- }
- }
-
- return CalloutStatus;
-}
+const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts);
/* Call the host environment interface to provide a user hook opportunity. */
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
diff --git a/src/mainboard/amd/inagua/BiosCallOuts.h b/src/mainboard/amd/inagua/BiosCallOuts.h
index 6dbd4c95ae..0c0d4aa4ad 100644
--- a/src/mainboard/amd/inagua/BiosCallOuts.h
+++ b/src/mainboard/amd/inagua/BiosCallOuts.h
@@ -23,8 +23,6 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family14/fam14_callouts.h>
-/* 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/amd/inagua/agesawrapper.h b/src/mainboard/amd/inagua/agesawrapper.h
index 31f22c1b6c..20550890f8 100644
--- a/src/mainboard/amd/inagua/agesawrapper.h
+++ b/src/mainboard/amd/inagua/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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/amd/olivehill/BiosCallOuts.c b/src/mainboard/amd/olivehill/BiosCallOuts.c
index 373b376d55..ae27bc44f0 100644
--- a/src/mainboard/amd/olivehill/BiosCallOuts.c
+++ b/src/mainboard/amd/olivehill/BiosCallOuts.c
@@ -28,8 +28,9 @@
#if IS_ENABLED(CONFIG_HUDSON_IMC_FWM)
#include "imc.h"
#endif
+#include <stdlib.h>
-STATIC CONST BIOS_CALLOUT_STRUCT BiosCallouts[] =
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, fam16kb_AllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, fam16kb_DeallocateBuffer },
@@ -44,26 +45,7 @@ STATIC CONST BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_FCH_OEM_CALLOUT, Fch_Oem_config },
{AGESA_GNB_GFX_GET_VBIOS_IMAGE, agesa_GfxGetVbiosImage }
};
-
-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);
/**
* AMD Olivehill Platform ALC272 Verb Table
diff --git a/src/mainboard/amd/olivehill/BiosCallOuts.h b/src/mainboard/amd/olivehill/BiosCallOuts.h
index 7490b669a6..2b8aae211e 100644
--- a/src/mainboard/amd/olivehill/BiosCallOuts.h
+++ b/src/mainboard/amd/olivehill/BiosCallOuts.h
@@ -23,8 +23,6 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family16kb/fam16kb_callouts.h>
-/* CALLOUT Initialization */
-AGESA_STATUS GetBiosCallout(UINT32 Func, UINT32 Data, VOID *ConfigPtr);
/* FCH OEM Config*/
AGESA_STATUS Fch_Oem_config(UINT32 Func, UINT32 FchData, VOID *ConfigPtr);
diff --git a/src/mainboard/amd/olivehill/agesawrapper.h b/src/mainboard/amd/olivehill/agesawrapper.h
index 579350f1db..68cb661517 100644
--- a/src/mainboard/amd/olivehill/agesawrapper.h
+++ b/src/mainboard/amd/olivehill/agesawrapper.h
@@ -54,11 +54,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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/amd/parmer/BiosCallOuts.c b/src/mainboard/amd/parmer/BiosCallOuts.c
index 985daa7b20..1b83ae14af 100644
--- a/src/mainboard/amd/parmer/BiosCallOuts.c
+++ b/src/mainboard/amd/parmer/BiosCallOuts.c
@@ -28,8 +28,9 @@
#if IS_ENABLED(CONFIG_HUDSON_IMC_FWM)
#include "imc.h"
#endif
+#include <stdlib.h>
-STATIC CONST BIOS_CALLOUT_STRUCT BiosCallouts[] =
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, fam15tn_AllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, fam15tn_DeallocateBuffer },
@@ -44,26 +45,7 @@ STATIC CONST BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_FCH_OEM_CALLOUT, Fch_Oem_config },
{AGESA_GNB_GFX_GET_VBIOS_IMAGE, agesa_GfxGetVbiosImage }
};
-
-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);
/**
* AMD Parmer Platform ALC272 Verb Table
diff --git a/src/mainboard/amd/parmer/BiosCallOuts.h b/src/mainboard/amd/parmer/BiosCallOuts.h
index 7ccb07ad16..54d15cc983 100644
--- a/src/mainboard/amd/parmer/BiosCallOuts.h
+++ b/src/mainboard/amd/parmer/BiosCallOuts.h
@@ -23,8 +23,6 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family15tn/fam15tn_callouts.h>
-/* CALLOUT Initialization */
-AGESA_STATUS GetBiosCallout (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
/* FCH OEM Config*/
AGESA_STATUS Fch_Oem_config(UINT32 Func, UINT32 FchData, VOID *ConfigPtr);
diff --git a/src/mainboard/amd/parmer/agesawrapper.h b/src/mainboard/amd/parmer/agesawrapper.h
index 579350f1db..68cb661517 100644
--- a/src/mainboard/amd/parmer/agesawrapper.h
+++ b/src/mainboard/amd/parmer/agesawrapper.h
@@ -54,11 +54,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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/amd/persimmon/BiosCallOuts.c b/src/mainboard/amd/persimmon/BiosCallOuts.c
index 74e2a7e002..f19fb88592 100644
--- a/src/mainboard/amd/persimmon/BiosCallOuts.c
+++ b/src/mainboard/amd/persimmon/BiosCallOuts.c
@@ -23,11 +23,12 @@
#include "heapManager.h"
#include "SB800.h"
#include <northbridge/amd/agesa/family14/dimmSpd.h>
+#include <stdlib.h>
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
static AGESA_STATUS board_GnbPcieSlotReset (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
-STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
@@ -42,28 +43,7 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_HOOKBEFORE_DQS_TRAINING, 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]);
-
- /*
- * printk(BIOS_SPEW,"%s function: %x\n", __func__, (u32) Func);
- */
-
- CalloutStatus = AGESA_UNSUPPORTED;
-
- for (i = 0; i < CallOutCount; i++) {
- if (BiosCallouts[i].CalloutName == Func) {
- CalloutStatus = BiosCallouts[i].CalloutPtr (Func, Data, ConfigPtr);
- return CalloutStatus;
- }
- }
-
- return CalloutStatus;
-}
+const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts);
/* Call the host environment interface to provide a user hook opportunity. */
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
diff --git a/src/mainboard/amd/persimmon/BiosCallOuts.h b/src/mainboard/amd/persimmon/BiosCallOuts.h
index 27ac074e37..1cb500635d 100644
--- a/src/mainboard/amd/persimmon/BiosCallOuts.h
+++ b/src/mainboard/amd/persimmon/BiosCallOuts.h
@@ -23,7 +23,5 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family14/fam14_callouts.h>
-/* CALLOUT Initialization */
-AGESA_STATUS GetBiosCallout(UINT32 Func, UINT32 Data, VOID *ConfigPtr);
#endif //_BIOS_CALLOUT_H_
diff --git a/src/mainboard/amd/persimmon/agesawrapper.h b/src/mainboard/amd/persimmon/agesawrapper.h
index 3764ab004e..8cdb71e8eb 100644
--- a/src/mainboard/amd/persimmon/agesawrapper.h
+++ b/src/mainboard/amd/persimmon/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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/amd/south_station/BiosCallOuts.c b/src/mainboard/amd/south_station/BiosCallOuts.c
index 219a0a8ede..18985aad52 100644
--- a/src/mainboard/amd/south_station/BiosCallOuts.c
+++ b/src/mainboard/amd/south_station/BiosCallOuts.c
@@ -23,11 +23,12 @@
#include "heapManager.h"
#include "SB800.h"
#include <northbridge/amd/agesa/family14/dimmSpd.h>
+#include <stdlib.h>
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
static AGESA_STATUS board_GnbPcieSlotReset (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
-STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
@@ -42,26 +43,7 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_HOOKBEFORE_DQS_TRAINING, 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]);
-
- CalloutStatus = AGESA_UNSUPPORTED;
-
- for (i = 0; i < CallOutCount; i++)
- {
- if (BiosCallouts[i].CalloutName == Func)
- {
- CalloutStatus = BiosCallouts[i].CalloutPtr (Func, Data, ConfigPtr);
- return CalloutStatus;
- }
- }
-
- return CalloutStatus;
-}
+const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts);
/* Call the host environment interface to provide a user hook opportunity. */
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
diff --git a/src/mainboard/amd/south_station/BiosCallOuts.h b/src/mainboard/amd/south_station/BiosCallOuts.h
index 6dbd4c95ae..0c0d4aa4ad 100644
--- a/src/mainboard/amd/south_station/BiosCallOuts.h
+++ b/src/mainboard/amd/south_station/BiosCallOuts.h
@@ -23,8 +23,6 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family14/fam14_callouts.h>
-/* 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/amd/south_station/agesawrapper.h b/src/mainboard/amd/south_station/agesawrapper.h
index b02fd5ed7d..2d3e2f1ba2 100644
--- a/src/mainboard/amd/south_station/agesawrapper.h
+++ b/src/mainboard/amd/south_station/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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/amd/thatcher/BiosCallOuts.c b/src/mainboard/amd/thatcher/BiosCallOuts.c
index dfad5fb5c7..f7aa16d8af 100644
--- a/src/mainboard/amd/thatcher/BiosCallOuts.c
+++ b/src/mainboard/amd/thatcher/BiosCallOuts.c
@@ -28,8 +28,9 @@
#if IS_ENABLED(CONFIG_HUDSON_IMC_FWM)
#include "imc.h"
#endif
+#include <stdlib.h>
-STATIC CONST BIOS_CALLOUT_STRUCT BiosCallouts[] =
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, fam15tn_AllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, fam15tn_DeallocateBuffer },
@@ -44,26 +45,7 @@ STATIC CONST BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_FCH_OEM_CALLOUT, Fch_Oem_config },
{AGESA_GNB_GFX_GET_VBIOS_IMAGE, agesa_GfxGetVbiosImage }
};
-
-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);
/**
* AMD Thatcher Platform ALC272 Verb Table
diff --git a/src/mainboard/amd/thatcher/BiosCallOuts.h b/src/mainboard/amd/thatcher/BiosCallOuts.h
index 7ccb07ad16..54d15cc983 100644
--- a/src/mainboard/amd/thatcher/BiosCallOuts.h
+++ b/src/mainboard/amd/thatcher/BiosCallOuts.h
@@ -23,8 +23,6 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family15tn/fam15tn_callouts.h>
-/* CALLOUT Initialization */
-AGESA_STATUS GetBiosCallout (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
/* FCH OEM Config*/
AGESA_STATUS Fch_Oem_config(UINT32 Func, UINT32 FchData, VOID *ConfigPtr);
diff --git a/src/mainboard/amd/thatcher/agesawrapper.h b/src/mainboard/amd/thatcher/agesawrapper.h
index 579350f1db..68cb661517 100644
--- a/src/mainboard/amd/thatcher/agesawrapper.h
+++ b/src/mainboard/amd/thatcher/agesawrapper.h
@@ -54,11 +54,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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/amd/torpedo/BiosCallOuts.c b/src/mainboard/amd/torpedo/BiosCallOuts.c
index 6c170f317c..71010caf22 100644
--- a/src/mainboard/amd/torpedo/BiosCallOuts.c
+++ b/src/mainboard/amd/torpedo/BiosCallOuts.c
@@ -24,6 +24,7 @@
#include "OptionsIds.h"
#include "heapManager.h"
#include "Hudson-2.h"
+#include <stdlib.h>
#ifndef SB_GPIO_REG01
#define SB_GPIO_REG01 1
@@ -40,7 +41,7 @@
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
static AGESA_STATUS board_GnbPcieSlotReset (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
-STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
@@ -56,31 +57,7 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_HOOKBEFORE_DQS_TRAINING, 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);
/* Call the host environment interface to provide a user hook opportunity. */
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
diff --git a/src/mainboard/amd/torpedo/BiosCallOuts.h b/src/mainboard/amd/torpedo/BiosCallOuts.h
index c1e1ed38a8..71d7655cfc 100644
--- a/src/mainboard/amd/torpedo/BiosCallOuts.h
+++ b/src/mainboard/amd/torpedo/BiosCallOuts.h
@@ -23,8 +23,6 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family12/fam12_callouts.h>
-/* CALLOUT Initialization */
-AGESA_STATUS GetBiosCallout(UINT32 Func, UINT32 Data, VOID *ConfigPtr);
// These registers are not defined in cimx/SB900/Hudson-2.h
#define SB_GPIO_REG02 2
diff --git a/src/mainboard/amd/torpedo/agesawrapper.h b/src/mainboard/amd/torpedo/agesawrapper.h
index dd79f28866..58f5a98a0b 100644
--- a/src/mainboard/amd/torpedo/agesawrapper.h
+++ b/src/mainboard/amd/torpedo/agesawrapper.h
@@ -98,11 +98,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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/amd/union_station/BiosCallOuts.c b/src/mainboard/amd/union_station/BiosCallOuts.c
index 219a0a8ede..18985aad52 100644
--- a/src/mainboard/amd/union_station/BiosCallOuts.c
+++ b/src/mainboard/amd/union_station/BiosCallOuts.c
@@ -23,11 +23,12 @@
#include "heapManager.h"
#include "SB800.h"
#include <northbridge/amd/agesa/family14/dimmSpd.h>
+#include <stdlib.h>
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
static AGESA_STATUS board_GnbPcieSlotReset (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
-STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
@@ -42,26 +43,7 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_HOOKBEFORE_DQS_TRAINING, 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]);
-
- CalloutStatus = AGESA_UNSUPPORTED;
-
- for (i = 0; i < CallOutCount; i++)
- {
- if (BiosCallouts[i].CalloutName == Func)
- {
- CalloutStatus = BiosCallouts[i].CalloutPtr (Func, Data, ConfigPtr);
- return CalloutStatus;
- }
- }
-
- return CalloutStatus;
-}
+const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts);
/* Call the host environment interface to provide a user hook opportunity. */
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
diff --git a/src/mainboard/amd/union_station/BiosCallOuts.h b/src/mainboard/amd/union_station/BiosCallOuts.h
index 6dbd4c95ae..0c0d4aa4ad 100644
--- a/src/mainboard/amd/union_station/BiosCallOuts.h
+++ b/src/mainboard/amd/union_station/BiosCallOuts.h
@@ -23,8 +23,6 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family14/fam14_callouts.h>
-/* 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/amd/union_station/agesawrapper.h b/src/mainboard/amd/union_station/agesawrapper.h
index b02fd5ed7d..2d3e2f1ba2 100644
--- a/src/mainboard/amd/union_station/agesawrapper.h
+++ b/src/mainboard/amd/union_station/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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/asrock/e350m1/BiosCallOuts.c b/src/mainboard/asrock/e350m1/BiosCallOuts.c
index 7525cbc34e..97e282ba0b 100644
--- a/src/mainboard/asrock/e350m1/BiosCallOuts.c
+++ b/src/mainboard/asrock/e350m1/BiosCallOuts.c
@@ -23,6 +23,7 @@
#include "heapManager.h"
#include "SB800.h"
#include <northbridge/amd/agesa/family14/dimmSpd.h>
+#include <stdlib.h>
/* Should AGESA_GNB_PCIE_SLOT_RESET use agesa_NoopSuccess?
*
@@ -32,7 +33,7 @@
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
-CONST BIOS_CALLOUT_STRUCT BiosCallouts[] =
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
@@ -46,30 +47,7 @@ CONST BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_HOOKBEFORE_EXIT_SELF_REF, agesa_NoopSuccess },
{AGESA_GNB_PCIE_SLOT_RESET, agesa_NoopUnsupported },
};
-
-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);
/* Call the host environment interface to provide a user hook opportunity. */
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
diff --git a/src/mainboard/asrock/e350m1/BiosCallOuts.h b/src/mainboard/asrock/e350m1/BiosCallOuts.h
index 27ac074e37..1cb500635d 100644
--- a/src/mainboard/asrock/e350m1/BiosCallOuts.h
+++ b/src/mainboard/asrock/e350m1/BiosCallOuts.h
@@ -23,7 +23,5 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family14/fam14_callouts.h>
-/* CALLOUT Initialization */
-AGESA_STATUS GetBiosCallout(UINT32 Func, UINT32 Data, VOID *ConfigPtr);
#endif //_BIOS_CALLOUT_H_
diff --git a/src/mainboard/asrock/e350m1/agesawrapper.h b/src/mainboard/asrock/e350m1/agesawrapper.h
index dee4224691..10158f6454 100644
--- a/src/mainboard/asrock/e350m1/agesawrapper.h
+++ b/src/mainboard/asrock/e350m1/agesawrapper.h
@@ -57,11 +57,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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/asrock/imb-a180/BiosCallOuts.c b/src/mainboard/asrock/imb-a180/BiosCallOuts.c
index f262b299c9..43d99bc777 100644
--- a/src/mainboard/asrock/imb-a180/BiosCallOuts.c
+++ b/src/mainboard/asrock/imb-a180/BiosCallOuts.c
@@ -26,8 +26,9 @@
#include "heapManager.h"
#include "FchPlatform.h"
#include "cbfs.h"
+#include <stdlib.h>
-STATIC CONST BIOS_CALLOUT_STRUCT BiosCallouts[] =
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, fam16kb_AllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, fam16kb_DeallocateBuffer },
@@ -42,26 +43,7 @@ STATIC CONST BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_FCH_OEM_CALLOUT, Fch_Oem_config },
{AGESA_GNB_GFX_GET_VBIOS_IMAGE, agesa_GfxGetVbiosImage }
};
-
-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);
/**
* CODEC Initialization Table for Azalia HD Audio using Realtek ALC662 chip
diff --git a/src/mainboard/asrock/imb-a180/BiosCallOuts.h b/src/mainboard/asrock/imb-a180/BiosCallOuts.h
index 7490b669a6..2b8aae211e 100644
--- a/src/mainboard/asrock/imb-a180/BiosCallOuts.h
+++ b/src/mainboard/asrock/imb-a180/BiosCallOuts.h
@@ -23,8 +23,6 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family16kb/fam16kb_callouts.h>
-/* CALLOUT Initialization */
-AGESA_STATUS GetBiosCallout(UINT32 Func, UINT32 Data, VOID *ConfigPtr);
/* FCH OEM Config*/
AGESA_STATUS Fch_Oem_config(UINT32 Func, UINT32 FchData, VOID *ConfigPtr);
diff --git a/src/mainboard/asrock/imb-a180/agesawrapper.h b/src/mainboard/asrock/imb-a180/agesawrapper.h
index 32b24cb284..8589db51ef 100644
--- a/src/mainboard/asrock/imb-a180/agesawrapper.h
+++ b/src/mainboard/asrock/imb-a180/agesawrapper.h
@@ -54,11 +54,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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/asus/f2a85-m/BiosCallOuts.c b/src/mainboard/asus/f2a85-m/BiosCallOuts.c
index 6bcc18057b..68da196bd0 100644
--- a/src/mainboard/asus/f2a85-m/BiosCallOuts.c
+++ b/src/mainboard/asus/f2a85-m/BiosCallOuts.c
@@ -23,8 +23,9 @@
#include <cbfs.h>
#include <vendorcode/amd/agesa/f15tn/Proc/Fch/FchPlatform.h>
+#include <stdlib.h>
-STATIC CONST BIOS_CALLOUT_STRUCT BiosCallouts[] =
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, fam15tn_AllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, fam15tn_DeallocateBuffer },
@@ -39,26 +40,7 @@ STATIC CONST BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_FCH_OEM_CALLOUT, Fch_Oem_config },
{AGESA_GNB_GFX_GET_VBIOS_IMAGE, agesa_GfxGetVbiosImage }
};
-
-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);
/**
* ASUS F2A85-M board ALC887-VD Verb Table
diff --git a/src/mainboard/asus/f2a85-m/BiosCallOuts.h b/src/mainboard/asus/f2a85-m/BiosCallOuts.h
index 7ccb07ad16..54d15cc983 100644
--- a/src/mainboard/asus/f2a85-m/BiosCallOuts.h
+++ b/src/mainboard/asus/f2a85-m/BiosCallOuts.h
@@ -23,8 +23,6 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family15tn/fam15tn_callouts.h>
-/* CALLOUT Initialization */
-AGESA_STATUS GetBiosCallout (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
/* FCH OEM Config*/
AGESA_STATUS Fch_Oem_config(UINT32 Func, UINT32 FchData, VOID *ConfigPtr);
diff --git a/src/mainboard/asus/f2a85-m/agesawrapper.h b/src/mainboard/asus/f2a85-m/agesawrapper.h
index 71f0ff63bb..4ae226d3cd 100644
--- a/src/mainboard/asus/f2a85-m/agesawrapper.h
+++ b/src/mainboard/asus/f2a85-m/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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/gizmosphere/gizmo/BiosCallOuts.c b/src/mainboard/gizmosphere/gizmo/BiosCallOuts.c
index 94a3a9e79d..481bbf64c4 100755
--- a/src/mainboard/gizmosphere/gizmo/BiosCallOuts.c
+++ b/src/mainboard/gizmosphere/gizmo/BiosCallOuts.c
@@ -23,6 +23,7 @@
#include "BiosCallOuts.h"
#include "heapManager.h"
#include "SB800.h"
+#include <stdlib.h>
#include <cbfs.h>
#include <string.h>
#include <device/dram/ddr3.h>
@@ -33,7 +34,7 @@
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
-STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
@@ -48,28 +49,7 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_HOOKBEFORE_DQS_TRAINING, 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]);
-
- /*
- * printk(BIOS_SPEW,"%s function: %x\n", __func__, (u32) Func);
- */
-
- CalloutStatus = AGESA_UNSUPPORTED;
-
- for (i = 0; i < CallOutCount; i++) {
- if (BiosCallouts[i].CalloutName == Func) {
- CalloutStatus = BiosCallouts[i].CalloutPtr (Func, Data, ConfigPtr);
- return CalloutStatus;
- }
- }
-
- return CalloutStatus;
-}
+const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts);
AGESA_STATUS BiosReadSpd_from_cbfs(UINT32 Func, UINT32 Data, VOID *ConfigPtr)
{
diff --git a/src/mainboard/gizmosphere/gizmo/BiosCallOuts.h b/src/mainboard/gizmosphere/gizmo/BiosCallOuts.h
index 62faa055ba..2743ae2549 100755
--- a/src/mainboard/gizmosphere/gizmo/BiosCallOuts.h
+++ b/src/mainboard/gizmosphere/gizmo/BiosCallOuts.h
@@ -24,7 +24,5 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family14/fam14_callouts.h>
-/* CALLOUT Initialization */
-AGESA_STATUS GetBiosCallout(UINT32 Func, UINT32 Data, VOID *ConfigPtr);
#endif //_BIOS_CALLOUT_H_
diff --git a/src/mainboard/gizmosphere/gizmo/agesawrapper.h b/src/mainboard/gizmosphere/gizmo/agesawrapper.h
index 511df26408..871982a606 100755
--- a/src/mainboard/gizmosphere/gizmo/agesawrapper.h
+++ b/src/mainboard/gizmosphere/gizmo/agesawrapper.h
@@ -54,11 +54,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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/BiosCallOuts.c b/src/mainboard/hp/pavilion_m6_1035dx/BiosCallOuts.c
index 79faf7b0be..7a7985dfea 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/BiosCallOuts.c
+++ b/src/mainboard/hp/pavilion_m6_1035dx/BiosCallOuts.c
@@ -24,8 +24,9 @@
#include <cbfs.h>
#include <southbridge/amd/agesa/hudson/imc.h>
#include <vendorcode/amd/agesa/f15tn/Proc/Fch/FchPlatform.h>
+#include <stdlib.h>
-STATIC CONST BIOS_CALLOUT_STRUCT BiosCallouts[] =
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, fam15tn_AllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, fam15tn_DeallocateBuffer },
@@ -40,26 +41,7 @@ STATIC CONST BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_FCH_OEM_CALLOUT, Fch_Oem_config },
{AGESA_GNB_GFX_GET_VBIOS_IMAGE, agesa_GfxGetVbiosImage }
};
-
-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);
/**
* AMD Parmer Platform ALC272 Verb Table
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/BiosCallOuts.h b/src/mainboard/hp/pavilion_m6_1035dx/BiosCallOuts.h
index 7ccb07ad16..54d15cc983 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/BiosCallOuts.h
+++ b/src/mainboard/hp/pavilion_m6_1035dx/BiosCallOuts.h
@@ -23,8 +23,6 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family15tn/fam15tn_callouts.h>
-/* CALLOUT Initialization */
-AGESA_STATUS GetBiosCallout (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
/* FCH OEM Config*/
AGESA_STATUS Fch_Oem_config(UINT32 Func, UINT32 FchData, VOID *ConfigPtr);
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.h b/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.h
index e5f028a845..317e5e86ce 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.h
+++ b/src/mainboard/hp/pavilion_m6_1035dx/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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/jetway/nf81-t56n-lf/BiosCallOuts.c b/src/mainboard/jetway/nf81-t56n-lf/BiosCallOuts.c
index 87475c472d..1f9c6bea1a 100644
--- a/src/mainboard/jetway/nf81-t56n-lf/BiosCallOuts.c
+++ b/src/mainboard/jetway/nf81-t56n-lf/BiosCallOuts.c
@@ -25,11 +25,12 @@
#include <vendorcode/amd/agesa/f14/Proc/CPU/heapManager.h>
#include <vendorcode/amd/cimx/sb800/SB800.h>
#include <stdint.h>
+#include <stdlib.h>
static AGESA_STATUS board_GnbPcieSlotReset (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
-STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
@@ -44,28 +45,7 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_HOOKBEFORE_DQS_TRAINING, agesa_NoopSuccess },
{AGESA_HOOKBEFORE_EXIT_SELF_REF, agesa_NoopSuccess },
};
-
-AGESA_STATUS GetBiosCallout (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
-{
- size_t i;
- AGESA_STATUS CalloutStatus;
- size_t CallOutCount = sizeof (BiosCallouts) / sizeof (BiosCallouts [0]);
-
- /*
- * printk(BIOS_SPEW,"%s function: %x\n", __func__, (u32) Func);
- */
-
- CalloutStatus = AGESA_UNSUPPORTED;
-
- for (i = 0; i < CallOutCount; i++) {
- if (BiosCallouts[i].CalloutName == Func) {
- CalloutStatus = BiosCallouts[i].CalloutPtr (Func, Data, ConfigPtr);
- return CalloutStatus;
- }
- }
-
- return CalloutStatus;
-}
+const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts);
/* Call the host environment interface to provide a user hook opportunity. */
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
diff --git a/src/mainboard/jetway/nf81-t56n-lf/BiosCallOuts.h b/src/mainboard/jetway/nf81-t56n-lf/BiosCallOuts.h
index 27ac074e37..1cb500635d 100644
--- a/src/mainboard/jetway/nf81-t56n-lf/BiosCallOuts.h
+++ b/src/mainboard/jetway/nf81-t56n-lf/BiosCallOuts.h
@@ -23,7 +23,5 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family14/fam14_callouts.h>
-/* CALLOUT Initialization */
-AGESA_STATUS GetBiosCallout(UINT32 Func, UINT32 Data, VOID *ConfigPtr);
#endif //_BIOS_CALLOUT_H_
diff --git a/src/mainboard/jetway/nf81-t56n-lf/agesawrapper.h b/src/mainboard/jetway/nf81-t56n-lf/agesawrapper.h
index 32ae13edfb..720f3be0fb 100644
--- a/src/mainboard/jetway/nf81-t56n-lf/agesawrapper.h
+++ b/src/mainboard/jetway/nf81-t56n-lf/agesawrapper.h
@@ -41,11 +41,6 @@ enum {
PICK_ALIB, /**< SACPI SSDT table with ALIB implementation */
};
-typedef struct {
- UINT32 CalloutName;
- AGESA_STATUS (*CalloutPtr) (UINT32 Func, UINT32 Data, VOID* ConfigPtr);
-} BIOS_CALLOUT_STRUCT;
-
AGESA_STATUS agesawrapper_amdinitreset(void);
AGESA_STATUS agesawrapper_amdinitearly(void);
diff --git a/src/mainboard/lippert/frontrunner-af/BiosCallOuts.c b/src/mainboard/lippert/frontrunner-af/BiosCallOuts.c
index cc5043abf7..7485b0aae7 100644
--- a/src/mainboard/lippert/frontrunner-af/BiosCallOuts.c
+++ b/src/mainboard/lippert/frontrunner-af/BiosCallOuts.c
@@ -22,6 +22,7 @@
#include "BiosCallOuts.h"
#include "heapManager.h"
#include <northbridge/amd/agesa/family14/dimmSpd.h>
+#include <stdlib.h>
/* Should AGESA_GNB_PCIE_SLOT_RESET use agesa_NoopSuccess?
*
@@ -30,7 +31,7 @@
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
-STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
@@ -45,28 +46,7 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_HOOKBEFORE_DQS_TRAINING, 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]);
-
- /*
- * printk(BIOS_SPEW,"%s function: %x\n", __func__, (u32) Func);
- */
-
- CalloutStatus = AGESA_UNSUPPORTED;
-
- for (i = 0; i < CallOutCount; i++) {
- if (BiosCallouts[i].CalloutName == Func) {
- CalloutStatus = BiosCallouts[i].CalloutPtr (Func, Data, ConfigPtr);
- return CalloutStatus;
- }
- }
-
- return CalloutStatus;
-}
+const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts);
/* Call the host environment interface to provide a user hook opportunity. */
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
diff --git a/src/mainboard/lippert/frontrunner-af/BiosCallOuts.h b/src/mainboard/lippert/frontrunner-af/BiosCallOuts.h
index 0e5c3b6404..4135040712 100644
--- a/src/mainboard/lippert/frontrunner-af/BiosCallOuts.h
+++ b/src/mainboard/lippert/frontrunner-af/BiosCallOuts.h
@@ -24,8 +24,6 @@
#include <northbridge/amd/agesa/family14/fam14_callouts.h>
#include "SB800.h"
-/* CALLOUT Initialization */
-AGESA_STATUS GetBiosCallout(UINT32 Func, UINT32 Data, VOID *ConfigPtr);
/* FCH GPIO access helpers */
#define FCH_IOMUX(gpio_nr) (*(u8*)(ACPI_MMIO_BASE+IOMUX_BASE+(gpio_nr)))
diff --git a/src/mainboard/lippert/frontrunner-af/agesawrapper.h b/src/mainboard/lippert/frontrunner-af/agesawrapper.h
index 3764ab004e..8cdb71e8eb 100644
--- a/src/mainboard/lippert/frontrunner-af/agesawrapper.h
+++ b/src/mainboard/lippert/frontrunner-af/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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/lippert/toucan-af/BiosCallOuts.c b/src/mainboard/lippert/toucan-af/BiosCallOuts.c
index bd229b1e01..3d1a3fc758 100644
--- a/src/mainboard/lippert/toucan-af/BiosCallOuts.c
+++ b/src/mainboard/lippert/toucan-af/BiosCallOuts.c
@@ -22,6 +22,7 @@
#include "BiosCallOuts.h"
#include "heapManager.h"
#include <northbridge/amd/agesa/family14/dimmSpd.h>
+#include <stdlib.h>
/* Should AGESA_GNB_PCIE_SLOT_RESET use agesa_NoopSuccess?
*
@@ -31,7 +32,7 @@
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
-STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
@@ -46,28 +47,7 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
{AGESA_HOOKBEFORE_DQS_TRAINING, 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]);
-
- /*
- * printk(BIOS_SPEW,"%s function: %x\n", __func__, (u32) Func);
- */
-
- CalloutStatus = AGESA_UNSUPPORTED;
-
- for (i = 0; i < CallOutCount; i++) {
- if (BiosCallouts[i].CalloutName == Func) {
- CalloutStatus = BiosCallouts[i].CalloutPtr (Func, Data, ConfigPtr);
- return CalloutStatus;
- }
- }
-
- return CalloutStatus;
-}
+const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts);
/* Call the host environment interface to provide a user hook opportunity. */
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
diff --git a/src/mainboard/lippert/toucan-af/BiosCallOuts.h b/src/mainboard/lippert/toucan-af/BiosCallOuts.h
index 7065e5799d..c0463a8521 100644
--- a/src/mainboard/lippert/toucan-af/BiosCallOuts.h
+++ b/src/mainboard/lippert/toucan-af/BiosCallOuts.h
@@ -24,8 +24,6 @@
#include <northbridge/amd/agesa/family14/fam14_callouts.h>
#include "SB800.h"
-/* CALLOUT Initialization */
-AGESA_STATUS GetBiosCallout(UINT32 Func, UINT32 Data, VOID *ConfigPtr);
/* FCH GPIO access helpers */
#define FCH_IOMUX(gpio_nr) (*(u8*)(ACPI_MMIO_BASE+IOMUX_BASE+(gpio_nr)))
diff --git a/src/mainboard/lippert/toucan-af/agesawrapper.h b/src/mainboard/lippert/toucan-af/agesawrapper.h
index 3764ab004e..8cdb71e8eb 100644
--- a/src/mainboard/lippert/toucan-af/agesawrapper.h
+++ b/src/mainboard/lippert/toucan-af/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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/supermicro/h8qgi/BiosCallOuts.c b/src/mainboard/supermicro/h8qgi/BiosCallOuts.c
index 894ee531c1..6604fbace1 100644
--- a/src/mainboard/supermicro/h8qgi/BiosCallOuts.c
+++ b/src/mainboard/supermicro/h8qgi/BiosCallOuts.c
@@ -73,7 +73,8 @@ static void restore_socket(UINT8 original_value)
static AGESA_STATUS board_ReadSpd (UINT32 Func,UINT32 Data,VOID *ConfigPtr);
-STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
+#include <stdlib.h>
+const BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer },
{AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer },
@@ -87,27 +88,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/supermicro/h8qgi/BiosCallOuts.h b/src/mainboard/supermicro/h8qgi/BiosCallOuts.h
index f733c3f727..c53a687506 100644
--- a/src/mainboard/supermicro/h8qgi/BiosCallOuts.h
+++ b/src/mainboard/supermicro/h8qgi/BiosCallOuts.h
@@ -23,8 +23,6 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family15/fam15_callouts.h>
-/* 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/supermicro/h8qgi/agesawrapper.h b/src/mainboard/supermicro/h8qgi/agesawrapper.h
index 7abf826a39..4f5a6934b0 100644
--- a/src/mainboard/supermicro/h8qgi/agesawrapper.h
+++ b/src/mainboard/supermicro/h8qgi/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
*----------------------------------------------------------------------------------------
diff --git a/src/mainboard/supermicro/h8scm/BiosCallOuts.c b/src/mainboard/supermicro/h8scm/BiosCallOuts.c
index 4cef34d9fc..4f90579b53 100644
--- a/src/mainboard/supermicro/h8scm/BiosCallOuts.c
+++ b/src/mainboard/supermicro/h8scm/BiosCallOuts.c
@@ -24,10 +24,11 @@
#include "OptionsIds.h"
#include "heapManager.h"
#include <northbridge/amd/agesa/family15/dimmSpd.h>
+#include <stdlib.h>
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 },
@@ -41,27 +42,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);
diff --git a/src/mainboard/supermicro/h8scm/BiosCallOuts.h b/src/mainboard/supermicro/h8scm/BiosCallOuts.h
index e3935d21ac..30b66f43a1 100644
--- a/src/mainboard/supermicro/h8scm/BiosCallOuts.h
+++ b/src/mainboard/supermicro/h8scm/BiosCallOuts.h
@@ -23,7 +23,5 @@
#include <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family15/fam15_callouts.h>
-/* CALLOUT Initialization */
-AGESA_STATUS GetBiosCallout(UINT32 Func, UINT32 Data, VOID *ConfigPtr);
#endif //_BIOS_CALLOUT_H_
diff --git a/src/mainboard/supermicro/h8scm/agesawrapper.h b/src/mainboard/supermicro/h8scm/agesawrapper.h
index 7abf826a39..4f5a6934b0 100644
--- a/src/mainboard/supermicro/h8scm/agesawrapper.h
+++ b/src/mainboard/supermicro/h8scm/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
*----------------------------------------------------------------------------------------
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 <northbridge/amd/agesa/family15/dimmSpd.h>
#include <arch/io.h>
+#include <stdlib.h>
#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 <northbridge/amd/agesa/def_callouts.h>
#include <northbridge/amd/agesa/family15/fam15_callouts.h>
-/* 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
*----------------------------------------------------------------------------------------
diff --git a/src/northbridge/amd/agesa/def_callouts.c b/src/northbridge/amd/agesa/def_callouts.c
index b9a5330e15..f813c49e93 100644
--- a/src/northbridge/amd/agesa/def_callouts.c
+++ b/src/northbridge/amd/agesa/def_callouts.c
@@ -24,6 +24,21 @@
#include <cbfs.h>
#include "def_callouts.h"
+
+AGESA_STATUS GetBiosCallout (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
+{
+ UINTN i;
+
+ for (i = 0; i < BiosCalloutsLen; i++) {
+ if (BiosCallouts[i].CalloutName == Func)
+ break;
+ }
+ if(i >= BiosCalloutsLen)
+ return AGESA_UNSUPPORTED;
+
+ return BiosCallouts[i].CalloutPtr (Func, Data, ConfigPtr);
+}
+
AGESA_STATUS agesa_NoopUnsupported (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
{
return AGESA_UNSUPPORTED;
diff --git a/src/northbridge/amd/agesa/def_callouts.h b/src/northbridge/amd/agesa/def_callouts.h
index b540bdd836..3b14cbf03e 100644
--- a/src/northbridge/amd/agesa/def_callouts.h
+++ b/src/northbridge/amd/agesa/def_callouts.h
@@ -21,6 +21,7 @@
#ifndef CALLOUTS_AMD_AGESA_H
#define CALLOUTS_AMD_AGESA_H
+#include "agesawrapper.h"
#include "Porting.h"
#include "AGESA.h"
@@ -32,4 +33,14 @@ AGESA_STATUS agesa_Reset (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
AGESA_STATUS agesa_RunFuncOnAp (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
AGESA_STATUS agesa_GfxGetVbiosImage(UINT32 Func, UINT32 FchData, VOID *ConfigPrt);
+AGESA_STATUS GetBiosCallout (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
+
+typedef struct {
+ UINT32 CalloutName;
+ AGESA_STATUS (*CalloutPtr) (UINT32 Func, UINT32 Data, VOID* ConfigPtr);
+} BIOS_CALLOUT_STRUCT;
+
+extern const BIOS_CALLOUT_STRUCT BiosCallouts[];
+extern const int BiosCalloutsLen;
+
#endif /* CALLOUTS_AMD_AGESA_H */