X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Vlv2TbltDevicePkg%2FPlatformDxe%2FSlotConfig.c;fp=Vlv2TbltDevicePkg%2FPlatformDxe%2FSlotConfig.c;h=0000000000000000000000000000000000000000;hp=f9b53ead95312bd158c286cac37832fb266a87c2;hb=5347c48016f27061475fdb053e867a06ce73492f;hpb=96ef5a8e30a8da33eaab09f13cc8d752342717a5 diff --git a/Vlv2TbltDevicePkg/PlatformDxe/SlotConfig.c b/Vlv2TbltDevicePkg/PlatformDxe/SlotConfig.c deleted file mode 100644 index f9b53ead95..0000000000 --- a/Vlv2TbltDevicePkg/PlatformDxe/SlotConfig.c +++ /dev/null @@ -1,148 +0,0 @@ -/** @file - - Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - - - -Module Name: - - SlotConfig.c - -Abstract: - - Sets platform/SKU specific expansion slot information. - - - ---*/ -#include "SlotConfig.h" - -// -// Implementation -// -VOID -InitializeSlotInfo ( - ) -{ - UINT16 BusSaveState; - UINT16 Vendor; - UINT8 CurrentBus; - UINTN i; - UINTN j; - EFI_HANDLE Handle; - EFI_STATUS Status; - BOOLEAN RunNext; - - // - // Loop through the slot table and see if any slots have cards in them - // - for (i = 0; i < mSlotBridgeTableSize; i++) { - // - // Initialize variable - // - RunNext = FALSE; - - // - // Hide mini PCIe slots per SKU - // - for (j = 0; j < mSlotInformation.NumberOfEntries; j++) { - if (mSlotInformation.SlotEntries[j].SmbiosSlotId == mSlotBridgeTable[i].SmbiosSlotId) { - if ((mSlotInformation.SlotEntries[j].SmbiosSlotId == 0x02) && - (mBoardFeatures & B_BOARD_FEATURES_NO_MINIPCIE) - ) { - mSlotInformation.SlotEntries[j].Disabled = TRUE; - RunNext = TRUE; - } - break; - } - } - - if (RunNext) { - // - // Skip slot device detection since the slot is disabled. - // - continue; - } - - // - // Check to see if the bridge has a bus number and assign one if not - // - BusSaveState = MmPci16 ( - 0, - mSlotBridgeTable[i].Bus, - mSlotBridgeTable[i].Dev, - mSlotBridgeTable[i].Function, - PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET - ); - if (BusSaveState == 0) { - // - // Assign temp bus number - // - MmPci16 ( - 0, - mSlotBridgeTable[i].Bus, - mSlotBridgeTable[i].Dev, - mSlotBridgeTable[i].Function, - PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET - ) = DEF_BUS_CONFIG; - CurrentBus = DEF_BUS; - } else if (BusSaveState == 0xFFFF) { - // - // Bridge is disabled so continue with next entry in the table - // - continue; - } else { - // - // Use existing bus number - // - CurrentBus = (UINT8) BusSaveState & 0xFF; - } - - // - // Check to see if a device is behind the bridge - // - Vendor = MmPci16 ( - 0, - CurrentBus, - mSlotBridgeTable[i].TargetDevice, - 0, - 0 - ); - if (Vendor != 0xFFFF) { - // - // Device found so make sure the slot is marked that way - // - for (j = 0; j < mSlotInformation.NumberOfEntries; j++) { - if (mSlotInformation.SlotEntries[j].SmbiosSlotId == mSlotBridgeTable[i].SmbiosSlotId) { - mSlotInformation.SlotEntries[j].InUse = TRUE; - break; - } - } - } - - // - // Restore previous bus information - // - if (BusSaveState == 0) { - MmPci16 ( - 0, - mSlotBridgeTable[i].Bus, - mSlotBridgeTable[i].Dev, - mSlotBridgeTable[i].Function, - PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET - ) = 0; - } - } - - Handle = NULL; - Status = gBS->InstallProtocolInterface ( - &Handle, - &gEfiSmbiosSlotPopulationGuid, - EFI_NATIVE_INTERFACE, - &mSlotInformation - ); - ASSERT_EFI_ERROR(Status); - -}