diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-05-05 13:20:56 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-06-06 13:30:52 +0200 |
commit | 6025efa3472f38d719d850d2143dae0b215db0f3 (patch) | |
tree | f324d7b97a5c3fe488d2d3d67ad8cc1296b9128e /src/mainboard/lippert | |
parent | 83cc3b0ed5f522e8ab23b9a9cab8f89bbb65c9c3 (diff) | |
download | coreboot-6025efa3472f38d719d850d2143dae0b215db0f3.tar.xz |
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/mainboard/lippert')
-rw-r--r-- | src/mainboard/lippert/frontrunner-af/BiosCallOuts.c | 26 | ||||
-rw-r--r-- | src/mainboard/lippert/frontrunner-af/BiosCallOuts.h | 2 | ||||
-rw-r--r-- | src/mainboard/lippert/frontrunner-af/agesawrapper.h | 5 | ||||
-rw-r--r-- | src/mainboard/lippert/toucan-af/BiosCallOuts.c | 26 | ||||
-rw-r--r-- | src/mainboard/lippert/toucan-af/BiosCallOuts.h | 2 | ||||
-rw-r--r-- | src/mainboard/lippert/toucan-af/agesawrapper.h | 5 |
6 files changed, 6 insertions, 60 deletions
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 *---------------------------------------------------------------------------------------- |