Skip to content

Commit

Permalink
fix dxecore and boot
Browse files Browse the repository at this point in the history
  • Loading branch information
vicenteicc2008 committed Aug 14, 2024
1 parent 6c45777 commit 181df97
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions MSM8909Pkg/CommonDsc.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf

ResetSystemLib|ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf

# ARM PL011 UART Driver
PL011UartClockLib|ArmPlatformPkg/Library/PL011UartClockLib/PL011UartClockLib.inf
Expand Down
2 changes: 1 addition & 1 deletion MSM8909Pkg/Devices/goyavewifi.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
gEmbeddedTokenSpaceGuid.PcdPrePiStackBase|0x80C00000
gEmbeddedTokenSpaceGuid.PcdPrePiStackSize|0x00040000 # 256K stack
gMSM8909PkgTokenSpaceGuid.PcdUefiMemPoolBase|0x80D00000 # DXE Heap base address
gMSM8909PkgTokenSpaceGuid.PcdUefiMemPoolSize|0x03300000 # UefiMemorySize, DXE heap size
gMSM8909PkgTokenSpaceGuid.PcdUefiMemPoolSize|0x0F3B0000 # UefiMemorySize, DXE heap size
gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80C40000

# Framebuffer (1024x600)
Expand Down
2 changes: 1 addition & 1 deletion MSM8909Pkg/Drivers/SimpleFbDxe/SimpleFbDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ SimpleFbDxeInitialize
EFI_PHYSICAL_ADDRESS FrameBufferAddress = MipiFrameBufferAddr;

mDisplay.Mode->Info->PixelsPerScanLine = MipiFrameBufferWidth;
mDisplay.Mode->Info->PixelFormat = PixelBlueGreenRedReserved8BitPerColor;
mDisplay.Mode->Info->PixelFormat = PixelRedGreenBlueReserved8BitPerColor;
mDisplay.Mode->SizeOfInfo = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
mDisplay.Mode->FrameBufferBase = FrameBufferAddress;
mDisplay.Mode->FrameBufferSize = FrameBufferSize;
Expand Down
9 changes: 5 additions & 4 deletions MSM8909Pkg/Include/Configuration/DeviceMemoryMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,16 @@ typedef struct {
static ARM_MEMORY_REGION_DESCRIPTOR_EX gDeviceMemoryDescriptorEx[] = {
// EFI_RESOURCE_ EFI_RESOURCE_ATTRIBUTE_ ARM_REGION_ATTRIBUTE_
//MemBase, MemSize, MemLabel(32 Char.), BuildHob, ResourceType, ResourceAttribute, MemoryType, CacheAttributes

//------------- Register Regions ----------
{0x00000000, 0x20000000, "Peripherals", AddMem, MEM_RES, UNCACHEABLE, RtCode, DEVICE},
//------------- DDR ------},
{0x80000000, 0x00010000, "HLOS 0", AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN},
{0x80000000, 0x00010000, "HLOS 0", AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK},
{0x80C00000, 0x00040000, "UEFI Stack", AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK},
{0x80C40000, 0x00010000, "CPU Vectors", AddMem, SYS_MEM, SYS_MEM_CAP, BsCode, WRITE_BACK},
{0x80024000, 0x001DC000, "HLOS 1", AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK},
{0x80200000, 0x00200000, "UEFI FD", AddMem, SYS_MEM, SYS_MEM_CAP, BsCode, WRITE_BACK},
{0x80D00000, 0x03300000, "HLOS 2", AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK},
{0x9eef4000, 0x00708000, "Display Reserved", AddMem, MEM_RES, WRITE_THROUGH, MaxMem, WRITE_THROUGH_XN},
{0x9eef4000, 0x00708000, "Display Reserved", AddMem, MEM_RES, WRITE_THROUGH, MaxMem, WRITE_THROUGH},
{0x80D00000, 0x0F3B0000, "HLOS 2", AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK},
// {0x87800000, 0x00240000, "SMEM", AddMem, MEM_RES, UNCACHEABLE, Reserv, UNCACHED_UNBUFFERED},

//------------- Terminator for MMU ----------
Expand Down
1 change: 1 addition & 0 deletions MSM8909Pkg/MSM8909Pkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf
MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf

Expand Down
1 change: 1 addition & 0 deletions MSM8909Pkg/MSM8909Pkg.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ READ_LOCK_STATUS = TRUE
INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
INF EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf
INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf

Expand Down
8 changes: 8 additions & 0 deletions MSM8909Pkg/PrePi/ModuleEntryPoint.S
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ _ModuleEntryPoint:
/* Invalidate TLB */
bl ASM_PFX(ArmInvalidateTlb)

//Disable Strict alignment checking & Enable Instruction cache
mrc p15, 0, r0, c1, c0, 0
bic r0, r0, #0x00002300 /* clear bits 13, 9:8 (--V- --RS) */
bic r0, r0, #0x00000005 /* clear bits 0, 2 (---- -C-M) */
bic r0, r0, #0x00000002 /* Clear bit 1 (Alignment faults) */
orr r0, r0, #0x00001000 /* set bit 12 (I) enable I-Cache */
mcr p15, 0, r0, c1, c0, 0

_SetupExceptionVector:
LoadConstantToReg (FixedPcdGet32(PcdCpuVectorBaseAddress), r0)
ldr r1, dead
Expand Down

0 comments on commit 181df97

Please sign in to comment.