summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harkin <ryan.harkin@linaro.org>2012-11-26 17:04:36 +0000
committerRyan Harkin <ryan.harkin@linaro.org>2012-11-26 17:04:36 +0000
commit1d55305ee177d6e561c103303af189773bceb5b1 (patch)
treeb36956223033d78993841028b51446e10d4746d5
parent19d48bece30c52b68b1f673a720c2d09ae1583f6 (diff)
parent830f4654e62cd048a19d166be94029fd6a259a0c (diff)
Merge branch 'armlt-tracking-misc' into armlt-tracking
-rw-r--r--edk2/ArmPkg/Library/BdsLib/BdsLinuxLoader.c2
-rw-r--r--edk2/BaseTools/Conf/tools_def.template6
-rw-r--r--edk2/BaseTools/Source/C/GenFv/GenFv.c7
-rw-r--r--edk2/BaseTools/Source/C/GenFv/GenFvInternalLib.c48
-rw-r--r--edk2/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c6
5 files changed, 31 insertions, 38 deletions
diff --git a/edk2/ArmPkg/Library/BdsLib/BdsLinuxLoader.c b/edk2/ArmPkg/Library/BdsLib/BdsLinuxLoader.c
index 901781f2f..cc54343fa 100644
--- a/edk2/ArmPkg/Library/BdsLib/BdsLinuxLoader.c
+++ b/edk2/ArmPkg/Library/BdsLib/BdsLinuxLoader.c
@@ -26,8 +26,8 @@ PreparePlatformHardware (
//Note: Interrupts will be disabled by the GIC driver when ExitBootServices() will be called.
// Clean, invalidate, disable data cache
- ArmDisableDataCache();
ArmCleanInvalidateDataCache();
+ ArmDisableDataCache();
// Invalidate and disable the Instruction cache
ArmDisableInstructionCache ();
diff --git a/edk2/BaseTools/Conf/tools_def.template b/edk2/BaseTools/Conf/tools_def.template
index a82404a14..fcfb1fc8a 100644
--- a/edk2/BaseTools/Conf/tools_def.template
+++ b/edk2/BaseTools/Conf/tools_def.template
@@ -2541,7 +2541,7 @@ DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-strict-aliasing -
DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe
DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe
DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency
-DEFINE GCC_ARMGCC_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer
+DEFINE GCC_ARMGCC_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address
DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie
DEFINE GCC_IA32_X64_DLINK_COMMON = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections
DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT)
@@ -4871,8 +4871,8 @@ RELEASE_ARMLINUXGCC_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittl
*_ARMLINUXGCC_ARM_SLINK_FLAGS = -rc
*_ARMLINUXGCC_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -Ttext=0x0 --oformat=elf32-littlearm --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
- DEBUG_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -Wno-address -O0
-RELEASE_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable
+ DEBUG_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -fno-stack-protector -O0 -mno-unaligned-access
+RELEASE_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -fno-stack-protector -Wno-unused-but-set-variable -mno-unaligned-access
#################
# ASM 16 linker defintions
diff --git a/edk2/BaseTools/Source/C/GenFv/GenFv.c b/edk2/BaseTools/Source/C/GenFv/GenFv.c
index fa86d009d..a68c7b8fb 100644
--- a/edk2/BaseTools/Source/C/GenFv/GenFv.c
+++ b/edk2/BaseTools/Source/C/GenFv/GenFv.c
@@ -623,12 +623,7 @@ Returns:
);
} else {
VerboseMsg ("Create Fv image and its map file");
- //
- // Will take rebase action at below situation:
- // 1. ForceRebase Flag specified to TRUE;
- // 2. ForceRebase Flag not specified, BaseAddress greater than zero.
- //
- if (((mFvDataInfo.BaseAddress > 0) && (mFvDataInfo.ForceRebase == -1)) || (mFvDataInfo.ForceRebase == 1)) {
+ if (mFvDataInfo.BaseAddressSet) {
VerboseMsg ("FvImage Rebase Address is 0x%llX", (unsigned long long) mFvDataInfo.BaseAddress);
}
//
diff --git a/edk2/BaseTools/Source/C/GenFv/GenFvInternalLib.c b/edk2/BaseTools/Source/C/GenFv/GenFvInternalLib.c
index c01e504cb..d14304018 100644
--- a/edk2/BaseTools/Source/C/GenFv/GenFvInternalLib.c
+++ b/edk2/BaseTools/Source/C/GenFv/GenFvInternalLib.c
@@ -506,6 +506,7 @@ Returns:
EFI_STATUS
AddPadFile (
+ IN FV_INFO *FvInfo,
IN OUT MEMORY_FILE *FvImage,
IN UINT32 DataAlignment,
IN VOID *FvEnd,
@@ -537,6 +538,8 @@ Returns:
{
EFI_FFS_FILE_HEADER *PadFile;
UINTN PadFileSize;
+ UINTN PadFileOffset;
+ UINTN ExtHeaderSize;
//
// Verify input parameters.
@@ -559,32 +562,29 @@ Returns:
// This is the earliest possible valid offset (current plus pad file header
// plus the next file header)
//
- PadFileSize = (UINTN) FvImage->CurrentFilePointer - (UINTN) FvImage->FileImage + (sizeof (EFI_FFS_FILE_HEADER) * 2);
+ // The padding is added into its own FFS file (which requires a header) added before the aligned file:
+ // | ... FV data before AlignedFile ... | Pad File FFS Header | Padding | AlignedFile FFS Header (+ ExtHeader) | AlignedData
//
- // Add whatever it takes to get to the next aligned address
+ // Calculate the Offset of the Pad File from the beginning of the FV file
//
- while ((PadFileSize % DataAlignment) != 0) {
- PadFileSize++;
- }
- //
- // Subtract the next file header size
- //
- PadFileSize -= sizeof (EFI_FFS_FILE_HEADER);
-
- //
- // Subtract the starting offset to get size
- //
- PadFileSize -= (UINTN) FvImage->CurrentFilePointer - (UINTN) FvImage->FileImage;
+ PadFileOffset = (UINTN) FvImage->CurrentFilePointer - (UINTN) FvImage->FileImage;
//
- // Append extension header size
+ // Get the size of the extension header if exists
//
if (ExtHeader != NULL) {
- PadFileSize = PadFileSize + ExtHeader->ExtHeaderSize;
+ ExtHeaderSize = ExtHeader->ExtHeaderSize;
+ } else {
+ ExtHeaderSize = 0;
}
//
+ // Calculate the Size of the Padding to ensure the alignment of the data of the Next file
+ //
+ PadFileSize = DataAlignment - ((FvInfo->BaseAddress + PadFileOffset + sizeof (EFI_FFS_FILE_HEADER) + ExtHeaderSize) & (DataAlignment - 1));
+
+ //
// Verify that we have enough space for the file header
//
if (((UINTN) FvImage->CurrentFilePointer + PadFileSize) > (UINTN) FvEnd) {
@@ -1115,7 +1115,7 @@ Returns:
//
// Add pad file if necessary
//
- Status = AddPadFile (FvImage, 1 << CurrentFileAlignment, *VtfFileImage, NULL);
+ Status = AddPadFile (FvInfo, FvImage, 1 << CurrentFileAlignment, *VtfFileImage, NULL);
if (EFI_ERROR (Status)) {
Error (NULL, 0, 4002, "Resource", "FV space is full, could not add pad file for data alignment property.");
free (FileBuffer);
@@ -2304,7 +2304,7 @@ Returns:
//
// Add FV Extended Header contents to the FV as a PAD file
//
- AddPadFile (&FvImageMemoryFile, 4, VtfFileImage, FvExtHeader);
+ AddPadFile (&mFvDataInfo, &FvImageMemoryFile, 4, VtfFileImage, FvExtHeader);
//
// Fv Extension header change update Fv Header Check sum
@@ -2825,19 +2825,11 @@ Returns:
PeFileBuffer = NULL;
//
- // Don't need to relocate image when BaseAddress is zero and no ForceRebase Flag specified.
+ // Don't need to relocate image when BaseAddress is not set.
//
- if ((FvInfo->BaseAddress == 0) && (FvInfo->ForceRebase == -1)) {
+ if (FvInfo->BaseAddressSet == FALSE) {
return EFI_SUCCESS;
}
-
- //
- // If ForceRebase Flag specified to FALSE, will always not take rebase action.
- //
- if (FvInfo->ForceRebase == 0) {
- return EFI_SUCCESS;
- }
-
XipBase = FvInfo->BaseAddress + XipOffset;
diff --git a/edk2/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c b/edk2/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
index 72e6d4c6d..839f3a003 100644
--- a/edk2/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
+++ b/edk2/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
@@ -231,6 +231,12 @@ MmcIdentificationMode (
// Are we using SDIO ?
Status = MmcHost->SendCommand (MmcHost, MMC_CMD5, 0);
+
+#if 1 // Added for Panda Board
+ /* It seems few SD cards need some time to recover from this command? */
+ MicroSecondDelay(1000);
+#endif
+
if (Status == EFI_SUCCESS) {
DEBUG((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD5): Error - SDIO not supported.\n"));
return EFI_UNSUPPORTED;