mirror of
https://github.com/edk2-porting/edk2-msm
synced 2025-05-13 12:42:54 +00:00
51 lines
1.4 KiB
C
Executable File
51 lines
1.4 KiB
C
Executable File
#include <Library/PcdLib.h>
|
|
#include <Library/ArmLib.h>
|
|
#include <Library/BaseMemoryLib.h>
|
|
#include <Library/DebugLib.h>
|
|
#include <Library/IoLib.h>
|
|
#include <Library/MemoryAllocationLib.h>
|
|
#include <Library/HobLib.h>
|
|
#include <Library/SerialPortLib.h>
|
|
#include <Library/PrintLib.h>
|
|
#include <Library/BaseLib.h>
|
|
#include <Library/MemoryMapHelperLib.h>
|
|
#include <Library/PlatformPrePiLib.h>
|
|
|
|
#include "PlatformUtils.h"
|
|
|
|
|
|
VOID InitializeSharedUartBuffers(VOID)
|
|
{
|
|
INTN* pFbConPosition = (INTN*)(FixedPcdGet32(PcdMipiFrameBufferAddress) + (FixedPcdGet32(PcdMipiFrameBufferWidth) *
|
|
FixedPcdGet32(PcdMipiFrameBufferHeight) *
|
|
FixedPcdGet32(PcdMipiFrameBufferPixelBpp) / 8));
|
|
|
|
*(pFbConPosition + 0) = 0;
|
|
*(pFbConPosition + 1) = 0;
|
|
}
|
|
|
|
VOID UartInit(VOID)
|
|
{
|
|
SerialPortInitialize();
|
|
|
|
InitializeSharedUartBuffers();
|
|
|
|
DEBUG((EFI_D_INFO, "\nRenegade Project edk2-msm (AArch64)\n"));
|
|
DEBUG(
|
|
(EFI_D_INFO, "Firmware version %s built %a %a\n\n",
|
|
(CHAR16 *)PcdGetPtr(PcdFirmwareVersionString), __TIME__, __DATE__));
|
|
}
|
|
|
|
VOID SetWatchdogState(BOOLEAN Enable)
|
|
{
|
|
MmioWrite32(APSS_WDT_BASE + APSS_WDT_ENABLE_OFFSET, Enable);
|
|
}
|
|
|
|
VOID PlatformInitialize()
|
|
{
|
|
UartInit();
|
|
|
|
// Disable WatchDog Timer
|
|
SetWatchdogState(FALSE);
|
|
}
|