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

Using patches provided with Rebar UEFI module prevents BIOS from functioning on ASRock Z77 OC Formula #111

Open
4 tasks done
pntsrgd opened this issue Jan 5, 2024 · 1 comment
Labels
bios issue with firmware that needs patching

Comments

@pntsrgd
Copy link

pntsrgd commented Jan 5, 2024

System

  • Motherboard: ASRock Z77 OC Formula
  • BIOS Version: 2.40
  • GPU: AMD Radeon 6600 XT
  • CSM is turned off. Make sure to confirm this in the BIOS and not with GPU-Z or similar since it can be inaccurate
  • 4G decoding is enabled. Make sure to confirm this in the BIOS and not with GPU-Z or similar since it can be inaccurate
  • UEFIPatch is applied (see Using UEFIPatch for more information). On some motherboards DSDT Patching is also needed
  • I have read Common issues (and fixes)

Description

DSDT patching has been applied as per wiki.
 
The following patches appear to prevent this motherboard from booting:
PciHostBridge | Replace 16GB MMIO region with complete use of physical address space (Ivy Bridge).
PciHostBridge | Remove 4GB limit for PciRootBridgeIo.Mem

The following patches do not appear to cause issues:
PciHostBridge | Remove <4GB BAR size limit in SubmitResources (Ivy Bridge)
PciBus | Remove <16GB BAR size limit (Ivy Bridge/Haswell)
Runtime | Remove 4GB limit for CpuIo2

If I do not patch UEFI, I can get Rebar to work up to 2 GB as expected. Applying PciHostBridge | Replace 16GB MMIO region with complete use of physical address space (Ivy Bridge). with DSDT will POST, enter Windows, and allow RebarState to be set. Attempting to enter BIOS configuration with this patch applied, however, results in a hard lock of the system. The system freezes with "A2" on the screen. PciHostBridge | Remove 4GB limit for PciRootBridgeIo.Mem results in a failed POST if PciHostBridge | Replace 16GB MMIO region with complete use of physical address space (Ivy Bridge) is not applied.

Windows does not show "PCI Bus" under "Large Memory." I saw that this was an issue seen on Haswell systems and wondered if I may need a similar patch.

GPU-Z does show ReBAR and Above 4G Decoding enabled.

This does not appear to be a case of losing display during POST - the BIOS initially shows up and just hangs if I attempt to enter configuration. Trying to use the IGP doesn't fix the problem.

It appears that the patches only cause this failure after turning on Above 4G Decoding. While Above 4G Decoding is disabled, BIOS setup can be entered without issue. I've attached my modification that includes only changes to option visibility (to display Above 4G Decoding and CSM options) and the procedures outlines in the Wiki. DSDT has been modified. All files were injected with MMTool to prevent any pad file issues.

rebarZ77OCF2.zip

DSDT:

                    CreateQWordField (BUF0, \_SB.PCI0._Y0F._LEN, M2LN)  // _LEN: Length
                    CreateQWordField (BUF0, \_SB.PCI0._Y0F._MIN, M2MN)  // _MIN: Minimum Base Address
                    CreateQWordField (BUF0, \_SB.PCI0._Y0F._MAX, M2MX)  // _MAX: Maximum Base Address
                    M2MX = 0xFFFFFFFFF
                    If ((TUUD >= 0x1000))
                    {
                        M2MN = (TUUD << 0x14)
                    }
                    Else
                    {
                        M2MN = 0x0000000100000000
                    }

                    M2LN = (M2MX - M2MN) + One
                }

                Return (BUF0) /* \_SB_.PCI0.BUF0 */
@pntsrgd pntsrgd changed the title Using patches provided with RebarDXE prevents BIOS from functioning on ASRock Z77 OC Formula Using patches provided with Rebar UEFI module prevents BIOS from functioning on ASRock Z77 OC Formula Jan 9, 2024
@pntsrgd
Copy link
Author

pntsrgd commented Jan 15, 2024

Looking further into it, it looks like "PCI Express Root Complex" and "PCI Bus" may be the same device. Furthermore, the patching actually seems to work - setting any value (including 32) works without issue, but attempting to enter BIOS setup fails when patches are applied.

While this allows me to use whatever BAR I want, it does prevent any access to BIOS to load settings after flashing the patched image. Once the patch is applied, attempting to enter BIOS setup is nonfunctional.

ReBAR works once everything is patched, but I can't access BIOS.

Additionally, it appears that the boot option select menu loads fine when patched. It attempting to access UEFI setup from this menu also results in a hard lock. The hard lock shows a cursor and "A9" on the lower right of the screen.

@xCuri0 xCuri0 added the bios issue with firmware that needs patching label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bios issue with firmware that needs patching
Projects
None yet
Development

No branches or pull requests

2 participants