Skip to content

CMP 40HX Windows Unlock v2.0.2

Latest

Choose a tag to compare

@Cyridd Cyridd released this 04 Oct 19:50
· 5 commits to main since this release
2ddce62

v2.0.2: Gen2 PL0 parity with PZH1gdmu's v3.2.0

This release brings the Windows Gen2 register sequence in line with v3.2.0 release by PZH1gdmu.
It fixes a BSOD during Gen2 bring-up that some users hit with earlier builds (#9).

Background

PZH1gdmu and their repository became unavailable a few days before this release.
The reason is unknown. The v3.2.0 release was obtained from a copy downloaded earlier,
and it is no longer possible to fetch it from the original location.

The PL0 register table used here was recovered by disassembling
main.gen2Main / main.gen2WritePL0 from that v3.2.0 binary
, not taken from
published source. The recovered table, the read-modify-write masks, and the
reconstructed PnP fallback sequence are documented in
windows/tools/inst40hx/gen2_pl0_v2.go. If you still have the original v3.2.0
build, please compare its hash against the one above.

Fixed

  • BSOD during Gen2 bring-up (#9).

Changed

  • PL0 sequence matches 3.2.0.
    • New PL_LINK_RATE (0x8C1C0) write.
    • LINK_CONFIG_0 and PL_LINK_RATE are now read-modify-write with a masked
      readback check. Previously LINK_CONFIG_0 was written as the constant
      0x80085800.
  • BAR0 / BOOT_0 validation on every PL0 write, including after Link Disable
    and PnP recovery, not only once at startup. If the check fails, nothing is
    written and Gen2 aborts safely.
  • Gen2AutoHard now defaults to 0 (off), as in 3.2.0. The GUI policy
    checkbox follows the new default. A manual -hard run is unaffected.
  • New PnP fallback between Stage 1 and Stage 2. If retrain fails, the 40HX
    is disabled/enabled via PnP, the driver is reloaded, and PL0, TLS and retrain
    are redone before Stage 2 is considered. Turn it off with Gen2PnpFallback=0.
    This sequence is reconstructed from the order of calls in 3.2.0, not a
    byte-for-byte copy.

Added

  • -gen2dry: read-only mode. Prints the current PL0 and link registers and
    which bits the fork scheme, the 3.2.0 scheme and the EFI-RMW scheme would
    flip. Writes nothing. Useful for diagnosing before a real run.
  • Log fsync every 100 ms, so the last lines before a BSOD reach the disk.
  • New optional registry switches under HKLM\SOFTWARE\40HXUnlock:
    Gen2WriteLtssmOvr, Gen2WritePlLinkRate, Gen2Pl0EfiRmw
    (the last one is for A/B testing only).

Upgrade notes

  • If you relied on the automatic Link Disable fallback, set
    Gen2AutoHard=1. If the value was already set explicitly, it is kept.
    The key is deleted on uninstall, so a reinstall returns to the new default.
  • With the PnP fallback on, a logon where Stage 1 fails will briefly
    disable/enable the display adapter.
  • Replace your existing 40HXInstaller.exe with the new build. The previous
    binary does not contain these changes.

Credits