3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 Sets platform/SKU specific expansion slot information.
25 #include "SlotConfig.h"
44 // Loop through the slot table and see if any slots have cards in them
46 for (i
= 0; i
< mSlotBridgeTableSize
; i
++) {
48 // Initialize variable
53 // Hide mini PCIe slots per SKU
55 for (j
= 0; j
< mSlotInformation
.NumberOfEntries
; j
++) {
56 if (mSlotInformation
.SlotEntries
[j
].SmbiosSlotId
== mSlotBridgeTable
[i
].SmbiosSlotId
) {
57 if ((mSlotInformation
.SlotEntries
[j
].SmbiosSlotId
== 0x02) &&
58 (mBoardFeatures
& B_BOARD_FEATURES_NO_MINIPCIE
)
60 mSlotInformation
.SlotEntries
[j
].Disabled
= TRUE
;
69 // Skip slot device detection since the slot is disabled.
75 // Check to see if the bridge has a bus number and assign one if not
77 BusSaveState
= MmPci16 (
79 mSlotBridgeTable
[i
].Bus
,
80 mSlotBridgeTable
[i
].Dev
,
81 mSlotBridgeTable
[i
].Function
,
82 PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET
84 if (BusSaveState
== 0) {
86 // Assign temp bus number
90 mSlotBridgeTable
[i
].Bus
,
91 mSlotBridgeTable
[i
].Dev
,
92 mSlotBridgeTable
[i
].Function
,
93 PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET
96 } else if (BusSaveState
== 0xFFFF) {
98 // Bridge is disabled so continue with next entry in the table
103 // Use existing bus number
105 CurrentBus
= (UINT8
) BusSaveState
& 0xFF;
109 // Check to see if a device is behind the bridge
114 mSlotBridgeTable
[i
].TargetDevice
,
118 if (Vendor
!= 0xFFFF) {
120 // Device found so make sure the slot is marked that way
122 for (j
= 0; j
< mSlotInformation
.NumberOfEntries
; j
++) {
123 if (mSlotInformation
.SlotEntries
[j
].SmbiosSlotId
== mSlotBridgeTable
[i
].SmbiosSlotId
) {
124 mSlotInformation
.SlotEntries
[j
].InUse
= TRUE
;
131 // Restore previous bus information
133 if (BusSaveState
== 0) {
136 mSlotBridgeTable
[i
].Bus
,
137 mSlotBridgeTable
[i
].Dev
,
138 mSlotBridgeTable
[i
].Function
,
139 PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET
145 Status
= gBS
->InstallProtocolInterface (
147 &gEfiSmbiosSlotPopulationGuid
,
148 EFI_NATIVE_INTERFACE
,
151 ASSERT_EFI_ERROR(Status
);