https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6d441f7d65f57c0f5b6da…
commit 6d441f7d65f57c0f5b6da59ae851640a6e787875
Author: Stanislav Motylkov <x86corez(a)gmail.com>
AuthorDate: Tue May 25 20:32:42 2021 +0300
Commit: Stanislav Motylkov <x86corez(a)gmail.com>
CommitDate: Tue Jun 22 02:42:04 2021 +0300
[XBOX][FREELDR] Initialize PCI-AGP bridge BAR values
This fixes problem with Xbox GPU not being detected as a children device.
CORE-17600 CORE-16216
---
boot/freeldr/freeldr/arch/i386/xbox/xboxmem.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/boot/freeldr/freeldr/arch/i386/xbox/xboxmem.c
b/boot/freeldr/freeldr/arch/i386/xbox/xboxmem.c
index eb7ce22c232..14f700e7751 100644
--- a/boot/freeldr/freeldr/arch/i386/xbox/xboxmem.c
+++ b/boot/freeldr/freeldr/arch/i386/xbox/xboxmem.c
@@ -86,6 +86,31 @@ XboxInitializePCI(VOID)
PciData |= 0x00020200;
WRITE_PORT_ULONG((PULONG)PCI_TYPE1_DATA_PORT, PciData);
}
+
+ /* Select AGP to PCI bridge */
+ PciCfg1.u.bits.DeviceNumber = 30;
+ /* Select register VendorID & DeviceID */
+ PciCfg1.u.bits.RegisterNumber = 0x00;
+
+ WRITE_PORT_ULONG(PCI_TYPE1_ADDRESS_PORT, PciCfg1.u.AsULONG);
+ PciData = READ_PORT_ULONG((PULONG)PCI_TYPE1_DATA_PORT);
+
+ if (PciData == 0x01B710DE)
+ {
+ /* Zero out uninitialized AGP Host bridge BARs */
+
+ /* Select register BAR0 */
+ PciCfg1.u.bits.RegisterNumber = 0x10;
+ WRITE_PORT_ULONG(PCI_TYPE1_ADDRESS_PORT, PciCfg1.u.AsULONG);
+ /* Zero it out */
+ WRITE_PORT_ULONG((PULONG)PCI_TYPE1_DATA_PORT, 0);
+
+ /* Select register BAR1 */
+ PciCfg1.u.bits.RegisterNumber = 0x14;
+ WRITE_PORT_ULONG(PCI_TYPE1_ADDRESS_PORT, PciCfg1.u.AsULONG);
+ /* Zero it out */
+ WRITE_PORT_ULONG((PULONG)PCI_TYPE1_DATA_PORT, 0);
+ }
}
VOID