On Sat, Aug 19, 2017 at 09:49:25AM -0400, Alan Ott wrote:
> On 08/19/2017 06:37 AM, Leif Lindholm wrote:
> > (Adding linaro-uefi, since this is not official tooling.)
>
> Ok, no problem.
>
> > On Fri, Aug 18, 2017 at 07:29:59PM -0400, Alan Ott wrote:
> > > ---
> > > edk2-build.sh | 8 +++++---
> > > 1 file changed, 5 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/edk2-build.sh b/edk2-build.sh
> > > index 60da4df..fb0cb84 100755
> > > --- a/edk2-build.sh
> > > +++ b/edk2-build.sh
> > > @@ -73,11 +73,13 @@ function do_build
> > > import_openssl
> > > fi
> > > - set_cross_compile
> > > - CROSS_COMPILE="$TEMP_CROSS_COMPILE"
> > > + if [ -z $CROSS_COMPILE ]; then
> > > + set_cross_compile
> > > + CROSS_COMPILE="$TEMP_CROSS_COMPILE"
> > > + fi
> > > echo "Building $PLATFORM_NAME - $PLATFORM_ARCH"
> > > - echo "CROSS_COMPILE=\"$TEMP_CROSS_COMPILE\""
> > > + echo "CROSS_COMPILE=\"$CROSS_COMPILE\""
> > > echo "$board"_BUILDFLAGS="'$PLATFORM_BUILDFLAGS'"
> > > if [ "$TARGETS" == "" ]; then
> > Sorry, can't accept this one.
> >
> > I use this script to build multiple platforms across multiple
> > architectures in one go, and this change breaks that.
>
> I see now that it's in do_build() which is called for each platform built,
> so yes, my patch won't work. Sorry :(
>
> > But also, do you really need it? Cross compilers accessible on the
> > PATH should be automatically detected.
>
> Yes, I can do this.[1]
>
> > If you do need it, because you're using some non-standard toolchain
> > (such as aarch64-none-eabi), I would like to see something like what
> > exists (in semi-broken form) in uefi-build.sh: CROSS_COMPILE_32 vs
> > CROSS_COMPILE_64. However, in order to be useful, that would need to
> > be extended to do a per-architecture override:
> > CROSS_COMPILE_AARCH64
> > CROSS_COMPILE_ARM
> > CROSS_COMPILE_IA32
> > CROSS_COMPILE_X64
>
> Yes, I was incorrectly thinking it was intended to be similar to
> uefi-build.sh and didn't look closely enough.
>
> Sorry for the extra noise,
>
> Alan.
>
> [1] For what it's worth I've gotten into the habit of specifying the full
> path in CROSS_COMPILE when cross compiling things which build this way
> (kernels, u-boots, etc). It makes typos fail early and operates
> independently of my actual PATH, preventing a mistyped or missing path entry
> from causing it to use a compiler down the list in the system or user path.
Sure, it's a valid thing to do. Especially if testing across different
versions of toolchains. Just, I tend to do that by flipping a symlink.
If someone was to implement what I suggest above, I would be happy to
take it.
And sorry for mistyping the address to my own mailing list :|
/
Leif
Add Sanchip Zx296718 basic library files for Zx296718 SoC
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jun Nie <jun.nie(a)linaro.org>
---
.../Library/Zx296718EvbLib/Zx296718Evb.c | 132 +++++++++++++++++++++
.../Library/Zx296718EvbLib/Zx296718EvbHelper.S | 50 ++++++++
.../Library/Zx296718EvbLib/Zx296718EvbLib.inf | 53 +++++++++
.../Library/Zx296718EvbLib/Zx296718EvbMem.c | 107 +++++++++++++++++
Silicon/Sanchip/Zx296718/Include/Zx296718.h | 30 +++++
Silicon/Sanchip/Zx296718/Zx296718.dec | 32 +++++
6 files changed, 404 insertions(+)
create mode 100644 Platform/Sanchip/Zx296718Evb/Library/Zx296718EvbLib/Zx296718Evb.c
create mode 100644 Platform/Sanchip/Zx296718Evb/Library/Zx296718EvbLib/Zx296718EvbHelper.S
create mode 100644 Platform/Sanchip/Zx296718Evb/Library/Zx296718EvbLib/Zx296718EvbLib.inf
create mode 100644 Platform/Sanchip/Zx296718Evb/Library/Zx296718EvbLib/Zx296718EvbMem.c
create mode 100644 Silicon/Sanchip/Zx296718/Include/Zx296718.h
create mode 100644 Silicon/Sanchip/Zx296718/Zx296718.dec
diff --git a/Platform/Sanchip/Zx296718Evb/Library/Zx296718EvbLib/Zx296718Evb.c b/Platform/Sanchip/Zx296718Evb/Library/Zx296718EvbLib/Zx296718Evb.c
new file mode 100644
index 0000000..4e4eb54
--- /dev/null
+++ b/Platform/Sanchip/Zx296718Evb/Library/Zx296718EvbLib/Zx296718Evb.c
@@ -0,0 +1,132 @@
+/** @file
+*
+* Copyright (C) 2017 Sanechips Technology Co., Ltd.
+* Copyright (c) 2017, Linaro Ltd.
+*
+* 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/IoLib.h>
+#include <Library/ArmPlatformLib.h>
+#include <Library/DebugLib.h>
+#include <Library/PcdLib.h>
+
+#include <Ppi/ArmMpCoreInfo.h>
+
+#include <Zx296718.h>
+
+ARM_CORE_INFO mZx296718EvbInfoTable[] = {
+ {
+ // Cluster 0, Core 0
+ 0x0, 0x0,
+
+ // MP Core MailBox Set/Get/Clear Addresses and Clear Value
+ (UINT64)0xFFFFFFFF
+ },
+ {
+ // Cluster 0, Core 1
+ 0x0, 0x1,
+
+ // MP Core MailBox Set/Get/Clear Addresses and Clear Value
+ (UINT64)0xFFFFFFFF
+ },
+ {
+ // Cluster 0, Core 2
+ 0x0, 0x2,
+
+ // MP Core MailBox Set/Get/Clear Addresses and Clear Value
+ (UINT64)0xFFFFFFFF
+ },
+ {
+ // Cluster 0, Core 3
+ 0x0, 0x3,
+
+ // MP Core MailBox Set/Get/Clear Addresses and Clear Value
+ (UINT64)0xFFFFFFFF
+ },
+};
+
+/**
+ Return the current Boot Mode
+
+ This function returns the boot reason on the platform
+
+ @return Return the current Boot Mode of the platform
+
+**/
+EFI_BOOT_MODE
+ArmPlatformGetBootMode (
+ VOID
+ )
+{
+ return BOOT_WITH_FULL_CONFIGURATION;
+}
+
+/**
+ Initialize controllers that must setup in the normal world
+
+ This function is called by the ArmPlatformPkg/Pei or ArmPlatformPkg/Pei/PlatformPeim
+ in the PEI phase.
+
+**/
+RETURN_STATUS
+ArmPlatformInitialize (
+ IN UINTN MpId
+ )
+{
+ return RETURN_SUCCESS;
+}
+
+/**
+ Initialize the system (or sometimes called permanent) memory
+
+ This memory is generally represented by the DRAM.
+
+**/
+VOID
+ArmPlatformInitializeSystemMemory (
+ VOID
+ )
+{
+}
+
+EFI_STATUS
+PrePeiCoreGetMpCoreInfo (
+ OUT UINTN *CoreCount,
+ OUT ARM_CORE_INFO **ArmCoreTable
+ )
+{
+ // Only support one cluster
+ *CoreCount = sizeof(mZx296718EvbInfoTable) / sizeof(ARM_CORE_INFO);
+ *ArmCoreTable = mZx296718EvbInfoTable;
+ return EFI_SUCCESS;
+}
+
+// Needs to be declared in the file. Otherwise gArmMpCoreInfoPpiGuid is undefined in the contect of PrePeiCore
+EFI_GUID mArmMpCoreInfoPpiGuid = ARM_MP_CORE_INFO_PPI_GUID;
+ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi = { PrePeiCoreGetMpCoreInfo };
+
+EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] = {
+ {
+ EFI_PEI_PPI_DESCRIPTOR_PPI,
+ &mArmMpCoreInfoPpiGuid,
+ &mMpCoreInfoPpi
+ }
+};
+
+VOID
+ArmPlatformGetPlatformPpiList (
+ OUT UINTN *PpiListSize,
+ OUT EFI_PEI_PPI_DESCRIPTOR **PpiList
+ )
+{
+ *PpiListSize = sizeof(gPlatformPpiTable);
+ *PpiList = gPlatformPpiTable;
+}
diff --git a/Platform/Sanchip/Zx296718Evb/Library/Zx296718EvbLib/Zx296718EvbHelper.S b/Platform/Sanchip/Zx296718Evb/Library/Zx296718EvbLib/Zx296718EvbHelper.S
new file mode 100644
index 0000000..829d9ef
--- /dev/null
+++ b/Platform/Sanchip/Zx296718Evb/Library/Zx296718EvbLib/Zx296718EvbHelper.S
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2017 Sanechips Technology Co., Ltd.
+# Copyright (c) 2017, Linaro Ltd.
+#
+# 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 <AsmMacroIoLibV8.h>
+#include <Library/ArmLib.h>
+
+ASM_FUNC(ArmPlatformPeiBootAction)
+ ret
+
+//UINTN
+//ArmPlatformGetCorePosition (
+// IN UINTN MpId
+// );
+// With this function: CorePos = (ClusterId * 4) + CoreId
+ASM_FUNC(ArmPlatformGetCorePosition)
+ and x1, x0, #ARM_CORE_MASK
+ and x0, x0, #ARM_CLUSTER_MASK
+ add x0, x1, x0, LSR #6
+ ret
+
+//UINTN
+//ArmPlatformGetPrimaryCoreMpId (
+// VOID
+// );
+ASM_FUNC(ArmPlatformGetPrimaryCoreMpId)
+ MOV32 (w0, FixedPcdGet32 (PcdArmPrimaryCore))
+ ret
+
+//UINTN
+//ArmPlatformIsPrimaryCore (
+// IN UINTN MpId
+// );
+ASM_FUNC(ArmPlatformIsPrimaryCore)
+ MOV32 (w1, FixedPcdGet32 (PcdArmPrimaryCoreMask))
+ and x0, x0, x1
+ MOV32 (w1, FixedPcdGet32 (PcdArmPrimaryCore))
+ cmp w0, w1
+ cset x0, eq
+ ret
diff --git a/Platform/Sanchip/Zx296718Evb/Library/Zx296718EvbLib/Zx296718EvbLib.inf b/Platform/Sanchip/Zx296718Evb/Library/Zx296718EvbLib/Zx296718EvbLib.inf
new file mode 100644
index 0000000..18b383b
--- /dev/null
+++ b/Platform/Sanchip/Zx296718Evb/Library/Zx296718EvbLib/Zx296718EvbLib.inf
@@ -0,0 +1,53 @@
+#
+# Copyright (C) 2017 Sanechips Technology Co., Ltd.
+# Copyright (c) 2017, Linaro Ltd.
+#
+# 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.
+#
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = Zx296718EvbLib
+ FILE_GUID = e1903cfc-f842-4f9a-a6ed-856bae38a902
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = ArmPlatformLib
+
+[Packages]
+ ArmPkg/ArmPkg.dec
+ ArmPlatformPkg/ArmPlatformPkg.dec
+ EmbeddedPkg/EmbeddedPkg.dec
+ MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+ Platform/Sanchip/Zx296718Evb/Zx296718Evb.dec
+ Silicon/Sanchip/Zx296718/Zx296718.dec
+
+[LibraryClasses]
+ ArmLib
+ IoLib
+ HobLib
+ MemoryAllocationLib
+ SerialPortLib
+
+[Sources.common]
+ Zx296718Evb.c
+ Zx296718EvbMem.c
+
+[Sources.AARCH64]
+ Zx296718EvbHelper.S | GCC
+
+[FeaturePcd]
+ gEmbeddedTokenSpaceGuid.PcdCacheEnable
+
+[FixedPcd]
+ gArmTokenSpaceGuid.PcdArmPrimaryCore
+ gArmTokenSpaceGuid.PcdArmPrimaryCoreMask
+ gArmTokenSpaceGuid.PcdFvBaseAddress
+ gArmTokenSpaceGuid.PcdSystemMemoryBase
+ gArmTokenSpaceGuid.PcdSystemMemorySize
diff --git a/Platform/Sanchip/Zx296718Evb/Library/Zx296718EvbLib/Zx296718EvbMem.c b/Platform/Sanchip/Zx296718Evb/Library/Zx296718EvbLib/Zx296718EvbMem.c
new file mode 100644
index 0000000..c319f4d
--- /dev/null
+++ b/Platform/Sanchip/Zx296718Evb/Library/Zx296718EvbLib/Zx296718EvbMem.c
@@ -0,0 +1,107 @@
+/** @file
+*
+* Copyright (C) 2017 Sanechips Technology Co., Ltd.
+* Copyright (c) 2017, Linaro Ltd.
+*
+* 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 <Library/PcdLib.h>
+#include <Library/IoLib.h>
+#include <Library/MemoryAllocationLib.h>
+
+#include <Zx296718.h>
+
+// The total number of descriptors, including the final "end-of-table" descriptor.
+#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 5
+
+// DDR attributes
+#define DDR_ATTRIBUTES_CACHED ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK
+#define DDR_ATTRIBUTES_UNCACHED ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED
+
+/**
+ 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
+
+**/
+VOID
+ArmPlatformGetVirtualMemoryMap (
+ IN ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap
+ )
+{
+ ARM_MEMORY_REGION_ATTRIBUTES CacheAttributes;
+ UINTN Index = 0;
+ ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable;
+ EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttributes;
+
+ ResourceAttributes = (
+ EFI_RESOURCE_ATTRIBUTE_PRESENT |
+ EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
+ EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
+ EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
+ EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
+ EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |
+ EFI_RESOURCE_ATTRIBUTE_TESTED
+ );
+
+ // Create initial Base Hob for system memory.
+ BuildResourceDescriptorHob (
+ EFI_RESOURCE_SYSTEM_MEMORY,
+ ResourceAttributes,
+ PcdGet64 (PcdSystemMemoryBase),
+ PcdGet64 (PcdSystemMemorySize)
+ );
+
+ ASSERT (VirtualMemoryMap != NULL);
+ VirtualMemoryTable = (ARM_MEMORY_REGION_DESCRIPTOR*)AllocatePages(
+ EFI_SIZE_TO_PAGES (sizeof(ARM_MEMORY_REGION_DESCRIPTOR) *
+ MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS));
+ if (VirtualMemoryTable == NULL) {
+ return;
+ }
+
+ if (FeaturePcdGet(PcdCacheEnable) == TRUE) {
+ CacheAttributes = DDR_ATTRIBUTES_CACHED;
+ } else {
+ CacheAttributes = DDR_ATTRIBUTES_UNCACHED;
+ }
+
+ Index = 0;
+
+ // Zx296718 SOC peripherals
+ VirtualMemoryTable[Index].PhysicalBase = ZX296718_PERIPH_BASE;
+ VirtualMemoryTable[Index].VirtualBase = ZX296718_PERIPH_BASE;
+ VirtualMemoryTable[Index].Length = ZX296718_PERIPH_SZ;
+ VirtualMemoryTable[Index].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
+
+ // DDR - predefined 1GB size
+ VirtualMemoryTable[++Index].PhysicalBase = PcdGet64 (PcdSystemMemoryBase);
+ VirtualMemoryTable[Index].VirtualBase = PcdGet64 (PcdSystemMemoryBase);
+ VirtualMemoryTable[Index].Length = PcdGet64 (PcdSystemMemorySize);
+ VirtualMemoryTable[Index].Attributes = CacheAttributes;
+
+ // End of Table
+ VirtualMemoryTable[++Index].PhysicalBase = 0;
+ VirtualMemoryTable[Index].VirtualBase = 0;
+ VirtualMemoryTable[Index].Length = 0;
+ VirtualMemoryTable[Index].Attributes = (ARM_MEMORY_REGION_ATTRIBUTES)0;
+
+ ASSERT((Index + 1) <= MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS);
+
+ *VirtualMemoryMap = VirtualMemoryTable;
+}
diff --git a/Silicon/Sanchip/Zx296718/Include/Zx296718.h b/Silicon/Sanchip/Zx296718/Include/Zx296718.h
new file mode 100644
index 0000000..3ace9ab
--- /dev/null
+++ b/Silicon/Sanchip/Zx296718/Include/Zx296718.h
@@ -0,0 +1,30 @@
+/** @file
+*
+* Copyright (c) 2016, Linaro Limited. 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.
+*
+**/
+
+#ifndef __ZX296718_H__
+#define __ZX296718_H__
+
+/***********************************************************************************
+// Platform Memory Map
+************************************************************************************/
+
+// SOC peripherals (UART, I2C, I2S, USB, etc)
+#define ZX296718_PERIPH_BASE 0x110000
+#define ZX296718_PERIPH_SZ 0x3000000
+
+#define SYS_CFG_BASE_ADDR 0x01463000
+#define TOP_CRM_BASE_ADDR 0x01461000
+#define AON_SYS_CTRL_BASE_ADDR 0x116000
+
+#endif /* __ZX296718_H__ */
diff --git a/Silicon/Sanchip/Zx296718/Zx296718.dec b/Silicon/Sanchip/Zx296718/Zx296718.dec
new file mode 100644
index 0000000..9ecd11d
--- /dev/null
+++ b/Silicon/Sanchip/Zx296718/Zx296718.dec
@@ -0,0 +1,32 @@
+#
+# Copyright (c) 2016, Linaro Limited. 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.
+#
+
+[Defines]
+ DEC_SPECIFICATION = 0x00010005
+ PACKAGE_NAME = Zx296718
+ PACKAGE_GUID = 6b180aeb-7bf7-4cf1-9310-dcd403d5dfcb
+ PACKAGE_VERSION = 0.1
+
+################################################################################
+#
+# Include Section - list of Include Paths that are provided by this package.
+# Comments are used for Keywords and Module Types.
+#
+# Supported Module Types:
+# BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION
+#
+################################################################################
+[Includes.common]
+ Include # Root include for the package
+
+[Guids.common]
+ gZx296718TokenSpaceGuid = { 0x7827738f, 0x0651, 0x48ab, {0xad, 0x5c, 0x8d, 0x3d, 0xad, 0x58, 0x0d, 0xa9} }
--
1.9.1
Hi all,
A little over two years ago, I set up OpenPlatformPkg [1] as a way to
prototype a single source tree for multiple platforms, built against
edk2.
Last year, we finalised the rules for how such a tree could be
integrated into the edk2-platforms [2] repository, and I have now
completed the migration. edk2-platforms master branch is now live
(although there will be some lag before it becomes the _default_
branch of the repository).
Binary-only components have moved to edk2-non-osi [3]. At the same
time edk2-non-osi has been updated with a directory structure aligned
with edk2-platforms master - as well as had explicit documentation
added regarding how licenses work in that tree.
As of this moment, OpenPlatformPkg becomes a read-only historical
document.
Mike has agreed to share overall maintainership of edk2-platforms with
me, at least until we start breaking down responsibility a bit more.
Happy hacking!
/
Leif
[1] https://git.linaro.org/uefi/OpenPlatformPkg.git
[2] https://github.com/tianocore/edk2-platforms.git
[3] https://github.com/tianocore/edk2-non-osi.git
Hi all,
Recently, I have been debugging the "Synchronous Exception" issue in
UEFI. This issue is very strange.If I used the Hisilicon bootloader and
1.3 ATF to launching UEFI,the UEFI could be booted successfully without
any issues.But if I used the "l-loader" and 1.3ATF on github to boot
UEFI, it would arose a "Synchronous Exception" issue accidentally in
FaultTolerantWriteDxe driver in UEFI. That means,with the same
"l-loader" boot image on github, sometimes we can launching the UEFI
successfully,and sometimes we will get into "Synchronous Exception" in
UEFI. And sometimes before exit from the FaultTolerantWriteInitialize
function,UEFI will get into "Synchronous Exception".
I debugged this issue for several days,and finally I found that,in front
of the "problematic code",there are some "BlockIo" functions in
BlockVariableDxe driver which have some relations with the "Synchronous
Exception". If the "BlockIo" functions can read and write the EMMC
correctly,the UEFI can get into OS loader and boot the kernel
successfully without any issues;But sometimes the "BlockIo" functions
can't work "really". That means,when we use these functions,we can't
make sure these functions have operated the EMMC rightly or not,even
though these BlockIo functions return success after being executed. I
used the BlockRead function to read one block from the EMMC to a Buffer,
sometimes I can get the right value in the Buffer,but sometimes they are
all zero or wrong data.
When the BlockRead can't "really" read data from EMMC,the UEFI will get
into "Synchronous Exception" in FaultTolerantWriteDxe driver.
I think it is the issue of EMMC which led to the "Synchronous Exception"
in UEFI. The "Hiboot" is a full function bootloader,it will initialize
the EMMC when we power on the system. But the "l-loader" and 1.3 ATF(not
include BL33) didn't initialize the EMMC .
I'm not sure about the relationship between BlockIo function in UEFI and
EMMC initialization in previous loader. Does UEFI rely on the eMMC being
initialized by previous loader? As we know,the BlockIo functions are the
system function supplied by UEFI,and do you know which factors will
influence their functionality? Can you give me some advises about this
issue?
Thanks very much!
Best regards,
Wengang