Skip to content

Commit

Permalink
fix build on stable202405
Browse files Browse the repository at this point in the history
  • Loading branch information
vicenteicc2008 committed Aug 11, 2024
1 parent f92eab7 commit 6c45777
Show file tree
Hide file tree
Showing 12 changed files with 102 additions and 150 deletions.
4 changes: 3 additions & 1 deletion MSM8909Pkg/CommonDsc.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@

SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf

ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesRecordLib.inf

TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf

Expand Down Expand Up @@ -253,7 +255,7 @@
# IO is mapped to memory space, so we use the same size of
# PcdPrePiCpuMemorySize
#
gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|44
gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|0
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000
gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000
gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|1000000
Expand Down
2 changes: 1 addition & 1 deletion MSM8909Pkg/Devices/goyavewifi.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferHeight|600
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleWidth|1024
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleHeight|600
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferPixelBpp|32
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferPixelBpp|16
4 changes: 2 additions & 2 deletions MSM8909Pkg/Include/Configuration/DeviceMemoryMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ static ARM_MEMORY_REGION_DESCRIPTOR_EX gDeviceMemoryDescriptorEx[] = {
//MemBase, MemSize, MemLabel(32 Char.), BuildHob, ResourceType, ResourceAttribute, MemoryType, CacheAttributes

//------------- DDR ------},
{0x80000000, 0x00010000, "HLOS 0", AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK},
{0x80000000, 0x00010000, "HLOS 0", AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN},
{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},
{0x9eef4000, 0x00708000, "Display Reserved", AddMem, MEM_RES, WRITE_THROUGH, MaxMem, WRITE_THROUGH_XN},
{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},
// {0x87800000, 0x00240000, "SMEM", AddMem, MEM_RES, UNCACHEABLE, Reserv, UNCACHED_UNBUFFERED},

//------------- Terminator for MMU ----------
Expand Down
2 changes: 1 addition & 1 deletion MSM8909Pkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct FRAME_BUFFER_CONFIGURE {
};

CONST EFI_PIXEL_BITMASK mRgbPixelMasks = {
0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000
0xf800, 0x07e0, 0x001f, 0x0000
};

CONST EFI_PIXEL_BITMASK mBgrPixelMasks = {
Expand Down
1 change: 1 addition & 0 deletions MSM8909Pkg/Library/MSM8909PkgLib/MSM8909PkgLib.inf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

[Sources.common]
MSM8909Pkg.c
MSM8909PkgMem.c

[Sources.Arm]
Arm/ArmPlatformHelper.S | GCC
Expand Down
90 changes: 90 additions & 0 deletions MSM8909Pkg/Library/MSM8909PkgLib/MSM8909PkgMem.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/** @file
*
* Copyright (c) 2011, ARM Limited. All rights reserved.
* Copyright (c) 2019, RUIKAI LIU and MR TUNNEL. All rights reserved.
*
* This program and the accompanying materials
* are licensed and made available under the terms and conditions of the BSD License
* which accompanies this distribution. The full text of the license may be found at
* http://opensource.org/licenses/bsd-license.php
*
* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
*
**/

#include <Library/ArmPlatformLib.h>
#include <Library/DebugLib.h>
#include <Library/HobLib.h>
#include <Configuration/DeviceMemoryMap.h>
/**
Return the Virtual Memory Map of your platform
This Virtual Memory Map is used by MemoryInitPei Module to initialize the MMU on your platform.
@param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR describing a Physical-to-
Virtual Memory mapping. This array must be ended by a zero-filled
entry
**/

STATIC
VOID
AddHob
(
PARM_MEMORY_REGION_DESCRIPTOR_EX Desc
)
{
BuildResourceDescriptorHob(
Desc->ResourceType,
Desc->ResourceAttribute,
Desc->Address,
Desc->Length
);

BuildMemoryAllocationHob(
Desc->Address,
Desc->Length,
Desc->MemoryType
);
}

VOID
ArmPlatformGetVirtualMemoryMap (
IN ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap
)
{
//TO-DO:ADD MEMORY MAP HERE
PARM_MEMORY_REGION_DESCRIPTOR_EX MemoryDescriptorEx = gDeviceMemoryDescriptorEx;
ARM_MEMORY_REGION_DESCRIPTOR MemoryDescriptor[MAX_ARM_MEMORY_REGION_DESCRIPTOR_COUNT];
UINTN Index = 0;

// Run through each memory descriptor
while (MemoryDescriptorEx->Address != (EFI_PHYSICAL_ADDRESS)0xFFFFFFFF)
{
switch (MemoryDescriptorEx->HobOption)
{
case AddMem:
case AddDev:
AddHob(MemoryDescriptorEx);
break;
case NoHob:
default:
goto update;
}

update:
ASSERT(Index < MAX_ARM_MEMORY_REGION_DESCRIPTOR_COUNT);

MemoryDescriptor[Index].PhysicalBase = MemoryDescriptorEx->Address;
MemoryDescriptor[Index].VirtualBase = MemoryDescriptorEx->Address;
MemoryDescriptor[Index].Length = MemoryDescriptorEx->Length;
MemoryDescriptor[Index].Attributes = MemoryDescriptorEx->ArmAttributes;

Index++;
MemoryDescriptorEx++;
}

// Last one (terminator)
ASSERT(Index < MAX_ARM_MEMORY_REGION_DESCRIPTOR_COUNT);

*VirtualMemoryMap = MemoryDescriptor;
//ASSERT(0);
}
2 changes: 1 addition & 1 deletion MSM8909Pkg/MSM8909Pkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf

# SimpleFbDxe
FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
FrameBufferBltLib|MSM8909Pkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf

# Platform Drivers
SerialPortLib|MSM8909Pkg/Library/FrameBufferSerialPortLib/FrameBufferSerialPortLib.inf
Expand Down
17 changes: 2 additions & 15 deletions MSM8909Pkg/PrePi/Pi.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ VOID Main (IN UINT64 StartTimeStamp)
MemorySize = FixedPcdGet32(PcdSystemMemorySize);
UefiMemoryBase = FixedPcdGet32(PcdUefiMemPoolBase);
UefiMemorySize = FixedPcdGet32(PcdUefiMemPoolSize);
StacksSize = FixedPcdGet32(PcdPrePiStackSize);
StacksBase = UefiMemoryBase + UefiMemorySize - StacksSize;

DEBUG(
Expand Down Expand Up @@ -120,23 +119,11 @@ VOID Main (IN UINT64 StartTimeStamp)

// Assume the FV that contains the SEC (our code) also contains a compressed FV.
Status = DecompressFirstFv ();
// ASSERT_EFI_ERROR (Status);
if (EFI_ERROR(Status))
{
DEBUG((EFI_D_ERROR, "FV does not contains a compressed FV\n"));
}else{
DEBUG((EFI_D_INFO | EFI_D_LOAD, "FV contains a compressed FV\n"));
}
ASSERT_EFI_ERROR (Status);

// Load the DXE Core and transfer control to it
Status = LoadDxeCoreFromFv (NULL, 0);
//ASSERT_EFI_ERROR (Status);
if (EFI_ERROR(Status))
{
DEBUG((EFI_D_ERROR, "Failed to load DXE Core\n"));
}else{
DEBUG((EFI_D_INFO | EFI_D_LOAD, "Loading DXE Core\n"));
}
ASSERT_EFI_ERROR (Status);

}

Expand Down
1 change: 0 additions & 1 deletion MSM8909Pkg/PrePi/PrePi.inf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

[Sources.ARM]
ReleaseInfo.S | GCC
ProcessorSupport.S | GCC
ModuleEntryPoint.S | GCC

[Packages]
Expand Down
117 changes: 0 additions & 117 deletions MSM8909Pkg/PrePi/ProcessorSupport.S

This file was deleted.

10 changes: 0 additions & 10 deletions MSM8909Pkg/PrePi/ProcessorSupport.h

This file was deleted.

2 changes: 1 addition & 1 deletion ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sudo apt update
sudo apt install -y build-essential uuid-dev iasl git nasm crossbuild-essential-armel crossbuild-essential-armhf bc
curdir="$PWD"
cd ..
git clone https://github.com/tianocore/edk2.git -b edk2-stable202305 --recursive
git clone https://github.com/tianocore/edk2.git -b edk2-stable202405 --recursive
git clone https://github.com/tianocore/edk2-platforms.git
cd "$curdir"
git submodule init
Expand Down

0 comments on commit 6c45777

Please sign in to comment.