Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MTL graphics #132

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 0 additions & 116 deletions MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -2525,11 +2525,6 @@ PciEnumeratorLight (

if (!EFI_ERROR (Status)) {

//
// Remove those PCI devices which are rejected when full enumeration
//
RemoveRejectedPciDevices (RootBridgeDev->Handle, RootBridgeDev);

if (!PcdGetBool (PcdPciDisableBusEnumeration)) {
//
// Process option rom light
Expand Down Expand Up @@ -2652,117 +2647,6 @@ StartManagingRootBridge (

}

/**
This routine can be used to check whether a PCI device should be rejected when light enumeration.

@param PciIoDevice Pci device instance.

@retval TRUE This device should be rejected.
@retval FALSE This device shouldn't be rejected.

**/
BOOLEAN
IsPciDeviceRejected (
IN PCI_IO_DEVICE *PciIoDevice
)
{
EFI_STATUS Status;
UINT32 TestValue;
UINT32 OldValue;
UINT32 Mask;
UINT8 BarOffset;

//
// PPB should be skip!
//
if (IS_PCI_BRIDGE (&PciIoDevice->Pci)) {
return FALSE;
}

if (IS_CARDBUS_BRIDGE (&PciIoDevice->Pci)) {
//
// Only test base registers for P2C
//
for (BarOffset = 0x1C; BarOffset <= 0x38; BarOffset += 2 * sizeof (UINT32)) {

Mask = (BarOffset < 0x2C) ? 0xFFFFF000 : 0xFFFFFFFC;
Status = BarExisted (PciIoDevice, BarOffset, &TestValue, &OldValue);
if (EFI_ERROR (Status)) {
continue;
}

TestValue = TestValue & Mask;
if ((TestValue != 0) && (TestValue == (OldValue & Mask))) {
//
// The bar isn't programed, so it should be rejected
//
return TRUE;
}
}

return FALSE;
}

for (BarOffset = 0x14; BarOffset <= 0x24; BarOffset += sizeof (UINT32)) {
//
// Test PCI devices
//
Status = BarExisted (PciIoDevice, BarOffset, &TestValue, &OldValue);
if (EFI_ERROR (Status)) {
continue;
}

if ((TestValue & 0x01) != 0) {

//
// IO Bar
//
Mask = 0xFFFFFFFC;
TestValue = TestValue & Mask;
if ((TestValue != 0) && (TestValue == (OldValue & Mask))) {
return TRUE;
}

} else {

//
// Mem Bar
//
Mask = 0xFFFFFFF0;
TestValue = TestValue & Mask;

if ((TestValue & 0x07) == 0x04) {

//
// Mem64 or PMem64
//
BarOffset += sizeof (UINT32);
if ((TestValue != 0) && (TestValue == (OldValue & Mask))) {

//
// Test its high 32-Bit BAR
//
Status = BarExisted (PciIoDevice, BarOffset, &TestValue, &OldValue);
if (TestValue == OldValue) {
return TRUE;
}
}

} else {

//
// Mem32 or PMem32
//
if ((TestValue != 0) && (TestValue == (OldValue & Mask))) {
return TRUE;
}
}
}
}

return FALSE;
}

/**
Reset all bus number from specific bridge.

Expand Down
14 changes: 0 additions & 14 deletions MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,20 +427,6 @@ StartManagingRootBridge (
IN PCI_IO_DEVICE *RootBridgeDev
);

/**
This routine can be used to check whether a PCI device should be rejected when light enumeration.

@param PciIoDevice Pci device instance.

@retval TRUE This device should be rejected.
@retval FALSE This device shouldn't be rejected.

**/
BOOLEAN
IsPciDeviceRejected (
IN PCI_IO_DEVICE *PciIoDevice
);

/**
Reset all bus number from specific bridge.

Expand Down
61 changes: 0 additions & 61 deletions MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,67 +138,6 @@ GetBackPcCardBar (
}
}

/**
Remove rejected pci device from specific root bridge
handle.

@param RootBridgeHandle Specific parent root bridge handle.
@param Bridge Bridge device instance.

**/
VOID
RemoveRejectedPciDevices (
IN EFI_HANDLE RootBridgeHandle,
IN PCI_IO_DEVICE *Bridge
)
{
PCI_IO_DEVICE *Temp;
LIST_ENTRY *CurrentLink;
LIST_ENTRY *LastLink;

if (!FeaturePcdGet (PcdPciBusHotplugDeviceSupport)) {
return;
}

CurrentLink = Bridge->ChildList.ForwardLink;

while (CurrentLink != NULL && CurrentLink != &Bridge->ChildList) {

Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);

if (IS_PCI_BRIDGE (&Temp->Pci)) {
//
// Remove rejected devices recusively
//
RemoveRejectedPciDevices (RootBridgeHandle, Temp);
} else {
//
// Skip rejection for all PPBs, while detect rejection for others
//
if (IsPciDeviceRejected (Temp)) {

//
// For P2C, remove all devices on it
//
if (!IsListEmpty (&Temp->ChildList)) {
RemoveAllPciDeviceOnBridge (RootBridgeHandle, Temp);
}

//
// Finally remove itself
//
LastLink = CurrentLink->BackLink;
RemoveEntryList (CurrentLink);
FreePciDevice (Temp);

CurrentLink = LastLink;
}
}

CurrentLink = CurrentLink->ForwardLink;
}
}

/**
Dump the resourc map of the bridge device.

Expand Down
14 changes: 0 additions & 14 deletions MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,6 @@ GetBackPcCardBar (
IN PCI_IO_DEVICE *PciIoDevice
);

/**
Remove rejected pci device from specific root bridge
handle.

@param RootBridgeHandle Specific parent root bridge handle.
@param Bridge Bridge device instance.

**/
VOID
RemoveRejectedPciDevices (
IN EFI_HANDLE RootBridgeHandle,
IN PCI_IO_DEVICE *Bridge
);

/**
Submits the I/O and memory resource requirements for the specified PCI Host Bridge.

Expand Down
5 changes: 3 additions & 2 deletions UefiPayloadPkg/GraphicsOutputDxe/GraphicsOutput.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,9 @@ GraphicsOutputDriverBindingStart (
FrameBufferBase = Resources->AddrRangeMin;
}
if (DeviceInfo->BarIndex == MAX_UINT8) {
if (Resources->AddrRangeMin == GraphicsInfo->FrameBufferBase) {
FrameBufferBase = Resources->AddrRangeMin;
if (Resources->AddrRangeMin <= GraphicsInfo->FrameBufferBase
&& Resources->AddrRangeMin + Resources->AddrLen >= GraphicsInfo->FrameBufferBase + GraphicsInfo->FrameBufferSize ) {
FrameBufferBase = GraphicsInfo->FrameBufferBase;
break;
}
} else {
Expand Down
Loading