diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2017-04-13 16:56:07 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2017-07-17 19:30:46 +0000 |
commit | 9de82612fe722cf3526ed508a463bfb6c9f911d0 (patch) | |
tree | a9a374fd3df1a0448456e1e7680e716d4f500a06 /src/northbridge | |
parent | 044dec27b4e32d5bd52e38b7242319f984feb010 (diff) | |
download | coreboot-9de82612fe722cf3526ed508a463bfb6c9f911d0.tar.xz |
binaryPI: Switch to agesa/def_callouts.c
Change-Id: Id20a49385aeb336461acd0bd186a4ab7f3fb95b8
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/19274
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/northbridge')
-rw-r--r-- | src/northbridge/amd/agesa/def_callouts.c | 7 | ||||
-rw-r--r-- | src/northbridge/amd/pi/BiosCallOuts.h | 44 | ||||
-rw-r--r-- | src/northbridge/amd/pi/Makefile.inc | 5 | ||||
-rw-r--r-- | src/northbridge/amd/pi/agesawrapper.c | 2 | ||||
-rw-r--r-- | src/northbridge/amd/pi/def_callouts.c | 147 |
5 files changed, 11 insertions, 194 deletions
diff --git a/src/northbridge/amd/agesa/def_callouts.c b/src/northbridge/amd/agesa/def_callouts.c index 20f6220227..5aaa49c59a 100644 --- a/src/northbridge/amd/agesa/def_callouts.c +++ b/src/northbridge/amd/agesa/def_callouts.c @@ -24,6 +24,13 @@ #include "BiosCallOuts.h" #include "dimmSpd.h" +#if IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_PI) +#if IS_ENABLED(CONFIG_ARCH_ROMSTAGE_X86_64) || \ + IS_ENABLED(CONFIG_ARCH_RAMSTAGE_X86_64) +#error "FIXME: CALLOUT_ENTRY is UINT32 Data, not UINT Data" +#endif +#endif + AGESA_STATUS GetBiosCallout (UINT32 Func, UINTN Data, VOID *ConfigPtr) { AGESA_STATUS status; diff --git a/src/northbridge/amd/pi/BiosCallOuts.h b/src/northbridge/amd/pi/BiosCallOuts.h deleted file mode 100644 index 238557823e..0000000000 --- a/src/northbridge/amd/pi/BiosCallOuts.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2011,2012 Advanced Micro Devices, Inc. - * Copyright (C) 2013 Sage Electronic Engineering, LLC - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#ifndef CALLOUTS_AMD_AGESA_H -#define CALLOUTS_AMD_AGESA_H - -#include "Porting.h" -#include "AGESA.h" - -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_ReadSpd (UINT32 Func, UINTN Data, VOID *ConfigPtr); -AGESA_STATUS agesa_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *ConfigPtr); - -AGESA_STATUS HeapManagerCallout (UINT32 Func, UINTN Data, VOID *ConfigPtr); -AGESA_STATUS GetBiosCallout (UINT32 Func, UINTN Data, VOID *ConfigPtr); - -typedef struct { - UINT32 CalloutName; - CALLOUT_ENTRY CalloutPtr; -} BIOS_CALLOUT_STRUCT; - -extern const BIOS_CALLOUT_STRUCT BiosCallouts[]; -extern const int BiosCalloutsLen; - -#endif /* CALLOUTS_AMD_AGESA_H */ diff --git a/src/northbridge/amd/pi/Makefile.inc b/src/northbridge/amd/pi/Makefile.inc index de4dc04681..a0bfe54bf1 100644 --- a/src/northbridge/amd/pi/Makefile.inc +++ b/src/northbridge/amd/pi/Makefile.inc @@ -20,9 +20,10 @@ subdirs-$(CONFIG_NORTHBRIDGE_AMD_PI_00730F01) += 00730F01 subdirs-$(CONFIG_NORTHBRIDGE_AMD_PI_00660F01) += 00660F01 romstage-y += agesawrapper.c -romstage-y += def_callouts.c ramstage-y += agesawrapper.c -ramstage-y += def_callouts.c + +romstage-y += ../agesa/def_callouts.c +ramstage-y += ../agesa/def_callouts.c romstage-y += ramtop.c ramstage-y += ramtop.c diff --git a/src/northbridge/amd/pi/agesawrapper.c b/src/northbridge/amd/pi/agesawrapper.c index 4fa353ed0c..cdff105755 100644 --- a/src/northbridge/amd/pi/agesawrapper.c +++ b/src/northbridge/amd/pi/agesawrapper.c @@ -22,7 +22,7 @@ #include <FchPlatform.h> #include <heapManager.h> #include <northbridge/amd/pi/agesawrapper.h> -#include <northbridge/amd/pi/BiosCallOuts.h> +#include <northbridge/amd/agesa/BiosCallOuts.h> void __attribute__((weak)) OemPostParams(AMD_POST_PARAMS *PostParams) {} diff --git a/src/northbridge/amd/pi/def_callouts.c b/src/northbridge/amd/pi/def_callouts.c deleted file mode 100644 index 00982e7cfd..0000000000 --- a/src/northbridge/amd/pi/def_callouts.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2011 Advanced Micro Devices, Inc. - * Copyright (C) 2013 Sage Electronic Engineering, LLC - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include <cbfs.h> -#include <spd_bin.h> - -#include "AGESA.h" -#include "amdlib.h" -#include "Ids.h" -#include "agesawrapper.h" -#include "BiosCallOuts.h" -#include "dimmSpd.h" - -AGESA_STATUS GetBiosCallout (UINT32 Func, UINTN Data, VOID *ConfigPtr) -{ - AGESA_STATUS status; - UINTN i; - - /* One HeapManager serves them all. */ - status = HeapManagerCallout(Func, Data, ConfigPtr); - if (status != AGESA_UNSUPPORTED) - return status; - - 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, UINTN Data, VOID *ConfigPtr) -{ - return AGESA_UNSUPPORTED; -} - -AGESA_STATUS agesa_NoopSuccess (UINT32 Func, UINTN Data, VOID *ConfigPtr) -{ - return AGESA_SUCCESS; -} - -AGESA_STATUS agesa_EmptyIdsInitData (UINT32 Func, UINTN Data, VOID *ConfigPtr) -{ - IDS_NV_ITEM *IdsPtr = ((IDS_CALLOUT_STRUCT *) ConfigPtr)->IdsNvPtr; - if (Data == IDS_CALLOUT_INIT) - IdsPtr[0].IdsNvValue = IdsPtr[0].IdsNvId = 0xffff; - return AGESA_SUCCESS; -} - -AGESA_STATUS agesa_Reset (UINT32 Func, UINTN 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 agesa_RunFuncOnAp (UINT32 Func, UINTN Data, VOID *ConfigPtr) -{ - AGESA_STATUS Status; - - Status = agesawrapper_amdlaterunaptask (Func, Data, ConfigPtr); - return Status; -} - -AGESA_STATUS agesa_GfxGetVbiosImage(UINT32 Func, UINTN FchData, VOID *ConfigPrt) -{ - GFX_VBIOS_IMAGE_INFO *pVbiosImageInfo = (GFX_VBIOS_IMAGE_INFO *)ConfigPrt; - pVbiosImageInfo->ImagePtr = cbfs_boot_map_with_leak( - "pci"CONFIG_VGA_BIOS_ID".rom", - CBFS_TYPE_OPTIONROM, NULL); - printk(BIOS_DEBUG, "agesa_GfxGetVbiosImage: IMGptr=%p\n", pVbiosImageInfo->ImagePtr); - return (pVbiosImageInfo->ImagePtr ? AGESA_SUCCESS : AGESA_WARNING); -} - -AGESA_STATUS agesa_ReadSpd (UINT32 Func, UINTN Data, VOID *ConfigPtr) -{ - AGESA_STATUS Status = AGESA_UNSUPPORTED; -#ifdef __PRE_RAM__ - Status = AmdMemoryReadSPD (Func, Data, ConfigPtr); -#endif - return Status; -} - -AGESA_STATUS agesa_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *ConfigPtr) -{ - AGESA_STATUS Status = AGESA_UNSUPPORTED; -#ifdef __PRE_RAM__ - AGESA_READ_SPD_PARAMS *info = ConfigPtr; - if (info->MemChannelId > 0) - return AGESA_UNSUPPORTED; - if (info->SocketId != 0) - return AGESA_UNSUPPORTED; - if (info->DimmId != 0) - return AGESA_UNSUPPORTED; - - /* Read index 0, first SPD_SIZE bytes of spd.bin file. */ - if (read_ddr3_spd_from_cbfs((u8*)info->Buffer, 0) < 0) - die("No SPD data\n"); - - Status = AGESA_SUCCESS; -#endif - return Status; -} |