From e4d46689b3505c721b28a798ce34f8d2951588be Mon Sep 17 00:00:00 2001 From: Richard Spiegel Date: Mon, 13 Aug 2018 19:53:40 -0700 Subject: vendorcode/amd/pi/00670F00/Lib: Remove read modify write functions Now that the functions that used them were safely removed, remove LibAmdIoRMW(), LibAmdMemRMW() and LibAmdPciRMW(). BUG=b:112541697 TEST=Build grunt and gardenia Change-Id: I570bd91cd9eba7798ea39d9685e214fee10824be Signed-off-by: Richard Spiegel Reviewed-on: https://review.coreboot.org/28083 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- src/vendorcode/amd/pi/00670F00/Lib/amdlib.c | 94 ++--------------------------- src/vendorcode/amd/pi/00670F00/Lib/amdlib.h | 27 --------- 2 files changed, 4 insertions(+), 117 deletions(-) diff --git a/src/vendorcode/amd/pi/00670F00/Lib/amdlib.c b/src/vendorcode/amd/pi/00670F00/Lib/amdlib.c index b400bca513..784ba46f5a 100644 --- a/src/vendorcode/amd/pi/00670F00/Lib/amdlib.c +++ b/src/vendorcode/amd/pi/00670F00/Lib/amdlib.c @@ -61,6 +61,7 @@ GetPciMmioAddress ( IN AMD_CONFIG_PARAMS *StdHeader ); +#if IS_ENABLED(CONFIG_VENDORCODE_FULL_SUPPORT) VOID STATIC LibAmdGetDataFromPtr ( @@ -70,6 +71,8 @@ LibAmdGetDataFromPtr ( OUT UINT32 *TemData, OUT UINT32 *TempDataMask ); +#endif /* IS_ENABLED(CONFIG_VENDORCODE_FULL_SUPPORT) */ + VOID IdsOutPort ( IN UINT32 Addr, @@ -579,36 +582,6 @@ LibAmdIoWrite ( } } -/*---------------------------------------------------------------------------------------*/ -/** - * IO read modify write - * - * - * @param[in] AccessWidth Access width - * @param[in] IoAddress IO address - * @param[in] Data OR data - * @param[in] DataMask Mask to be used before data write back to register. - * @param[in] StdHeader Standard configuration header - * - */ -VOID -LibAmdIoRMW ( - IN ACCESS_WIDTH AccessWidth, - IN UINT16 IoAddress, - IN CONST VOID *Data, - IN CONST VOID *DataMask, - IN OUT AMD_CONFIG_PARAMS *StdHeader - ) -{ - UINT32 TempData; - UINT32 TempMask; - UINT32 Value; - LibAmdGetDataFromPtr (AccessWidth, Data, DataMask, &TempData, &TempMask); - LibAmdIoRead (AccessWidth, IoAddress, &Value, NULL); - Value = (Value & (~TempMask)) | TempData; - LibAmdIoWrite (AccessWidth, IoAddress, &Value, NULL); -} - #if IS_ENABLED(CONFIG_VENDORCODE_FULL_SUPPORT) /*---------------------------------------------------------------------------------------*/ /** @@ -720,35 +693,6 @@ LibAmdMemWrite ( break; } } -/*---------------------------------------------------------------------------------------*/ -/** - * Memory/MMIO read modify write - * - * - * @param[in] AccessWidth Access width - * @param[in] MemAddress Memory address - * @param[in] Data OR data - * @param[in] DataMask Mask to be used before data write back to register. - * @param[in] StdHeader Standard configuration header - * - */ -VOID -LibAmdMemRMW ( - IN ACCESS_WIDTH AccessWidth, - IN UINT64 MemAddress, - IN CONST VOID *Data, - IN CONST VOID *DataMask, - IN OUT AMD_CONFIG_PARAMS *StdHeader - ) -{ - UINT32 TempData; - UINT32 TempMask; - UINT32 Value; - LibAmdGetDataFromPtr (AccessWidth, Data, DataMask, &TempData, &TempMask); - LibAmdMemRead (AccessWidth, MemAddress, &Value, NULL); - Value = (Value & (~TempMask)) | TempData; - LibAmdMemWrite (AccessWidth, MemAddress, &Value, NULL); -} #if IS_ENABLED(CONFIG_VENDORCODE_FULL_SUPPORT) /*---------------------------------------------------------------------------------------*/ @@ -891,36 +835,6 @@ LibAmdPciWrite ( } } -/*---------------------------------------------------------------------------------------*/ -/** - * PCI read modify write - * - * - * @param[in] AccessWidth Access width - * @param[in] PciAddress Pci address - * @param[in] Data OR Data - * @param[in] DataMask Mask to be used before data write back to register. - * @param[in] StdHeader Standard configuration header - * - */ -VOID -LibAmdPciRMW ( - IN ACCESS_WIDTH AccessWidth, - IN PCI_ADDR PciAddress, - IN CONST VOID *Data, - IN CONST VOID *DataMask, - IN OUT AMD_CONFIG_PARAMS *StdHeader - ) -{ - UINT32 TempData = 0; - UINT32 TempMask = 0; - UINT32 Value; - LibAmdGetDataFromPtr (AccessWidth, Data, DataMask, &TempData, &TempMask); - LibAmdPciRead (AccessWidth, PciAddress, &Value, NULL); - Value = (Value & (~TempMask)) | TempData; - LibAmdPciWrite (AccessWidth, PciAddress, &Value, NULL); -} - #if IS_ENABLED(CONFIG_VENDORCODE_FULL_SUPPORT) /*---------------------------------------------------------------------------------------*/ /** @@ -1297,6 +1211,7 @@ LibAmdGetPackageType ( } #endif /* IS_ENABLED(CONFIG_VENDORCODE_FULL_SUPPORT) */ +#if IS_ENABLED(CONFIG_VENDORCODE_FULL_SUPPORT) /*---------------------------------------------------------------------------------------*/ /** * Returns the package type mask for the processor @@ -1341,7 +1256,6 @@ LibAmdGetDataFromPtr ( } } -#if IS_ENABLED(CONFIG_VENDORCODE_FULL_SUPPORT) /*---------------------------------------------------------------------------------------*/ /** * Returns the package type mask for the processor diff --git a/src/vendorcode/amd/pi/00670F00/Lib/amdlib.h b/src/vendorcode/amd/pi/00670F00/Lib/amdlib.h index 3f7fbbde26..f41e0c42e9 100644 --- a/src/vendorcode/amd/pi/00670F00/Lib/amdlib.h +++ b/src/vendorcode/amd/pi/00670F00/Lib/amdlib.h @@ -163,15 +163,6 @@ LibAmdIoWrite ( IN OUT AMD_CONFIG_PARAMS *StdHeader ); -VOID -LibAmdIoRMW ( - IN ACCESS_WIDTH AccessWidth, - IN UINT16 IoAddress, - IN CONST VOID *Data, - IN CONST VOID *DataMask, - IN OUT AMD_CONFIG_PARAMS *StdHeader - ); - VOID LibAmdIoPoll ( IN ACCESS_WIDTH AccessWidth, @@ -199,15 +190,6 @@ LibAmdMemWrite ( IN OUT AMD_CONFIG_PARAMS *StdHeader ); -VOID -LibAmdMemRMW ( - IN ACCESS_WIDTH AccessWidth, - IN UINT64 MemAddress, - IN CONST VOID *Data, - IN CONST VOID *DataMask, - IN OUT AMD_CONFIG_PARAMS *StdHeader - ); - VOID LibAmdMemPoll ( IN ACCESS_WIDTH AccessWidth, @@ -235,15 +217,6 @@ LibAmdPciWrite ( IN OUT AMD_CONFIG_PARAMS *StdHeader ); -VOID -LibAmdPciRMW ( - IN ACCESS_WIDTH AccessWidth, - IN PCI_ADDR PciAddress, - IN CONST VOID *Data, - IN CONST VOID *DataMask, - IN OUT AMD_CONFIG_PARAMS *StdHeader - ); - VOID LibAmdPciPoll ( IN ACCESS_WIDTH AccessWidth, -- cgit v1.2.3