The PCI devices get enumerated during PEI (Platform Early Init)?
I think UEFI boot loaders (OpenCore, etc.) and UEFI drivers load too late (after the PCI devices get enumerated) to change the BAR size?
The PCI devices would need to be re-enumerated and resources re-assigned. Is there a way to do that outside of PEI?
If you can find the code, then maybe you can change it? People have applied changes to ROMs of older Mac Pros but not PEI stuff and not to MacPro7,1 as far as I remember.
Does connecting or disconnecting a Thunderbolt device cause re-enumeration of PCI devices during OpenCore menu or Apple's Startup Manager menu? It might re-enumerate only the devices that are connected to the Thunderbolt port?
Write a Windows or Mac OS X driver to resize the BAR and force reenumerate PCI devices in the OS? I don't know how to force re-enumeration in either case.
It might be easier to enable resizable BAR on my Power Macintosh 8600/200 from 1997 because I can patch the part of the ROM that enumerates PCI devices (the ROM is Open Firmware fcode that is compiled into RAM). Of course, any cards with resizable BAR won't have drivers for my Power Mac unless I'm running Linux and the driver is open source and compiles for PowerPC. Also, the Power Mac is 32-bit and can't use BARs greater than 128 MB or 256 MB with Mac OS nvramrc patch or 512 MB with my nvramrc patch or 1024 MB with a nvramrc patch I haven't made yet. 2048 MB is impossible because the only physical addresses for that are 0x00000000 (covers all the RAM) and 0x80000000 (covers all the I/O and ROM).
I have a Power Mac Quad G5 from 2005 which is 64-bit but I don't think it uses 64-bit BARs - at least I haven't seen it assign more than 32-bits. I know the fcode is limited to 512 MB BARs.
Here's the resizable BAR capability of my Radeon Pro W5700 (using the command
sudo lspci -s 03:00.0 -nnvv
from my pciutils fork for macOS). It's in a hackintosh that doesn't have resizable BAR options in firmware.
Code:
03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon Pro W5700] [1002:7312] (prog-if 00 [VGA controller])
Capabilities: [200 v1] Physical Resizable BAR
BAR 0: current size: 256MB, supported: 256MB 512MB 1GB 2GB 4GB 8GB
BAR 2: current size: 2MB, supported: 2MB 4MB 8MB 16MB 32MB 64MB 128MB 256MB