Skip to content

Commit

Permalink
fix fv error (stuck at dxecore)
Browse files Browse the repository at this point in the history
  • Loading branch information
vicenteicc2008 committed Aug 10, 2024
1 parent 72a81b6 commit f92eab7
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 61 deletions.
12 changes: 6 additions & 6 deletions MSM8909Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = {
};

CHAR8 *mBIOSInfoType0Strings[] = {
"Bad Dodo (Bad Bunny).", // Vendor String
"Dodo viC (vice2008).", // Vendor String
"Built: " __DATE__, // BiosVersion String
"Built: " __DATE__, // BiosReleaseDate String
NULL
Expand All @@ -142,8 +142,8 @@ SMBIOS_TABLE_TYPE1 mSysInfoType1 = {
6, // Family String
};
CHAR8 *mSysInfoType1Strings[] = {
"Spreadtrum",
"SC8830",
"Samsung Galaxy Tab E 7.0",
"SM-T113NU",
"",
"0bc52bb9-9473-4875-be2a-3973076c20e2",
"",
Expand Down Expand Up @@ -176,8 +176,8 @@ SMBIOS_TABLE_TYPE2 mBoardInfoType2 = {
{ 0 } // ContainedObjectHandles[1];
};
CHAR8 *mBoardInfoType2Strings[] = {
"Spreadtrum",
"SC8830",
"Samsung Galaxy Tab E 7.0",
"SM-T113NU",
"",
"0bc52bb9-9473-4875-be2a-3973076c20e2",
"",
Expand Down Expand Up @@ -207,7 +207,7 @@ SMBIOS_TABLE_TYPE3 mEnclosureInfoType3 = {
{ { 0 } }, // ContainedElements[1];
};
CHAR8 *mEnclosureInfoType3Strings[] = {
"Spreadtrum",
"Samsung Galaxy Tab E 7.0",
"1",
"0bc52bb9-9473-4875-be2a-3973076c20e2",
"",
Expand Down
4 changes: 2 additions & 2 deletions MSM8909Pkg/Include/Configuration/DeviceMemoryMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ 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_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},
{0x80000000, 0x00200000, "UEFI FD", AddMem, SYS_MEM, SYS_MEM_CAP, BsCode, 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},
// {0x87800000, 0x00240000, "SMEM", AddMem, MEM_RES, UNCACHEABLE, Reserv, UNCACHED_UNBUFFERED},
Expand Down
4 changes: 0 additions & 4 deletions MSM8909Pkg/Library/MSM8909PkgLib/Arm/ArmPlatformHelper.S
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
#include <Library/ArmLib.h>

ASM_FUNC(ArmPlatformPeiBootAction)
push {fp, lr}
add fp, sp, #4
nop
pop {fp, lr}
bx lr

//UINTN
Expand Down
10 changes: 5 additions & 5 deletions MSM8909Pkg/MSM8909Pkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
# Simple FrameBuffer
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE|BOOLEAN|1
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferAddress|0x9eef4000|UINT32|0x0000a400 # 0x7C400000
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferWidth|480|UINT32|0x0000a401
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferHeight|800|UINT32|0x0000a402
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferPixelBpp|24|UINT32|0x0000a403
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleWidth|480|UINT32|0x0000a404
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleHeight|800|UINT32|0x0000a405
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferWidth|1024|UINT32|0x0000a401
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferHeight|600|UINT32|0x0000a402
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferPixelBpp|32|UINT32|0x0000a403
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleWidth|1024|UINT32|0x0000a404
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleHeight|600|UINT32|0x0000a405
# Memory allocation
gMSM8909PkgTokenSpaceGuid.PcdUefiMemPoolBase|0|UINT64|0x00000a106
gMSM8909PkgTokenSpaceGuid.PcdUefiMemPoolSize|0|UINT32|0x00000a107
3 changes: 2 additions & 1 deletion MSM8909Pkg/MSM8909Pkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,11 @@
[PcdsFixedAtBuild.common]
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4

gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"Dodo viC (vice2008)"
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Alpha"

# Boot all cores or nothing :)
gArmPlatformTokenSpaceGuid.PcdCoreCount|1
gArmPlatformTokenSpaceGuid.PcdCoreCount|4
gArmPlatformTokenSpaceGuid.PcdClusterCount|1


Expand Down
2 changes: 1 addition & 1 deletion MSM8909Pkg/MSM8909Pkg.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
################################################################################

[FD.MSM8909PKG_UEFI]
BaseAddress = 0x80000000|gArmTokenSpaceGuid.PcdFdBaseAddress # The base address of the Firmware in NOR Flash.
BaseAddress = 0x80200000|gArmTokenSpaceGuid.PcdFdBaseAddress # The base address of the Firmware in NOR Flash.
Size = 0x00200000|gArmTokenSpaceGuid.PcdFdSize # The size in bytes of the FLASH Device
ErasePolarity = 1

Expand Down
12 changes: 6 additions & 6 deletions MSM8909Pkg/PrePi/Pi.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ VOID EFIAPI ProcessLibraryConstructorList(VOID);

VOID UartInit(VOID)
{
UINT8 *base = (UINT8 *)0x9eef4000ull;
for (UINTN i = 0; i < 0x00708000; i++) {
base[i] = 0;
}

SerialPortInitialize();

DEBUG((EFI_D_INFO, "\nTianoCore on SC8830 (ARM)\n"));
Expand Down Expand Up @@ -53,11 +58,6 @@ VOID Main (IN UINT64 StartTimeStamp)
/* Enable program flow prediction, if supported */
ArmEnableBranchPrediction();

UINT8 *base = (UINT8 *)0x9eef4000ull;
for (UINTN i = 0; i < 0x00708000; i++) {
base[i] = 0;
}

// Declare UEFI region
MemoryBase = FixedPcdGet32(PcdSystemMemoryBase);
MemorySize = FixedPcdGet32(PcdSystemMemorySize);
Expand Down Expand Up @@ -97,7 +97,7 @@ VOID Main (IN UINT64 StartTimeStamp)
BuildStackHob ((UINTN)StacksBase, StacksSize);

// TODO: Call CpuPei as a library
BuildCpuHob (ArmGetPhysicalAddressBits (), PcdGet8 (PcdPrePiCpuIoSize));
BuildCpuHob (40, PcdGet8 (PcdPrePiCpuIoSize));

// Set the Boot Mode
SetBootMode (BOOT_WITH_FULL_CONFIGURATION);
Expand Down
103 changes: 69 additions & 34 deletions MSM8909Pkg/PrePi/PrePi.inf
Original file line number Diff line number Diff line change
@@ -1,75 +1,110 @@
#/** @file
#
# (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
# Copyright (c) 2011-2017, ARM Ltd. All rights reserved.<BR>
# Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
#**/

[Defines]
INF_VERSION = 0x00010005
BASE_NAME = PrePi
FILE_GUID = 556A7392-5DF4-4067-B85C-AFDA4CDA586D
FILE_GUID = 3e401783-cc94-4fcd-97bc-bd35ac369d2f
MODULE_TYPE = SEC
VERSION_STRING = 1.0

[Sources.common]
[Sources]
Pi.h
Pi.c

[BuildOptions.ARM]
GCC:*_*_*_CC_FLAGS = -Werror -Wno-error=unused-function

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

[BuildOptions.ARM]
GCC:*_*_*_CC_FLAGS = -Werror -Wno-error=unused-function

[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
EmbeddedPkg/EmbeddedPkg.dec
ArmPkg/ArmPkg.dec
MdeModulePkg/MdeModulePkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
MSM8909Pkg/MSM8909Pkg.dec

[LibraryClasses]
ArmLib
ArmPlatformLib
ArmPlatformStackLib
ArmMmuLib
BaseLib
CacheMaintenanceLib
CompilerIntrinsicsLib
DebugAgentLib
DebugLib
ExtractGuidedSectionLib
HobLib
DebugAgentLib
ArmLib
IoLib
TimerLib
SerialPortLib
ExtractGuidedSectionLib
LzmaDecompressLib
DebugAgentLib
PrePiLib
ArmPlatformLib
ArmPlatformStackLib
MemoryAllocationLib
MemoryInitPeiLib
PeCoffGetEntryPointLib
PlatformPeiLib
HobLib
PrePiHobListPointerLib
PrePiLib
SerialPortLib
TimerLib
PlatformPeiLib
MemoryInitPeiLib

[Ppis]
gArmMpCoreInfoPpiGuid

[Guids]
gArmMpCoreInfoGuid
gEfiFirmwarePerformanceGuid

[FeaturePcd]
gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob
gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores

[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString

[FixedPcd]
gArmTokenSpaceGuid.PcdCpuVectorBaseAddress
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
gEmbeddedTokenSpaceGuid.PcdPrePiStackBase
gEmbeddedTokenSpaceGuid.PcdPrePiStackSize
gArmTokenSpaceGuid.PcdFvBaseAddress
gArmTokenSpaceGuid.PcdFvSize
gArmTokenSpaceGuid.PcdVFPEnabled

gArmTokenSpaceGuid.PcdFdBaseAddress
gArmTokenSpaceGuid.PcdFdSize

gArmTokenSpaceGuid.PcdFvBaseAddress
gArmTokenSpaceGuid.PcdFvSize

gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize

gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize
gArmPlatformTokenSpaceGuid.PcdCoreCount

gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize
gArmPlatformTokenSpaceGuid.PcdCoreCount
gArmTokenSpaceGuid.PcdCpuVectorBaseAddress

[Pcd]
gArmTokenSpaceGuid.PcdSystemMemoryBase
gArmTokenSpaceGuid.PcdSystemMemorySize
gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize

[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesCode
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData

gEmbeddedTokenSpaceGuid.PcdPrePiStackBase
gEmbeddedTokenSpaceGuid.PcdPrePiStackSize
gMSM8909PkgTokenSpaceGuid.PcdUefiMemPoolBase
gMSM8909PkgTokenSpaceGuid.PcdUefiMemPoolSize
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferAddress
gMSM8909PkgTokenSpaceGuid.PcdMipiFrameBufferAddress

[Pcd]
gArmTokenSpaceGuid.PcdSystemMemoryBase
gArmTokenSpaceGuid.PcdSystemMemorySize
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Attempt to create a minimal EDK2 for Samsung Galaxy Tab E 7.0 (SM-T113NU) but should work on SM-T116BU (3G Version)

## Status
Boots to PrePi (Fv Error).
Boots to DxeCore init.

## Building
Tested on Ubuntu 22.04.
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_bootshim.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cd BootShim
make UEFI_BASE=0x80000000 UEFI_SIZE=0x00200000
make UEFI_BASE=0x80200000 UEFI_SIZE=0x00200000
rm BootShim.elf
cd ..

0 comments on commit f92eab7

Please sign in to comment.