3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
15 Sets platform/SKU specific expansion slot information.
20 #include "SlotConfig.h"
39 // Loop through the slot table and see if any slots have cards in them
41 for (i
= 0; i
< mSlotBridgeTableSize
; i
++) {
43 // Initialize variable
48 // Hide mini PCIe slots per SKU
50 for (j
= 0; j
< mSlotInformation
.NumberOfEntries
; j
++) {
51 if (mSlotInformation
.SlotEntries
[j
].SmbiosSlotId
== mSlotBridgeTable
[i
].SmbiosSlotId
) {
52 if ((mSlotInformation
.SlotEntries
[j
].SmbiosSlotId
== 0x02) &&
53 (mBoardFeatures
& B_BOARD_FEATURES_NO_MINIPCIE
)
55 mSlotInformation
.SlotEntries
[j
].Disabled
= TRUE
;
64 // Skip slot device detection since the slot is disabled.
70 // Check to see if the bridge has a bus number and assign one if not
72 BusSaveState
= MmPci16 (
74 mSlotBridgeTable
[i
].Bus
,
75 mSlotBridgeTable
[i
].Dev
,
76 mSlotBridgeTable
[i
].Function
,
77 PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET
79 if (BusSaveState
== 0) {
81 // Assign temp bus number
85 mSlotBridgeTable
[i
].Bus
,
86 mSlotBridgeTable
[i
].Dev
,
87 mSlotBridgeTable
[i
].Function
,
88 PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET
91 } else if (BusSaveState
== 0xFFFF) {
93 // Bridge is disabled so continue with next entry in the table
98 // Use existing bus number
100 CurrentBus
= (UINT8
) BusSaveState
& 0xFF;
104 // Check to see if a device is behind the bridge
109 mSlotBridgeTable
[i
].TargetDevice
,
113 if (Vendor
!= 0xFFFF) {
115 // Device found so make sure the slot is marked that way
117 for (j
= 0; j
< mSlotInformation
.NumberOfEntries
; j
++) {
118 if (mSlotInformation
.SlotEntries
[j
].SmbiosSlotId
== mSlotBridgeTable
[i
].SmbiosSlotId
) {
119 mSlotInformation
.SlotEntries
[j
].InUse
= TRUE
;
126 // Restore previous bus information
128 if (BusSaveState
== 0) {
131 mSlotBridgeTable
[i
].Bus
,
132 mSlotBridgeTable
[i
].Dev
,
133 mSlotBridgeTable
[i
].Function
,
134 PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET
140 Status
= gBS
->InstallProtocolInterface (
142 &gEfiSmbiosSlotPopulationGuid
,
143 EFI_NATIVE_INTERFACE
,
146 ASSERT_EFI_ERROR(Status
);