diff --git a/Pixel3XL/Pixel3XLDxe/Pixel3XLDxe.c b/Pixel3XL/Pixel3XLDxe/Pixel3XLDxe.c index 039e696..af833d2 100644 --- a/Pixel3XL/Pixel3XLDxe/Pixel3XLDxe.c +++ b/Pixel3XL/Pixel3XLDxe/Pixel3XLDxe.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -35,11 +36,21 @@ #include "Pixel3XLDxe.h" +EFI_CPU_ARCH_PROTOCOL *gCpu; + VOID InitPeripherals ( IN VOID ) { + EFI_STATUS Status; + // https://lists.01.org/pipermail/edk2-devel/2017-August/013417.html + Status = gCpu->SetMemoryAttributes (gCpu, 0xa1a10000, 0x200000, + EFI_MEMORY_UC | EFI_MEMORY_XP); + ASSERT_EFI_ERROR (Status); + Status = gCpu->SetMemoryAttributes (gCpu, 0x9d400000, 0x2400000, + EFI_MEMORY_WC | EFI_MEMORY_XP); + ASSERT_EFI_ERROR (Status); } /** @@ -75,6 +86,9 @@ Pixel3XLEntryPoint ( EFI_STATUS Status; EFI_EVENT EndOfDxeEvent; + Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&gCpu); + ASSERT_EFI_ERROR(Status); + InitPeripherals (); // diff --git a/Pixel3XL/Pixel3XLDxe/Pixel3XLDxe.inf b/Pixel3XL/Pixel3XLDxe/Pixel3XLDxe.inf index e803172..38c47f0 100644 --- a/Pixel3XL/Pixel3XLDxe/Pixel3XLDxe.inf +++ b/Pixel3XL/Pixel3XLDxe/Pixel3XLDxe.inf @@ -39,9 +39,10 @@ [Protocols] gEfiDevicePathFromTextProtocolGuid gEfiLoadedImageProtocolGuid + gEfiCpuArchProtocolGuid [Guids] gEfiEndOfDxeEventGroupGuid [Depex] - TRUE + gEfiCpuArchProtocolGuid