} ARM_CORE_INFO;\r
\r
typedef struct{\r
- UINT64 Signature;\r
- UINT32 Length;\r
- UINT32 Revision;\r
- UINT64 OemId;\r
- UINT64 OemTableId;\r
- UINTN OemRevision;\r
- UINTN CreatorId;\r
- UINTN CreatorRevision;\r
- EFI_GUID Identifier;\r
- UINTN DataLen;\r
+ UINT64 Signature;\r
+ UINT32 Length;\r
+ UINT32 Revision;\r
+ UINT64 OemId;\r
+ UINT64 OemTableId;\r
+ UINTN OemRevision;\r
+ UINTN CreatorId;\r
+ UINTN CreatorRevision;\r
+ EFI_GUID Identifier;\r
+ UINTN DataLen;\r
} ARM_PROCESSOR_TABLE_HEADER;\r
\r
typedef struct {\r
- ARM_PROCESSOR_TABLE_HEADER Header;\r
- UINTN NumberOfEntries;\r
- ARM_CORE_INFO *ArmCpus;\r
+ ARM_PROCESSOR_TABLE_HEADER Header;\r
+ UINTN NumberOfEntries;\r
+ ARM_CORE_INFO *ArmCpus;\r
} ARM_PROCESSOR_TABLE;\r
\r
\r
GCC_ASM_EXPORT (ArmEnableVFP)\r
\r
Arm11PartNumberMask: .word 0xFFF0\r
-Arm11PartNumber: .word 0xB020\r
+Arm11PartNumber: .word 0xB020\r
\r
.set DC_ON, (0x1<<2)\r
.set IC_ON, (0x1<<12)\r
\r
ArmReadSctlr\r
mrc p15, 0, r0, c1, c0, 0 // Read SCTLR into R0 (Read control register configuration data)\r
- bx lr\r
+ bx lr\r
\r
\r
ArmReadCpuActlr\r
; );\r
;\r
__aeabi_uread8\r
- mov r3, r0\r
+ mov r3, r0\r
\r
ldrb r1, [r3]\r
ldrb r2, [r3, #1]\r
UINT32 PcAdjust = 0;\r
\r
CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"\n%a Exception PC at 0x%08x CPSR 0x%08x ",\r
- gExceptionTypeString[ExceptionType], SystemContext.SystemContextArm->PC, SystemContext.SystemContextArm->CPSR);\r
+ gExceptionTypeString[ExceptionType], SystemContext.SystemContextArm->PC, SystemContext.SystemContextArm->CPSR);\r
SerialPortWrite ((UINT8 *) Buffer, CharCount);\r
\r
DEBUG_CODE_BEGIN ();\r
#define SP810_CTRL_BASE (ARM_EB_BOARD_PERIPH_BASE + 0x01000)\r
\r
// SYSTRCL Register\r
-#define ARM_EB_SYSCTRL 0x10001000\r
+#define ARM_EB_SYSCTRL 0x10001000\r
\r
// Dynamic Memory Controller Base\r
#define ARM_EB_DMC_BASE 0x10018000\r
// IN UINTN MpId\r
// );\r
ASM_PFX(ArmPlatformGetCorePosition):\r
- and r1, r0, #ARM_CORE_MASK\r
- and r0, r0, #ARM_CLUSTER_MASK\r
- add r0, r1, r0, LSR #7\r
- bx lr\r
+ and r1, r0, #ARM_CORE_MASK\r
+ and r0, r0, #ARM_CLUSTER_MASK\r
+ add r0, r1, r0, LSR #7\r
+ bx lr\r
\r
//UINTN\r
//ArmPlatformIsPrimaryCore (\r
// IN UINTN MpId\r
// );\r
ArmPlatformGetCorePosition FUNCTION\r
- and r1, r0, #ARM_CORE_MASK\r
- and r0, r0, #ARM_CLUSTER_MASK\r
- add r0, r1, r0, LSR #7\r
- bx lr\r
+ and r1, r0, #ARM_CORE_MASK\r
+ and r0, r0, #ARM_CLUSTER_MASK\r
+ add r0, r1, r0, LSR #7\r
+ bx lr\r
ENDFUNC\r
\r
//UINTN\r
// Read the GPT partition entry array into memory so we can get the partition names\r
Status = ReadPartitionEntries (FlashBlockIo, &PartitionEntries);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((EFI_D_ERROR, "Warning: Failed to read partitions from Android NVM device (status: %r)\n", Status));\r
- // Failing to locate partitions should not prevent to do other Android FastBoot actions\r
- return EFI_SUCCESS;\r
+ DEBUG ((EFI_D_ERROR, "Warning: Failed to read partitions from Android NVM device (status: %r)\n", Status));\r
+ // Failing to locate partitions should not prevent to do other Android FastBoot actions\r
+ return EFI_SUCCESS;\r
}\r
\r
// Get every Block IO protocol instance installed in the system\r
// IN UINTN MpId\r
// );\r
ASM_PFX(ArmPlatformGetCorePosition):\r
- and r1, r0, #ARM_CORE_MASK\r
- and r0, r0, #ARM_CLUSTER_MASK\r
- add r0, r1, r0, LSR #7\r
- bx lr\r
+ and r1, r0, #ARM_CORE_MASK\r
+ and r0, r0, #ARM_CLUSTER_MASK\r
+ add r0, r1, r0, LSR #7\r
+ bx lr\r
\r
//UINTN\r
//ArmPlatformIsPrimaryCore (\r
// IN UINTN MpId\r
// );\r
ArmPlatformGetCorePosition FUNCTION\r
- and r1, r0, #ARM_CORE_MASK\r
- and r0, r0, #ARM_CLUSTER_MASK\r
- add r0, r1, r0, LSR #7\r
- bx lr\r
+ and r1, r0, #ARM_CORE_MASK\r
+ and r0, r0, #ARM_CLUSTER_MASK\r
+ add r0, r1, r0, LSR #7\r
+ bx lr\r
ENDFUNC\r
\r
//UINTN\r
ArmPlatformGetPrimaryCoreMpId FUNCTION\r
LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)\r
ldr r0, [r0]\r
- bx lr\r
+ bx lr\r
ENDFUNC\r
\r
//UINTN\r
ldrh w1, [x1]\r
cmp w0, w1\r
b.ne 1f\r
- mov x0, #1\r
+ mov x0, #1\r
ret\r
1:\r
- mov x0, #0\r
+ mov x0, #0\r
ret\r
\r
//UINTN\r
cmp r0, r1\r
moveq r0, #1\r
movne r0, #0\r
- bx lr\r
+ bx lr\r
\r
//UINTN\r
//ArmPlatformGetCorePosition (\r
cmp r0, r1\r
moveq r0, #1\r
movne r0, #0\r
- bx lr\r
+ bx lr\r
ENDFUNC\r
\r
//UINTN\r
\r
SECTIONS\r
{\r
- . = PHYS_OFFSET;\r
+ . = PHYS_OFFSET;\r
#ifdef BOOT1\r
- .text : { boot1.o }\r
+ .text : { boot1.o }\r
#endif\r
\r
#ifdef BOOT2\r
- .text : { boot2.o }\r
+ .text : { boot2.o }\r
#endif\r
\r
#ifdef BOOT3\r
- .text : { boot3.o }\r
+ .text : { boot3.o }\r
#endif\r
\r
#ifdef BOOT3F\r
- .text : { boot3f.o }\r
+ .text : { boot3f.o }\r
#endif\r
\r
- .data : { *(.data) }\r
- .bss : { *(.bss) }\r
+ .data : { *(.data) }\r
+ .bss : { *(.bss) }\r
}\r
}\r
// Discard key in the buffer\r
do {\r
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);\r
+ Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);\r
} while(!EFI_ERROR(Status));\r
gBS->CloseEvent (WaitList[0]);\r
Print(L"\n\r");\r
UnicodeSPrint (BootVariableName, 9 * sizeof(CHAR16), L"Boot%04X", BootOrder[Index]);\r
Status = BdsStartBootOption (BootVariableName);\r
if(!EFI_ERROR(Status)){\r
- // Boot option returned successfully, hence don't need to start next boot option\r
- break;\r
+ // Boot option returned successfully, hence don't need to start next boot option\r
+ break;\r
}\r
// In case of success, we should not return from this call.\r
}\r
EFIAPI\r
LcdGraphicsBlt (\r
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
- IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL\r
- IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,\r
- IN UINTN SourceX,\r
- IN UINTN SourceY,\r
- IN UINTN DestinationX,\r
- IN UINTN DestinationY,\r
- IN UINTN Width,\r
- IN UINTN Height,\r
- IN UINTN Delta OPTIONAL // Number of BYTES in a row of the BltBuffer\r
+ IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL\r
+ IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,\r
+ IN UINTN SourceX,\r
+ IN UINTN SourceY,\r
+ IN UINTN DestinationX,\r
+ IN UINTN DestinationY,\r
+ IN UINTN Width,\r
+ IN UINTN Height,\r
+ IN UINTN Delta OPTIONAL // Number of BYTES in a row of the BltBuffer\r
)\r
{\r
- EFI_STATUS Status;\r
- UINT32 HorizontalResolution;\r
+ EFI_STATUS Status;\r
+ UINT32 HorizontalResolution;\r
UINT32 VerticalResolution;\r
- LCD_INSTANCE* Instance;\r
+ LCD_INSTANCE* Instance;\r
\r
Instance = LCD_INSTANCE_FROM_GOP_THIS(This);\r
\r
BltOperation,DestinationX,DestinationY,Width,Height,HorizontalResolution,VerticalResolution));\r
\r
// Check we have reasonable parameters\r
- if (Width == 0 || Height == 0) {\r
+ if (Width == 0 || Height == 0) {\r
DEBUG((DEBUG_ERROR, "LcdGraphicsBlt: ERROR - Invalid dimension: Zero size area.\n" ));\r
- Status = EFI_INVALID_PARAMETER;\r
- goto EXIT;\r
- }\r
-\r
- if ((BltOperation == EfiBltVideoFill) || (BltOperation == EfiBltBufferToVideo) || (BltOperation == EfiBltVideoToBltBuffer)) {\r
- ASSERT( BltBuffer != NULL);\r
- }\r
-\r
- /*if ((DestinationX >= HorizontalResolution) || (DestinationY >= VerticalResolution)) {\r
- DEBUG((DEBUG_ERROR, "LcdGraphicsBlt: ERROR - Invalid destination.\n" ));\r
- Status = EFI_INVALID_PARAMETER;\r
- goto EXIT;\r
- }*/\r
-\r
- // If we are reading data out of the video buffer, check that the source area is within the display limits\r
- if ((BltOperation == EfiBltVideoToBltBuffer) || (BltOperation == EfiBltVideoToVideo)) {\r
+ Status = EFI_INVALID_PARAMETER;\r
+ goto EXIT;\r
+ }\r
+\r
+ if ((BltOperation == EfiBltVideoFill) || (BltOperation == EfiBltBufferToVideo) || (BltOperation == EfiBltVideoToBltBuffer)) {\r
+ ASSERT( BltBuffer != NULL);\r
+ }\r
+\r
+ /*if ((DestinationX >= HorizontalResolution) || (DestinationY >= VerticalResolution)) {\r
+ DEBUG((DEBUG_ERROR, "LcdGraphicsBlt: ERROR - Invalid destination.\n" ));\r
+ Status = EFI_INVALID_PARAMETER;\r
+ goto EXIT;\r
+ }*/\r
+\r
+ // If we are reading data out of the video buffer, check that the source area is within the display limits\r
+ if ((BltOperation == EfiBltVideoToBltBuffer) || (BltOperation == EfiBltVideoToVideo)) {\r
if ((SourceY + Height > VerticalResolution) || (SourceX + Width > HorizontalResolution)) {\r
DEBUG((DEBUG_INFO, "LcdGraphicsBlt: ERROR - Invalid source resolution.\n" ));\r
DEBUG((DEBUG_INFO, " - SourceY=%d + Height=%d > VerticalResolution=%d.\n", SourceY, Height, VerticalResolution ));\r
Status = EFI_INVALID_PARAMETER;\r
goto EXIT;\r
}\r
- }\r
+ }\r
\r
- // If we are writing data into the video buffer, that the destination area is within the display limits\r
- if ((BltOperation == EfiBltVideoFill) || (BltOperation == EfiBltBufferToVideo) || (BltOperation == EfiBltVideoToVideo)) {\r
+ // If we are writing data into the video buffer, that the destination area is within the display limits\r
+ if ((BltOperation == EfiBltVideoFill) || (BltOperation == EfiBltBufferToVideo) || (BltOperation == EfiBltVideoToVideo)) {\r
if ((DestinationY + Height > VerticalResolution) || (DestinationX + Width > HorizontalResolution)) {\r
DEBUG((DEBUG_INFO, "LcdGraphicsBlt: ERROR - Invalid destination resolution.\n" ));\r
DEBUG((DEBUG_INFO, " - DestinationY=%d + Height=%d > VerticalResolution=%d.\n", DestinationY, Height, VerticalResolution ));\r
Status = EFI_INVALID_PARAMETER;\r
goto EXIT;\r
}\r
- }\r
+ }\r
\r
//\r
// Perform the Block Transfer Operation\r
//\r
\r
- switch (BltOperation) {\r
- case EfiBltVideoFill:\r
- Status = BltVideoFill (This, BltBuffer, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);\r
- break;\r
+ switch (BltOperation) {\r
+ case EfiBltVideoFill:\r
+ Status = BltVideoFill (This, BltBuffer, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);\r
+ break;\r
\r
- case EfiBltVideoToBltBuffer:\r
- Status = BltVideoToBltBuffer (This, BltBuffer, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);\r
+ case EfiBltVideoToBltBuffer:\r
+ Status = BltVideoToBltBuffer (This, BltBuffer, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);\r
break;\r
\r
case EfiBltBufferToVideo:\r
Status = BltBufferToVideo (This, BltBuffer, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);\r
- break;\r
+ break;\r
\r
- case EfiBltVideoToVideo:\r
- Status = BltVideoToVideo (This, BltBuffer, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);\r
- break;\r
+ case EfiBltVideoToVideo:\r
+ Status = BltVideoToVideo (This, BltBuffer, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);\r
+ break;\r
\r
- case EfiGraphicsOutputBltOperationMax:\r
- default:\r
- DEBUG((DEBUG_ERROR, "LcdGraphicsBlt: Invalid Operation\n"));\r
- Status = EFI_INVALID_PARAMETER;\r
- break;\r
- }\r
+ case EfiGraphicsOutputBltOperationMax:\r
+ default:\r
+ DEBUG((DEBUG_ERROR, "LcdGraphicsBlt: Invalid Operation\n"));\r
+ Status = EFI_INVALID_PARAMETER;\r
+ break;\r
+ }\r
\r
EXIT:\r
- return Status;\r
+ return Status;\r
}\r
goto EXIT;\r
}\r
\r
- // Install the Graphics Output Protocol and the Device Path\r
- Status = gBS->InstallMultipleProtocolInterfaces(\r
- &Instance->Handle,\r
- &gEfiGraphicsOutputProtocolGuid, &Instance->Gop,\r
- &gEfiDevicePathProtocolGuid, &Instance->DevicePath,\r
- NULL\r
- );\r
-\r
- if (EFI_ERROR(Status)) {\r
- DEBUG((DEBUG_ERROR, "GraphicsOutputDxeInitialize: Can not install the protocol. Exit Status=%r\n", Status));\r
- goto EXIT;\r
- }\r
-\r
- // Register for an ExitBootServicesEvent\r
- // When ExitBootServices starts, this function here will make sure that the graphics driver will shut down properly,\r
- // i.e. it will free up all allocated memory and perform any necessary hardware re-configuration.\r
- Status = gBS->CreateEvent (\r
- EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
- TPL_NOTIFY,\r
- LcdGraphicsExitBootServicesEvent, NULL,\r
- &Instance->ExitBootServicesEvent\r
- );\r
-\r
- if (EFI_ERROR(Status)) {\r
- DEBUG((DEBUG_ERROR, "GraphicsOutputDxeInitialize: Can not install the ExitBootServicesEvent handler. Exit Status=%r\n", Status));\r
- goto EXIT_ERROR_UNINSTALL_PROTOCOL;\r
- }\r
-\r
- // To get here, everything must be fine, so just exit\r
- goto EXIT;\r
+ // Install the Graphics Output Protocol and the Device Path\r
+ Status = gBS->InstallMultipleProtocolInterfaces(\r
+ &Instance->Handle,\r
+ &gEfiGraphicsOutputProtocolGuid, &Instance->Gop,\r
+ &gEfiDevicePathProtocolGuid, &Instance->DevicePath,\r
+ NULL\r
+ );\r
+\r
+ if (EFI_ERROR(Status)) {\r
+ DEBUG((DEBUG_ERROR, "GraphicsOutputDxeInitialize: Can not install the protocol. Exit Status=%r\n", Status));\r
+ goto EXIT;\r
+ }\r
+\r
+ // Register for an ExitBootServicesEvent\r
+ // When ExitBootServices starts, this function here will make sure that the graphics driver will shut down properly,\r
+ // i.e. it will free up all allocated memory and perform any necessary hardware re-configuration.\r
+ Status = gBS->CreateEvent (\r
+ EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
+ TPL_NOTIFY,\r
+ LcdGraphicsExitBootServicesEvent, NULL,\r
+ &Instance->ExitBootServicesEvent\r
+ );\r
+\r
+ if (EFI_ERROR(Status)) {\r
+ DEBUG((DEBUG_ERROR, "GraphicsOutputDxeInitialize: Can not install the ExitBootServicesEvent handler. Exit Status=%r\n", Status));\r
+ goto EXIT_ERROR_UNINSTALL_PROTOCOL;\r
+ }\r
+\r
+ // To get here, everything must be fine, so just exit\r
+ goto EXIT;\r
\r
EXIT_ERROR_UNINSTALL_PROTOCOL:\r
- /* The following function could return an error message,\r
- * however, to get here something must have gone wrong already,\r
- * so preserve the original error, i.e. don't change\r
- * the Status variable, even it fails to uninstall the protocol.\r
- */\r
- gBS->UninstallMultipleProtocolInterfaces (\r
- Instance->Handle,\r
- &gEfiGraphicsOutputProtocolGuid, &Instance->Gop, // Uninstall Graphics Output protocol\r
- &gEfiDevicePathProtocolGuid, &Instance->DevicePath, // Uninstall device path\r
- NULL\r
- );\r
+ /* The following function could return an error message,\r
+ * however, to get here something must have gone wrong already,\r
+ * so preserve the original error, i.e. don't change\r
+ * the Status variable, even it fails to uninstall the protocol.\r
+ */\r
+ gBS->UninstallMultipleProtocolInterfaces (\r
+ Instance->Handle,\r
+ &gEfiGraphicsOutputProtocolGuid, &Instance->Gop, // Uninstall Graphics Output protocol\r
+ &gEfiDevicePathProtocolGuid, &Instance->DevicePath, // Uninstall device path\r
+ NULL\r
+ );\r
\r
EXIT:\r
- return Status;\r
+ return Status;\r
\r
}\r
\r
EFIAPI\r
LcdGraphicsQueryMode (\r
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
- IN UINT32 ModeNumber,\r
- OUT UINTN *SizeOfInfo,\r
- OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info\r
- )\r
+ IN UINT32 ModeNumber,\r
+ OUT UINTN *SizeOfInfo,\r
+ OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info\r
+ )\r
{\r
- EFI_STATUS Status = EFI_SUCCESS;\r
- LCD_INSTANCE *Instance;\r
+ EFI_STATUS Status = EFI_SUCCESS;\r
+ LCD_INSTANCE *Instance;\r
\r
- Instance = LCD_INSTANCE_FROM_GOP_THIS(This);\r
+ Instance = LCD_INSTANCE_FROM_GOP_THIS(This);\r
\r
// Setup the hardware if not already done\r
if( !mDisplayInitialized ) {\r
}\r
}\r
\r
- // Error checking\r
- if ( (This == NULL) || (Info == NULL) || (SizeOfInfo == NULL) || (ModeNumber >= This->Mode->MaxMode) ) {\r
- DEBUG((DEBUG_ERROR, "LcdGraphicsQueryMode: ERROR - For mode number %d : Invalid Parameter.\n", ModeNumber ));\r
- Status = EFI_INVALID_PARAMETER;\r
- goto EXIT;\r
- }\r
+ // Error checking\r
+ if ( (This == NULL) || (Info == NULL) || (SizeOfInfo == NULL) || (ModeNumber >= This->Mode->MaxMode) ) {\r
+ DEBUG((DEBUG_ERROR, "LcdGraphicsQueryMode: ERROR - For mode number %d : Invalid Parameter.\n", ModeNumber ));\r
+ Status = EFI_INVALID_PARAMETER;\r
+ goto EXIT;\r
+ }\r
\r
- *Info = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));\r
+ *Info = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));\r
if (*Info == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto EXIT;\r
}\r
\r
EXIT:\r
- return Status;\r
+ return Status;\r
}\r
\r
/***************************************\r
EFIAPI\r
LcdGraphicsSetMode (\r
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
- IN UINT32 ModeNumber\r
- )\r
+ IN UINT32 ModeNumber\r
+ )\r
{\r
- EFI_STATUS Status = EFI_SUCCESS;\r
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL FillColour;\r
- LCD_INSTANCE* Instance;\r
- LCD_BPP Bpp;\r
+ EFI_STATUS Status = EFI_SUCCESS;\r
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL FillColour;\r
+ LCD_INSTANCE* Instance;\r
+ LCD_BPP Bpp;\r
\r
- Instance = LCD_INSTANCE_FROM_GOP_THIS (This);\r
+ Instance = LCD_INSTANCE_FROM_GOP_THIS (This);\r
\r
// Setup the hardware if not already done\r
if(!mDisplayInitialized) {\r
goto EXIT;\r
}\r
\r
- // Set the oscillator frequency to support the new mode\r
+ // Set the oscillator frequency to support the new mode\r
Status = LcdPlatformSetMode (ModeNumber);\r
if (EFI_ERROR(Status)) {\r
Status = EFI_DEVICE_ERROR;\r
goto EXIT;\r
}\r
\r
- // Update the UEFI mode information\r
- This->Mode->Mode = ModeNumber;\r
- LcdPlatformQueryMode (ModeNumber,&Instance->ModeInfo);\r
- Status = LcdPlatformGetBpp(ModeNumber, &Bpp);\r
- if (EFI_ERROR(Status)) {\r
- DEBUG ((DEBUG_ERROR, "LcdGraphicsSetMode: ERROR - Couldn't get bytes per pixel, status: %r\n", Status));\r
- goto EXIT;\r
- }\r
- This->Mode->FrameBufferSize = Instance->ModeInfo.VerticalResolution\r
- * Instance->ModeInfo.PixelsPerScanLine\r
- * GetBytesPerPixel(Bpp);\r
+ // Update the UEFI mode information\r
+ This->Mode->Mode = ModeNumber;\r
+ LcdPlatformQueryMode (ModeNumber,&Instance->ModeInfo);\r
+ Status = LcdPlatformGetBpp(ModeNumber, &Bpp);\r
+ if (EFI_ERROR(Status)) {\r
+ DEBUG ((DEBUG_ERROR, "LcdGraphicsSetMode: ERROR - Couldn't get bytes per pixel, status: %r\n", Status));\r
+ goto EXIT;\r
+ }\r
+ This->Mode->FrameBufferSize = Instance->ModeInfo.VerticalResolution\r
+ * Instance->ModeInfo.PixelsPerScanLine\r
+ * GetBytesPerPixel(Bpp);\r
\r
// Set the hardware to the new mode\r
- Status = LcdSetMode (ModeNumber);\r
+ Status = LcdSetMode (ModeNumber);\r
if (EFI_ERROR(Status)) {\r
Status = EFI_DEVICE_ERROR;\r
goto EXIT;\r
}\r
\r
- // The UEFI spec requires that we now clear the visible portions of the output display to black.\r
+ // The UEFI spec requires that we now clear the visible portions of the output display to black.\r
\r
// Set the fill colour to black\r
SetMem (&FillColour, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);\r
0);\r
\r
EXIT:\r
- return Status;\r
+ return Status;\r
}\r
\r
UINTN\r
EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL FvbProtocol;\r
VOID* ShadowBuffer;\r
\r
- NOR_FLASH_DEVICE_PATH DevicePath;\r
+ NOR_FLASH_DEVICE_PATH DevicePath;\r
};\r
\r
EFI_STATUS\r
EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader;\r
VARIABLE_STORE_HEADER *VariableStoreHeader;\r
UINTN VariableStoreLength;\r
- UINTN FvLength;\r
+ UINTN FvLength;\r
\r
FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER*)Instance->RegionBaseAddress;\r
\r
\r
\r
typedef struct {\r
- UINTN HasQos; // has QoS registers\r
- UINTN MaxChip; // number of memory chips accessible\r
- BOOLEAN IsUserCfg;\r
+ UINTN HasQos; // has QoS registers\r
+ UINTN MaxChip; // number of memory chips accessible\r
+ BOOLEAN IsUserCfg;\r
UINT32 User0Cfg;\r
UINT32 User2Cfg;\r
- UINT32 RefreshPeriod;\r
- UINT32 CasLatency;\r
- UINT32 WriteLatency;\r
- UINT32 t_mrd;\r
- UINT32 t_ras;\r
- UINT32 t_rc;\r
- UINT32 t_rcd;\r
- UINT32 t_rfc;\r
- UINT32 t_rp;\r
- UINT32 t_rrd;\r
- UINT32 t_wr;\r
- UINT32 t_wtr;\r
- UINT32 t_xp;\r
- UINT32 t_xsr;\r
- UINT32 t_esr;\r
- UINT32 MemoryCfg;\r
- UINT32 MemoryCfg2;\r
- UINT32 MemoryCfg3;\r
- UINT32 ChipCfg0;\r
- UINT32 ChipCfg1;\r
- UINT32 ChipCfg2;\r
- UINT32 ChipCfg3;\r
- UINT32 t_faw;\r
- UINT32 t_data_en;\r
- UINT32 t_wdata_en;\r
+ UINT32 RefreshPeriod;\r
+ UINT32 CasLatency;\r
+ UINT32 WriteLatency;\r
+ UINT32 t_mrd;\r
+ UINT32 t_ras;\r
+ UINT32 t_rc;\r
+ UINT32 t_rcd;\r
+ UINT32 t_rfc;\r
+ UINT32 t_rp;\r
+ UINT32 t_rrd;\r
+ UINT32 t_wr;\r
+ UINT32 t_wtr;\r
+ UINT32 t_xp;\r
+ UINT32 t_xsr;\r
+ UINT32 t_esr;\r
+ UINT32 MemoryCfg;\r
+ UINT32 MemoryCfg2;\r
+ UINT32 MemoryCfg3;\r
+ UINT32 ChipCfg0;\r
+ UINT32 ChipCfg1;\r
+ UINT32 ChipCfg2;\r
+ UINT32 ChipCfg3;\r
+ UINT32 t_faw;\r
+ UINT32 t_data_en;\r
+ UINT32 t_wdata_en;\r
UINT32 ModeReg;\r
UINT32 ExtModeReg;\r
} PL341_DMC_CONFIG;\r
#define DMC_MEMORY_CFG2_REG 0x4C\r
#define DMC_MEMORY_CFG3_REG 0x50\r
#define DMC_T_FAW_REG 0x54\r
-#define DMC_T_RDATA_EN 0x5C /* DFI read data enable register */\r
+#define DMC_T_RDATA_EN 0x5C /* DFI read data enable register */\r
#define DMC_T_WRLAT_DIFF 0x60 /* DFI write data enable register */\r
\r
// Returns the state of the memory controller:\r
//\r
// PHY Register Settings\r
//\r
-#define PHY_PTM_DFI_CLK_RANGE 0xE00 // DDR2 PHY PTM register offset\r
-#define PHY_PTM_IOTERM 0xE04\r
-#define PHY_PTM_PLL_EN 0xe0c\r
-#define PHY_PTM_PLL_RANGE 0xe18\r
-#define PHY_PTM_FEEBACK_DIV 0xe1c\r
-#define PHY_PTM_RCLK_DIV 0xe20\r
-#define PHY_PTM_LOCK_STATUS 0xe28\r
-#define PHY_PTM_INIT_DONE 0xe34\r
-#define PHY_PTM_ADDCOM_IOSTR_OFF 0xec8\r
-#define PHY_PTM_SQU_TRAINING 0xee8\r
-#define PHY_PTM_SQU_STAT 0xeec\r
+#define PHY_PTM_DFI_CLK_RANGE 0xE00 // DDR2 PHY PTM register offset\r
+#define PHY_PTM_IOTERM 0xE04\r
+#define PHY_PTM_PLL_EN 0xe0c\r
+#define PHY_PTM_PLL_RANGE 0xe18\r
+#define PHY_PTM_FEEBACK_DIV 0xe1c\r
+#define PHY_PTM_RCLK_DIV 0xe20\r
+#define PHY_PTM_LOCK_STATUS 0xe28\r
+#define PHY_PTM_INIT_DONE 0xe34\r
+#define PHY_PTM_ADDCOM_IOSTR_OFF 0xec8\r
+#define PHY_PTM_SQU_TRAINING 0xee8\r
+#define PHY_PTM_SQU_STAT 0xeec\r
\r
// ==============================================================================\r
// PIPD 40G DDR2/DDR3 PHY Register definitions\r
//\r
// Offsets from APB Base Address\r
// ==============================================================================\r
-#define PHY_BYTE0_OFFSET 0x000\r
-#define PHY_BYTE1_OFFSET 0x200\r
-#define PHY_BYTE2_OFFSET 0x400\r
-#define PHY_BYTE3_OFFSET 0x600\r
+#define PHY_BYTE0_OFFSET 0x000\r
+#define PHY_BYTE1_OFFSET 0x200\r
+#define PHY_BYTE2_OFFSET 0x400\r
+#define PHY_BYTE3_OFFSET 0x600\r
\r
-#define PHY_BYTE0_COARSE_SQADJ_INIT 0x064 ;// Coarse squelch adjust\r
-#define PHY_BYTE1_COARSE_SQADJ_INIT 0x264 ;// Coarse squelch adjust\r
-#define PHY_BYTE2_COARSE_SQADJ_INIT 0x464 ;// Coarse squelch adjust\r
-#define PHY_BYTE3_COARSE_SQADJ_INIT 0x664 ;// Coarse squelch adjust\r
+#define PHY_BYTE0_COARSE_SQADJ_INIT 0x064 ;// Coarse squelch adjust\r
+#define PHY_BYTE1_COARSE_SQADJ_INIT 0x264 ;// Coarse squelch adjust\r
+#define PHY_BYTE2_COARSE_SQADJ_INIT 0x464 ;// Coarse squelch adjust\r
+#define PHY_BYTE3_COARSE_SQADJ_INIT 0x664 ;// Coarse squelch adjust\r
\r
-#define PHY_BYTE0_IOSTR_OFFSET 0x004\r
-#define PHY_BYTE1_IOSTR_OFFSET 0x204\r
-#define PHY_BYTE2_IOSTR_OFFSET 0x404\r
-#define PHY_BYTE3_IOSTR_OFFSET 0x604\r
+#define PHY_BYTE0_IOSTR_OFFSET 0x004\r
+#define PHY_BYTE1_IOSTR_OFFSET 0x204\r
+#define PHY_BYTE2_IOSTR_OFFSET 0x404\r
+#define PHY_BYTE3_IOSTR_OFFSET 0x604\r
\r
\r
;//--------------------------------------------------------------------------\r
\r
// DFI Clock ranges:\r
\r
-#define PHY_PTM_DFI_CLK_RANGE_200MHz 0x0\r
-#define PHY_PTM_DFI_CLK_RANGE_201_267MHz 0x1\r
-#define PHY_PTM_DFI_CLK_RANGE_268_333MHz 0x2\r
-#define PHY_PTM_DFI_CLK_RANGE_334_400MHz 0x3\r
-#define PHY_PTM_DFI_CLK_RANGE_401_533MHz 0x4\r
-#define PHY_PTM_DFI_CLK_RANGE_534_667MHz 0x5\r
-#define PHY_PTM_DFI_CLK_RANGE_668_800MHz 0x6\r
+#define PHY_PTM_DFI_CLK_RANGE_200MHz 0x0\r
+#define PHY_PTM_DFI_CLK_RANGE_201_267MHz 0x1\r
+#define PHY_PTM_DFI_CLK_RANGE_268_333MHz 0x2\r
+#define PHY_PTM_DFI_CLK_RANGE_334_400MHz 0x3\r
+#define PHY_PTM_DFI_CLK_RANGE_401_533MHz 0x4\r
+#define PHY_PTM_DFI_CLK_RANGE_534_667MHz 0x5\r
+#define PHY_PTM_DFI_CLK_RANGE_668_800MHz 0x6\r
\r
\r
\r
-#define PHY_PTM_DFI_CLK_RANGE_VAL PHY_PTM_DFI_CLK_RANGE_334_400MHz\r
+#define PHY_PTM_DFI_CLK_RANGE_VAL PHY_PTM_DFI_CLK_RANGE_334_400MHz\r
\r
//--------------------------------------------------------------------------\r
\r
\r
// PLL Range\r
\r
-#define PHY_PTM_PLL_RANGE_200_400MHz 0x0 // b0 = frequency >= 200 MHz and < 400 MHz\r
-#define PHY_PTM_PLL_RANGE_400_800MHz 0x1 // b1 = frequency >= 400 MHz.\r
-#define PHY_PTM_FEEBACK_DIV_200_400MHz 0x0 // b0 = frequency >= 200 MHz and < 400 MHz\r
-#define PHY_PTM_FEEBACK_DIV_400_800MHz 0x1 // b1 = frequency >= 400 MHz.\r
-#define PHY_PTM_REFCLK_DIV_200_400MHz 0x0\r
-#define PHY_PTM_REFCLK_DIV_400_800MHz 0x1\r
+#define PHY_PTM_PLL_RANGE_200_400MHz 0x0 // b0 = frequency >= 200 MHz and < 400 MHz\r
+#define PHY_PTM_PLL_RANGE_400_800MHz 0x1 // b1 = frequency >= 400 MHz.\r
+#define PHY_PTM_FEEBACK_DIV_200_400MHz 0x0 // b0 = frequency >= 200 MHz and < 400 MHz\r
+#define PHY_PTM_FEEBACK_DIV_400_800MHz 0x1 // b1 = frequency >= 400 MHz.\r
+#define PHY_PTM_REFCLK_DIV_200_400MHz 0x0\r
+#define PHY_PTM_REFCLK_DIV_400_800MHz 0x1\r
\r
#define TC_UIOLHNC_MASK 0x000003C0\r
#define TC_UIOLHNC_SHIFT 0x6\r
#define TC_UIOHSTOP_SHIFT 0x0\r
#define TC_UIOLHXC_VALUE 0x4\r
\r
-#define PHY_PTM_SQU_TRAINING_ENABLE 0x1\r
-#define PHY_PTM_SQU_TRAINING_DISABLE 0x0\r
+#define PHY_PTM_SQU_TRAINING_ENABLE 0x1\r
+#define PHY_PTM_SQU_TRAINING_DISABLE 0x0\r
\r
\r
//--------------------------------------\r
// JEDEC DDR2 Device Register definitions and settings\r
//--------------------------------------\r
-#define DDR_MODESET_SHFT 14\r
-#define DDR_MODESET_MR 0x0 ;// Mode register\r
-#define DDR_MODESET_EMR 0x1 ;// Extended Mode register\r
-#define DDR_MODESET_EMR2 0x2\r
-#define DDR_MODESET_EMR3 0x3\r
+#define DDR_MODESET_SHFT 14\r
+#define DDR_MODESET_MR 0x0 ;// Mode register\r
+#define DDR_MODESET_EMR 0x1 ;// Extended Mode register\r
+#define DDR_MODESET_EMR2 0x2\r
+#define DDR_MODESET_EMR3 0x3\r
\r
//\r
// Extended Mode Register settings\r
\r
#define DDR_EMR_ODS_VAL DDR_EMR_ODS_FULL\r
\r
-#define DDR_SDRAM_START_ADDR 0x10000000\r
+#define DDR_SDRAM_START_ADDR 0x10000000\r
\r
\r
// ----------------------------------------\r
// PHY IOTERM values\r
// ----------------------------------------\r
-#define PHY_PTM_IOTERM_OFF 0x0\r
-#define PHY_PTM_IOTERM_150R 0x1\r
-#define PHY_PTM_IOTERM_75R 0x2\r
-#define PHY_PTM_IOTERM_50R 0x3\r
-\r
-#define PHY_BYTE_IOSTR_60OHM 0x0\r
-#define PHY_BYTE_IOSTR_40OHM 0x1\r
-#define PHY_BYTE_IOSTR_30OHM 0x2\r
-#define PHY_BYTE_IOSTR_30AOHM 0x3\r
+#define PHY_PTM_IOTERM_OFF 0x0\r
+#define PHY_PTM_IOTERM_150R 0x1\r
+#define PHY_PTM_IOTERM_75R 0x2\r
+#define PHY_PTM_IOTERM_50R 0x3\r
+\r
+#define PHY_BYTE_IOSTR_60OHM 0x0\r
+#define PHY_BYTE_IOSTR_40OHM 0x1\r
+#define PHY_BYTE_IOSTR_30OHM 0x2\r
+#define PHY_BYTE_IOSTR_30AOHM 0x3\r
\r
#define DDR2_MR_BURST_LENGTH_4 (2)\r
#define DDR2_MR_BURST_LENGTH_8 (3)\r
// IN UINTN MpId\r
// );\r
ASM_PFX(ArmPlatformGetCorePosition):\r
- and r1, r0, #ARM_CORE_MASK\r
- and r0, r0, #ARM_CLUSTER_MASK\r
- add r0, r1, r0, LSR #7\r
- bx lr\r
+ and r1, r0, #ARM_CORE_MASK\r
+ and r0, r0, #ARM_CLUSTER_MASK\r
+ add r0, r1, r0, LSR #7\r
+ bx lr\r
\r
//UINTN\r
//ArmPlatformGetPrimaryCoreMpId (\r
// IN UINTN MpId\r
// );\r
ArmPlatformGetCorePosition FUNCTION\r
- and r1, r0, #ARM_CORE_MASK\r
- and r0, r0, #ARM_CLUSTER_MASK\r
- add r0, r1, r0, LSR #7\r
- bx lr\r
+ and r1, r0, #ARM_CORE_MASK\r
+ and r0, r0, #ARM_CLUSTER_MASK\r
+ add r0, r1, r0, LSR #7\r
+ bx lr\r
ENDFUNC\r
\r
//UINTN\r
// Restore the Link register\r
mov lr, r7\r
\r
- beq ArmPlatformStackSetPrimary\r
+ beq ArmPlatformStackSetPrimary\r
bne ArmPlatformStackSetSecondary\r
ENDFUNC\r
\r
// IN UINTN SecondaryStackSize\r
// );\r
ArmPlatformStackSetPrimary FUNCTION\r
- mov r4, lr\r
+ mov r4, lr\r
\r
// Add stack of primary stack to StackBase\r
- add r0, r0, r2\r
+ add r0, r0, r2\r
\r
// Compute SecondaryCoresCount * SecondaryCoreStackSize\r
LoadConstantToReg (_gPcd_FixedAtBuild_PcdCoreCount, r1)\r
- ldr r1, [r1]\r
- sub r1, #1\r
- mul r3, r3, r1\r
+ ldr r1, [r1]\r
+ sub r1, #1\r
+ mul r3, r3, r1\r
\r
// Set Primary Stack ((StackBase + PrimaryStackSize) + (SecondaryCoresCount * SecondaryCoreStackSize))\r
- add sp, r0, r3\r
+ add sp, r0, r3\r
\r
bx r4\r
ENDFUNC\r
// IN UINTN SecondaryStackSize\r
// );\r
ArmPlatformStackSetSecondary FUNCTION\r
- mov r4, lr\r
+ mov r4, lr\r
mov sp, r0\r
\r
// Get Core Position\r
- mov r0, r1\r
+ mov r0, r1\r
bl ArmPlatformGetCorePosition\r
- mov r5, r0\r
+ mov r5, r0\r
\r
// Get Primary Core Position\r
bl ArmPlatformGetPrimaryCoreMpId\r
bl ArmPlatformGetCorePosition\r
\r
// Get Secondary Core Position. We should get consecutive secondary stack number from 1...(CoreCount-1)\r
- cmp r5, r0\r
+ cmp r5, r0\r
subhi r5, r5, #1\r
- add r5, r5, #1\r
+ add r5, r5, #1\r
\r
// Compute top of the secondary stack\r
- mul r3, r3, r5\r
+ mul r3, r3, r5\r
\r
// Set stack\r
- add sp, sp, r3\r
+ add sp, sp, r3\r
\r
bx r4\r
ENDFUNC\r
#define GET_TT_LARGEPAGE_ATTRIBUTES(TTEntry) ((TTEntry) & 0xFFFF)\r
\r
// Section\r
-#define TT_DESCRIPTOR_SECTION_STRONGLY_ORDER (TT_DESCRIPTOR_SECTION_TYPE_SECTION | \\r
- TT_DESCRIPTOR_SECTION_NG_GLOBAL | \\r
- TT_DESCRIPTOR_SECTION_S_NOT_SHARED | \\r
- TT_DESCRIPTOR_SECTION_DOMAIN(0) | \\r
- TT_DESCRIPTOR_SECTION_AP_RW_RW | \\r
- TT_DESCRIPTOR_SECTION_CACHE_POLICY_STRONGLY_ORDERED)\r
+#define TT_DESCRIPTOR_SECTION_STRONGLY_ORDER (TT_DESCRIPTOR_SECTION_TYPE_SECTION | \\r
+ TT_DESCRIPTOR_SECTION_NG_GLOBAL | \\r
+ TT_DESCRIPTOR_SECTION_S_NOT_SHARED | \\r
+ TT_DESCRIPTOR_SECTION_DOMAIN(0) | \\r
+ TT_DESCRIPTOR_SECTION_AP_RW_RW | \\r
+ TT_DESCRIPTOR_SECTION_CACHE_POLICY_STRONGLY_ORDERED)\r
\r
// Small Page\r
-#define TT_DESCRIPTOR_PAGE_STRONGLY_ORDER (TT_DESCRIPTOR_PAGE_TYPE_PAGE | \\r
- TT_DESCRIPTOR_PAGE_NG_GLOBAL | \\r
- TT_DESCRIPTOR_PAGE_S_NOT_SHARED | \\r
- TT_DESCRIPTOR_PAGE_AP_RW_RW | \\r
- TT_DESCRIPTOR_PAGE_CACHE_POLICY_STRONGLY_ORDERED)\r
+#define TT_DESCRIPTOR_PAGE_STRONGLY_ORDER (TT_DESCRIPTOR_PAGE_TYPE_PAGE | \\r
+ TT_DESCRIPTOR_PAGE_NG_GLOBAL | \\r
+ TT_DESCRIPTOR_PAGE_S_NOT_SHARED | \\r
+ TT_DESCRIPTOR_PAGE_AP_RW_RW | \\r
+ TT_DESCRIPTOR_PAGE_CACHE_POLICY_STRONGLY_ORDERED)\r
\r
// Large Page\r
-#define TT_DESCRIPTOR_LARGEPAGE_WRITE_BACK (TT_DESCRIPTOR_PAGE_TYPE_LARGEPAGE | \\r
- TT_DESCRIPTOR_PAGE_NG_GLOBAL | \\r
- TT_DESCRIPTOR_PAGE_S_NOT_SHARED | \\r
- TT_DESCRIPTOR_PAGE_AP_RW_RW | \\r
- TT_DESCRIPTOR_SECTION_CACHE_POLICY_WRITE_BACK_ALLOC)\r
-#define TT_DESCRIPTOR_LARGEPAGE_WRITE_THROUGH (TT_DESCRIPTOR_PAGE_TYPE_LARGEPAGE | \\r
- TT_DESCRIPTOR_PAGE_NG_GLOBAL | \\r
- TT_DESCRIPTOR_PAGE_S_NOT_SHARED | \\r
- TT_DESCRIPTOR_PAGE_AP_RW_RW | \\r
- TT_DESCRIPTOR_SECTION_CACHE_POLICY_WRITE_THROUGH_NO_ALLOC)\r
-#define TT_DESCRIPTOR_LARGEPAGE_DEVICE (TT_DESCRIPTOR_PAGE_TYPE_LARGEPAGE | \\r
- TT_DESCRIPTOR_PAGE_NG_GLOBAL | \\r
- TT_DESCRIPTOR_PAGE_S_NOT_SHARED | \\r
- TT_DESCRIPTOR_PAGE_AP_RW_RW | \\r
- TT_DESCRIPTOR_SECTION_CACHE_POLICY_SHAREABLE_DEVICE)\r
-#define TT_DESCRIPTOR_LARGEPAGE_UNCACHED (TT_DESCRIPTOR_PAGE_TYPE_LARGEPAGE | \\r
- TT_DESCRIPTOR_PAGE_NG_GLOBAL | \\r
- TT_DESCRIPTOR_PAGE_S_NOT_SHARED | \\r
- TT_DESCRIPTOR_PAGE_AP_RW_RW | \\r
- TT_DESCRIPTOR_SECTION_CACHE_POLICY_NON_CACHEABLE)\r
+#define TT_DESCRIPTOR_LARGEPAGE_WRITE_BACK (TT_DESCRIPTOR_PAGE_TYPE_LARGEPAGE | \\r
+ TT_DESCRIPTOR_PAGE_NG_GLOBAL | \\r
+ TT_DESCRIPTOR_PAGE_S_NOT_SHARED | \\r
+ TT_DESCRIPTOR_PAGE_AP_RW_RW | \\r
+ TT_DESCRIPTOR_SECTION_CACHE_POLICY_WRITE_BACK_ALLOC)\r
+#define TT_DESCRIPTOR_LARGEPAGE_WRITE_THROUGH (TT_DESCRIPTOR_PAGE_TYPE_LARGEPAGE | \\r
+ TT_DESCRIPTOR_PAGE_NG_GLOBAL | \\r
+ TT_DESCRIPTOR_PAGE_S_NOT_SHARED | \\r
+ TT_DESCRIPTOR_PAGE_AP_RW_RW | \\r
+ TT_DESCRIPTOR_SECTION_CACHE_POLICY_WRITE_THROUGH_NO_ALLOC)\r
+#define TT_DESCRIPTOR_LARGEPAGE_DEVICE (TT_DESCRIPTOR_PAGE_TYPE_LARGEPAGE | \\r
+ TT_DESCRIPTOR_PAGE_NG_GLOBAL | \\r
+ TT_DESCRIPTOR_PAGE_S_NOT_SHARED | \\r
+ TT_DESCRIPTOR_PAGE_AP_RW_RW | \\r
+ TT_DESCRIPTOR_SECTION_CACHE_POLICY_SHAREABLE_DEVICE)\r
+#define TT_DESCRIPTOR_LARGEPAGE_UNCACHED (TT_DESCRIPTOR_PAGE_TYPE_LARGEPAGE | \\r
+ TT_DESCRIPTOR_PAGE_NG_GLOBAL | \\r
+ TT_DESCRIPTOR_PAGE_S_NOT_SHARED | \\r
+ TT_DESCRIPTOR_PAGE_AP_RW_RW | \\r
+ TT_DESCRIPTOR_SECTION_CACHE_POLICY_NON_CACHEABLE)\r
\r
\r
typedef enum { Level0, Level1,Level2 } MMU_LEVEL;\r
UINT32 Index = 0, Count;\r
MMU_ENTRY LastEntry, Entry;\r
\r
- ASSERT((Level == Level1) || (Level == Level2));\r
+ ASSERT((Level == Level1) || (Level == Level2));\r
\r
if (Level == Level1) Count = 4096;\r
else Count = 256;\r
mov r5, r0\r
\r
// Is it the Primary Core ?\r
- bl ArmPlatformIsPrimaryCore\r
+ bl ArmPlatformIsPrimaryCore\r
\r
// Get the top of the primary stacks (and the base of the secondary stacks)\r
LoadConstantToReg (FixedPcdGet32(PcdCPUCoresStackBase), r1)\r
//\r
\r
// Calculate how much space there is between the top of the Firmware and the Top of the System Memory\r
- subs r0, r1, r3 // r0 = SystemMemoryTop - FdTop\r
- bmi _SetupStack // Jump if negative (FdTop > SystemMemoryTop). Case when the PrePi is in XIP memory outside of the DRAM\r
- cmp r0, r4\r
- bge _SetupStack\r
+ subs r0, r1, r3 // r0 = SystemMemoryTop - FdTop\r
+ bmi _SetupStack // Jump if negative (FdTop > SystemMemoryTop). Case when the PrePi is in XIP memory outside of the DRAM\r
+ cmp r0, r4\r
+ bge _SetupStack\r
\r
// Case the top of stacks is the FdBaseAddress\r
- mov r1, r2\r
+ mov r1, r2\r
\r
_SetupStack:\r
// r1 contains the top of the stack (and the UEFI Memory)\r
\r
// Stack for the secondary core = Number of Cores - 1\r
LoadConstantToReg (FixedPcdGet32(PcdCoreCount), r0)\r
- sub r0, r0, #1\r
+ sub r0, r0, #1\r
LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r1)\r
mul r1, r1, r0\r
sub r10, r10, r1\r
\r
// r10 = The base of the MpCore Stacks (primary stack & secondary stacks)\r
- mov r0, r10\r
- mov r1, r8\r
+ mov r0, r10\r
+ mov r1, r8\r
//ArmPlatformStackSet(StackBase, MpId, PrimaryStackSize, SecondaryStackSize)\r
LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)\r
LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r3)\r
- bl ASM_PFX(ArmPlatformStackSet)\r
+ bl ASM_PFX(ArmPlatformStackSet)\r
\r
// Is it the Primary Core ?\r
mov r0, r8\r
//\r
\r
// Calculate how much space there is between the top of the Firmware and the Top of the System Memory\r
- subs r0, r1, r3 // r0 = SystemMemoryTop - FdTop\r
- bmi _SetupStack // Jump if negative (FdTop > SystemMemoryTop). Case when the PrePi is in XIP memory outside of the DRAM\r
- cmp r0, r4\r
- bge _SetupStack\r
+ subs r0, r1, r3 // r0 = SystemMemoryTop - FdTop\r
+ bmi _SetupStack // Jump if negative (FdTop > SystemMemoryTop). Case when the PrePi is in XIP memory outside of the DRAM\r
+ cmp r0, r4\r
+ bge _SetupStack\r
\r
// Case the top of stacks is the FdBaseAddress\r
- mov r1, r2\r
+ mov r1, r2\r
\r
_SetupStack\r
// r1 contains the top of the stack (and the UEFI Memory)\r
\r
// Stack for the secondary core = Number of Cores - 1\r
LoadConstantToReg (FixedPcdGet32(PcdCoreCount), r0)\r
- sub r0, r0, #1\r
+ sub r0, r0, #1\r
LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r1)\r
mul r1, r1, r0\r
sub r10, r10, r1\r
\r
// r10 = The base of the MpCore Stacks (primary stack & secondary stacks)\r
- mov r0, r10\r
- mov r1, r8\r
+ mov r0, r10\r
+ mov r1, r8\r
//ArmPlatformStackSet(StackBase, MpId, PrimaryStackSize, SecondaryStackSize)\r
LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)\r
LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r3)\r
- bl ArmPlatformStackSet\r
+ bl ArmPlatformStackSet\r
\r
// Is it the Primary Core ?\r
mov r0, r8\r
# Set the Non Secure Mode\r
ASM_PFX(set_non_secure_mode):\r
push { r1 }\r
- and r0, r0, #0x1f @ Keep only the mode bits\r
+ and r0, r0, #0x1f @ Keep only the mode bits\r
mrs r1, spsr @ Read the spsr\r
bic r1, r1, #0x1f @ Clear all mode bits\r
- orr r1, r1, r0\r
+ orr r1, r1, r0\r
msr spsr_cxsf, r1 @ write back spsr (may have caused a mode switch)\r
isb\r
pop { r1 }\r
and r0, r0, #0x1f // Keep only the mode bits\r
mrs r1, spsr // Read the spsr\r
bic r1, r1, #0x1f // Clear all mode bits\r
- orr r1, r1, r0\r
+ orr r1, r1, r0\r
msr spsr_cxsf, r1 // write back spsr (may have caused a mode switch)\r
isb\r
pop { r1 }\r
mov r9, r0\r
\r
// Is it the Primary Core ?\r
- bl ASM_PFX(ArmPlatformIsPrimaryCore)\r
+ bl ASM_PFX(ArmPlatformIsPrimaryCore)\r
cmp r0, #1\r
// Only the primary core initialize the memory (SMC)\r
beq _InitMem\r
mov r9, r0\r
\r
// Is it the Primary Core ?\r
- bl ArmPlatformIsPrimaryCore\r
+ bl ArmPlatformIsPrimaryCore\r
cmp r0, #1\r
// Only the primary core initialize the memory (SMC)\r
beq _InitMem\r
#define SP810_CTRL_BASE (ARM_EB_BOARD_PERIPH_BASE + 0x01000)\r
\r
// SYSTRCL Register\r
-#define ARM_EB_SYSCTRL 0x10001000\r
+#define ARM_EB_SYSCTRL 0x10001000\r
\r
// Uart0\r
#define PL011_CONSOLE_UART_BASE (ARM_EB_BOARD_PERIPH_BASE + 0x09000)\r
// );\r
ASM_PFX(ArmPlatformIsPrimaryCore):\r
// BeagleBoard has a single core. We must always return 1.\r
- mov r0, #1\r
- bx lr\r
+ mov r0, #1\r
+ bx lr\r
\r
ASM_PFX(ArmPlatformPeiBootAction):\r
bx lr\r
ASM_PFX(ArmPlatformGetPrimaryCoreMpId):\r
// The BeagleBoard is a uniprocessor platform. The MPIDR of primary core is\r
// always the MPIDR of the calling CPU.\r
- b ASM_PFX(ArmReadMpidr)\r
+ b ASM_PFX(ArmReadMpidr)\r
\r
ASM_FUNCTION_REMOVE_IF_UNREFERENCED\r
EXPORT ArmPlatformIsPrimaryCore\r
EXPORT ArmPlatformGetPrimaryCoreMpId\r
\r
- IMPORT ArmReadMpidr\r
+ IMPORT ArmReadMpidr\r
\r
AREA BeagleBoardHelper, CODE, READONLY\r
\r
// );\r
ArmPlatformIsPrimaryCore FUNCTION\r
// BeagleBoard has a single core. We must always return 1.\r
- mov r0, #1\r
- bx lr\r
+ mov r0, #1\r
+ bx lr\r
ENDFUNC\r
\r
ArmPlatformPeiBootAction FUNCTION\r
ArmPlatformGetPrimaryCoreMpId FUNCTION\r
// The BeagleBoard is a uniprocessor platform. The MPIDR of primary core is\r
// always the MPIDR of the calling CPU.\r
- b ArmReadMpidr\r
+ b ArmReadMpidr\r
ENDFUNC\r
\r
END\r
*\r
* Parameters:\r
*\r
- * @param pobj: A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.\r
+ * @param pobj: A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.\r
*\r
* Description:\r
*\r
- * This function starts a network interface. If the network interface successfully starts, then\r
- * EFI_SUCCESS will be returned.\r
+ * This function starts a network interface. If the network interface successfully starts, then\r
+ * EFI_SUCCESS will be returned.\r
*/\r
EFI_STATUS\r
EFIAPI\r
TextLine[Line++] = ConvertToTextLine(*Address++);\r
break;\r
\r
- default:\r
- AsciiPrint ("Width must be 1, 2, or 4!\n");\r
- return EFI_INVALID_PARAMETER;\r
+ default:\r
+ AsciiPrint ("Width must be 1, 2, or 4!\n");\r
+ return EFI_INVALID_PARAMETER;\r
}\r
}\r
\r
goto Exit;\r
}\r
\r
- AsciiPrint("IP Address: %d.%d.%d.%d\n", Ip.v4.Addr[0], Ip.v4.Addr[1],Ip.v4.Addr[2], Ip.v4.Addr[3]);\r
+ AsciiPrint("IP Address: %d.%d.%d.%d\n", Ip.v4.Addr[0], Ip.v4.Addr[1],Ip.v4.Addr[2], Ip.v4.Addr[3]);\r
\r
} else if ((Argv[1][0] == 'r') && (Argc == 2)) {\r
// Get new address via dhcp\r
/**\r
Insert Single Step in the SystemContext\r
\r
- @param SystemContext Register content at time of the exception\r
+ @param SystemContext Register content at time of the exception\r
**/\r
VOID\r
AddSingleStep (\r
/**\r
Remove Single Step in the SystemContext\r
\r
- @param SystemContext Register content at time of the exception\r
+ @param SystemContext Register content at time of the exception\r
**/\r
VOID\r
RemoveSingleStep (\r
VOID\r
GdbSendTSignal (\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
- IN UINT8 GdbExceptionType\r
+ IN UINT8 GdbExceptionType\r
);\r
\r
\r
\r
// check if this is a valid Register Number\r
if ((RegNumber < 0) || (RegNumber >= MaxRegisterCount())) {\r
- SendError (GDB_EINVALIDREGNUM);\r
+ SendError (GDB_EINVALIDREGNUM);\r
return;\r
}\r
InBufPtr++; // skips the '=' character\r
// check to see if the buffer is the right size which is\r
// 1 (for 'G') + 16 (for 16 registers) * 8 ( for 8 hex chars each) = 129\r
if (AsciiStrLen(InBuffer) != 129) { // 16 regs, 8 hex chars each, and the end '\0' (escape seq)\r
- //Bad message. Message is not the right length\r
+ //Bad message. Message is not the right length\r
SendError (GDB_EBADBUFSIZE);\r
return;\r
}\r
\r
// check if this is a valid Register Number\r
if ((RegNumber < 0) || (RegNumber >= MaxRegisterCount())) {\r
- SendError (GDB_EINVALIDREGNUM);\r
+ SendError (GDB_EINVALIDREGNUM);\r
return;\r
}\r
InBufPtr++; // skips the '=' character\r
/**\r
Get Fv image from the FV type file, then add FV & FV2 Hob.\r
\r
- @param FileHandle File handle of a Fv type file.\r
+ @param FileHandle File handle of a Fv type file.\r
\r
-\r
- @retval EFI_NOT_FOUND FV image can't be found.\r
- @retval EFI_SUCCESS Successfully to process it.\r
+ @retval EFI_NOT_FOUND FV image can't be found.\r
+ @retval EFI_SUCCESS Successfully to process it.\r
\r
**/\r
EFI_STATUS\r
/**\r
Search through every FV until you find a file of type FileType\r
\r
- @param FileType File handle of a Fv type file.\r
- @param Volumehandle On succes Volume Handle of the match\r
- @param FileHandle On success File Handle of the match\r
+ @param FileType File handle of a Fv type file.\r
+ @param Volumehandle On succes Volume Handle of the match\r
+ @param FileHandle On success File Handle of the match\r
\r
- @retval EFI_NOT_FOUND FV image can't be found.\r
- @retval EFI_SUCCESS Successfully found FileType\r
+ @retval EFI_NOT_FOUND FV image can't be found.\r
+ @retval EFI_SUCCESS Successfully found FileType\r
\r
**/\r
EFI_STATUS\r
/**\r
Get Fv image from the FV type file, then add FV & FV2 Hob.\r
\r
- @param FileHandle File handle of a Fv type file.\r
+ @param FileHandle File handle of a Fv type file.\r
\r
\r
- @retval EFI_NOT_FOUND FV image can't be found.\r
- @retval EFI_SUCCESS Successfully to process it.\r
+ @retval EFI_NOT_FOUND FV image can't be found.\r
+ @retval EFI_SUCCESS Successfully to process it.\r
\r
**/\r
EFI_STATUS\r
\r
extern EFI_GUID gEmbeddedExternalDeviceProtocolGuid;\r
\r
-#endif // __EMBEDDED_EXTERNAL_DEVICE_H__\r
+#endif // __EMBEDDED_EXTERNAL_DEVICE_H__\r
VOID\r
GdbSendTSignal (\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
- IN UINT8 GdbExceptionType\r
+ IN UINT8 GdbExceptionType\r
);\r
\r
\r
\r
// check if this is a valid Register Number\r
if ((RegNumber < 0) || (RegNumber >= sizeof (gRegisterOffsets)/sizeof (UINTN))) {\r
- SendError (GDB_EINVALIDREGNUM);\r
+ SendError (GDB_EINVALIDREGNUM);\r
return;\r
}\r
InBufPtr++; // skips the '=' character\r
// check to see if the buffer is the right size which is\r
// 1 (for 'G') + 16 (for 16 registers) * 8 ( for 8 hex chars each) = 129\r
if (AsciiStrLen(InBuffer) != 129) { // 16 regs, 8 hex chars each, and the end '\0' (escape seq)\r
- //Bad message. Message is not the right length\r
+ //Bad message. Message is not the right length\r
SendError (GDB_EBADBUFSIZE);\r
return;\r
}\r
\r
// check if this is a valid Register Number\r
if ((RegNumber < 0) || (RegNumber >= MaxRegisterCount())) {\r
- SendError (GDB_EINVALIDREGNUM);\r
+ SendError (GDB_EINVALIDREGNUM);\r
return;\r
}\r
InBufPtr++; // skips the '=' character\r
/**\r
Search through every FV until you find a file of type FileType\r
\r
- @param FileType File handle of a Fv type file.\r
- @param Volumehandle On succes Volume Handle of the match\r
- @param FileHandle On success File Handle of the match\r
+ @param FileType File handle of a Fv type file.\r
+ @param Volumehandle On succes Volume Handle of the match\r
+ @param FileHandle On success File Handle of the match\r
\r
- @retval EFI_NOT_FOUND FV image can't be found.\r
- @retval EFI_SUCCESS Successfully found FileType\r
+ @retval EFI_NOT_FOUND FV image can't be found.\r
+ @retval EFI_SUCCESS Successfully found FileType\r
\r
**/\r
EFI_STATUS\r
/**\r
Get Fv image from the FV type file, then add FV & FV2 Hob.\r
\r
- @param FileHandle File handle of a Fv type file.\r
+ @param FileHandle File handle of a Fv type file.\r
\r
\r
- @retval EFI_NOT_FOUND FV image can't be found.\r
- @retval EFI_SUCCESS Successfully to process it.\r
+ @retval EFI_NOT_FOUND FV image can't be found.\r
+ @retval EFI_SUCCESS Successfully to process it.\r
\r
**/\r
EFI_STATUS\r
EFIAPI\r
LcdGraphicsBlt (\r
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
- IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL\r
- IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,\r
- IN UINTN SourceX,\r
- IN UINTN SourceY,\r
- IN UINTN DestinationX,\r
- IN UINTN DestinationY,\r
- IN UINTN Width,\r
- IN UINTN Height,\r
- IN UINTN Delta OPTIONAL // Number of BYTES in a row of the BltBuffer\r
+ IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL\r
+ IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,\r
+ IN UINTN SourceX,\r
+ IN UINTN SourceY,\r
+ IN UINTN DestinationX,\r
+ IN UINTN DestinationY,\r
+ IN UINTN Width,\r
+ IN UINTN Height,\r
+ IN UINTN Delta OPTIONAL // Number of BYTES in a row of the BltBuffer\r
)\r
{\r
EFI_STATUS Status;\r
- LCD_INSTANCE *Instance;\r
+ LCD_INSTANCE *Instance;\r
\r
- Instance = LCD_INSTANCE_FROM_GOP_THIS(This);\r
+ Instance = LCD_INSTANCE_FROM_GOP_THIS(This);\r
\r
if (!mDisplayInitialized) {\r
InitializeDisplay (Instance);\r
}\r
\r
switch (BltOperation) {\r
- case EfiBltVideoFill:\r
- Status = BltVideoFill (This, BltBuffer, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);\r
- break;\r
-\r
- case EfiBltVideoToBltBuffer:\r
- Status = BltVideoToBltBuffer (This, BltBuffer, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);\r
- break;\r
-\r
- case EfiBltBufferToVideo:\r
- Status = BltBufferToVideo (This, BltBuffer, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);\r
- break;\r
-\r
- case EfiBltVideoToVideo:\r
- Status = BltVideoToVideo (This, BltBuffer, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);\r
- break;\r
-\r
- case EfiGraphicsOutputBltOperationMax:\r
- default:\r
- DEBUG((DEBUG_ERROR, "LcdGraphicsBlt: Invalid Operation\n"));\r
- Status = EFI_INVALID_PARAMETER;\r
- break;\r
- }\r
+ case EfiBltVideoFill:\r
+ Status = BltVideoFill (This, BltBuffer, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);\r
+ break;\r
+\r
+ case EfiBltVideoToBltBuffer:\r
+ Status = BltVideoToBltBuffer (This, BltBuffer, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);\r
+ break;\r
+\r
+ case EfiBltBufferToVideo:\r
+ Status = BltBufferToVideo (This, BltBuffer, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);\r
+ break;\r
+\r
+ case EfiBltVideoToVideo:\r
+ Status = BltVideoToVideo (This, BltBuffer, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);\r
+ break;\r
+\r
+ case EfiGraphicsOutputBltOperationMax:\r
+ default:\r
+ DEBUG((DEBUG_ERROR, "LcdGraphicsBlt: Invalid Operation\n"));\r
+ Status = EFI_INVALID_PARAMETER;\r
+ break;\r
+}\r
\r
return Status;\r
}\r
EFIAPI\r
LcdGraphicsQueryMode (\r
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
- IN UINT32 ModeNumber,\r
- OUT UINTN *SizeOfInfo,\r
- OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info\r
- )\r
+ IN UINT32 ModeNumber,\r
+ OUT UINTN *SizeOfInfo,\r
+ OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info\r
+ )\r
{\r
- LCD_INSTANCE *Instance;\r
+ LCD_INSTANCE *Instance;\r
\r
- Instance = LCD_INSTANCE_FROM_GOP_THIS(This);\r
+ Instance = LCD_INSTANCE_FROM_GOP_THIS(This);\r
\r
if (!mDisplayInitialized) {\r
InitializeDisplay (Instance);\r
}\r
\r
// Error checking\r
- if ( (This == NULL) || (Info == NULL) || (SizeOfInfo == NULL) || (ModeNumber >= This->Mode->MaxMode) ) {\r
- DEBUG((DEBUG_ERROR, "LcdGraphicsQueryMode: ERROR - For mode number %d : Invalid Parameter.\n", ModeNumber ));\r
- return EFI_INVALID_PARAMETER;\r
- }\r
+ if ( (This == NULL) || (Info == NULL) || (SizeOfInfo == NULL) || (ModeNumber >= This->Mode->MaxMode) ) {\r
+ DEBUG((DEBUG_ERROR, "LcdGraphicsQueryMode: ERROR - For mode number %d : Invalid Parameter.\n", ModeNumber ));\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
\r
*Info = AllocateCopyPool(sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION), &Instance->ModeInfo);\r
if (*Info == NULL) {\r
EFIAPI\r
LcdGraphicsSetMode (\r
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
- IN UINT32 ModeNumber\r
- )\r
+ IN UINT32 ModeNumber\r
+ )\r
{\r
- LCD_INSTANCE *Instance;\r
+ LCD_INSTANCE *Instance;\r
\r
- Instance = LCD_INSTANCE_FROM_GOP_THIS(This);\r
+ Instance = LCD_INSTANCE_FROM_GOP_THIS(This);\r
\r
if (ModeNumber >= Instance->Mode.MaxMode) {\r
return EFI_UNSUPPORTED;\r
goto EXIT;\r
}\r
\r
- // Install the Graphics Output Protocol and the Device Path\r
- Status = gBS->InstallMultipleProtocolInterfaces(\r
- &Instance->Handle,\r
- &gEfiGraphicsOutputProtocolGuid, &Instance->Gop,\r
- &gEfiDevicePathProtocolGuid, &Instance->DevicePath,\r
- NULL\r
- );\r
+ // Install the Graphics Output Protocol and the Device Path\r
+ Status = gBS->InstallMultipleProtocolInterfaces(\r
+ &Instance->Handle,\r
+ &gEfiGraphicsOutputProtocolGuid, &Instance->Gop,\r
+ &gEfiDevicePathProtocolGuid, &Instance->DevicePath,\r
+ NULL\r
+ );\r
\r
- if (EFI_ERROR(Status)) {\r
- DEBUG((DEBUG_ERROR, "GraphicsOutputDxeInitialize: Can not install the protocol. Exit Status=%r\n", Status));\r
- goto EXIT;\r
- }\r
+ if (EFI_ERROR(Status)) {\r
+ DEBUG((DEBUG_ERROR, "GraphicsOutputDxeInitialize: Can not install the protocol. Exit Status=%r\n", Status));\r
+ goto EXIT;\r
+ }\r
\r
// Register for an ExitBootServicesEvent\r
- // When ExitBootServices starts, this function here will make sure that the graphics driver will shut down properly,\r
- // i.e. it will free up all allocated memory and perform any necessary hardware re-configuration.\r
- /*Status = gBS->CreateEvent (\r
- EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
- TPL_NOTIFY,\r
- LcdGraphicsExitBootServicesEvent, NULL,\r
- &Instance->ExitBootServicesEvent\r
- );\r
-\r
- if (EFI_ERROR(Status)) {\r
- DEBUG((DEBUG_ERROR, "GraphicsOutputDxeInitialize: Can not install the ExitBootServicesEvent handler. Exit Status=%r\n", Status));\r
- goto EXIT_ERROR_UNINSTALL_PROTOCOL;\r
- }*/\r
-\r
- // To get here, everything must be fine, so just exit\r
- goto EXIT;\r
+ // When ExitBootServices starts, this function here will make sure that the graphics driver will shut down properly,\r
+ // i.e. it will free up all allocated memory and perform any necessary hardware re-configuration.\r
+ /*Status = gBS->CreateEvent (\r
+ EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
+ TPL_NOTIFY,\r
+ LcdGraphicsExitBootServicesEvent, NULL,\r
+ &Instance->ExitBootServicesEvent\r
+ );\r
+\r
+ if (EFI_ERROR(Status)) {\r
+ DEBUG((DEBUG_ERROR, "GraphicsOutputDxeInitialize: Can not install the ExitBootServicesEvent handler. Exit Status=%r\n", Status));\r
+ goto EXIT_ERROR_UNINSTALL_PROTOCOL;\r
+ }*/\r
+\r
+ // To get here, everything must be fine, so just exit\r
+ goto EXIT;\r
\r
//EXIT_ERROR_UNINSTALL_PROTOCOL:\r
- /* The following function could return an error message,\r
- * however, to get here something must have gone wrong already,\r
- * so preserve the original error, i.e. don't change\r
- * the Status variable, even it fails to uninstall the protocol.\r
- */\r
-/* gBS->UninstallMultipleProtocolInterfaces (\r
- Instance->Handle,\r
- &gEfiGraphicsOutputProtocolGuid, &Instance->Gop, // Uninstall Graphics Output protocol\r
- &gEfiDevicePathProtocolGuid, &Instance->DevicePath, // Uninstall device path\r
- NULL\r
- );*/\r
+ /* The following function could return an error message,\r
+ * however, to get here something must have gone wrong already,\r
+ * so preserve the original error, i.e. don't change\r
+ * the Status variable, even it fails to uninstall the protocol.\r
+ */\r
+ /* gBS->UninstallMultipleProtocolInterfaces (\r
+ Instance->Handle,\r
+ &gEfiGraphicsOutputProtocolGuid, &Instance->Gop, // Uninstall Graphics Output protocol\r
+ &gEfiDevicePathProtocolGuid, &Instance->DevicePath, // Uninstall device path\r
+ NULL\r
+ );*/\r
\r
EXIT:\r
- return Status;\r
+ return Status;\r
\r
}\r
EFIAPI\r
LcdGraphicsBlt (\r
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
- IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL\r
- IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,\r
- IN UINTN SourceX,\r
- IN UINTN SourceY,\r
- IN UINTN DestinationX,\r
- IN UINTN DestinationY,\r
- IN UINTN Width,\r
- IN UINTN Height,\r
- IN UINTN Delta OPTIONAL // Number of BYTES in a row of the BltBuffer\r
+ IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL\r
+ IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,\r
+ IN UINTN SourceX,\r
+ IN UINTN SourceY,\r
+ IN UINTN DestinationX,\r
+ IN UINTN DestinationY,\r
+ IN UINTN Width,\r
+ IN UINTN Height,\r
+ IN UINTN Delta OPTIONAL // Number of BYTES in a row of the BltBuffer\r
);\r
\r
// HW registers\r