mirror of
https://github.com/Dasharo/edk2.git
synced 2026-03-06 14:47:27 -08:00
Replace the direct `mOverride = &BhtOverride` assignment in InitializeSdMmcPciHcDxe with a standalone DXE driver that installs gEdkiiSdMmcOverrideProtocolGuid, which SdMmcPciHcDxe already discovers via LocateProtocol in SdMmcPciHcDriverBindingStart. The previous integration had two problems. First, assigning mOverride in the entry point before any DriverBindingStart call meant the LocateProtocol lookup was always skipped, making it impossible for any other platform driver to provide an alternative override. Second, BayhubHost.c depended on SdMmcPciHcDxe-internal headers and helpers (SdMmcHcOrMmio, SdMmcHcRwMmio, SdMmcHcClockSupply, SD_MMC_HC_PRIVATE_DATA), preventing it from being compiled as a separate module. The new BayhubSdMmcOverrideDxe driver uses EFI_PCI_IO_PROTOCOL directly for all SDHCI register access and provides BhtHostClockSupply as a self-contained 400 KHz initialisation routine, removing all dependencies on SdMmcPciHcDxe internals. SdMmcPciHcDxe is restored to its upstream state; BayhubHost sources are removed from it entirely. Platform firmware that requires BayHub SD/eMMC support should include both SdMmcPciHcDxe.inf and BayhubSdMmcOverrideDxe.inf in its DSC. Signed-off-by: Filip Lewinski <filip.lewinski@3mdeb.com>