summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Lindholm <leif.lindholm@linaro.org>2014-05-30 16:46:14 +0100
committerLeif Lindholm <leif.lindholm@linaro.org>2014-05-30 16:46:14 +0100
commit536acd417b8984e6178ccdecb24f3e7429c39692 (patch)
treee4b82fa1eb920f7bb3330de240ce717f2d4a92a1
parent50e7cb72b0c8c2dd38884307eeb126d2a315ac20 (diff)
parentad3de31b53852f3bb9f55e90f25d757e89783555 (diff)
Merge remote-tracking branch 'rmt-1/linaro-topic-misc' into release-preplinaro-edk2-2014.06-a1
-rw-r--r--.gitignore22
-rw-r--r--ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c26
-rw-r--r--EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c46
-rw-r--r--MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c9
l---------edk21
5 files changed, 91 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..70df4bdd17
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,22 @@
+*.d
+*.o
+*.pyc
+BaseTools/Source/C/VfrCompile/EfiVfrParser.cpp
+BaseTools/Source/C/VfrCompile/EfiVfrParser.h
+BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr
+BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg
+BaseTools/Source/C/VfrCompile/VfrLexer.cpp
+BaseTools/Source/C/VfrCompile/VfrLexer.h
+BaseTools/Source/C/VfrCompile/VfrParser.dlg
+BaseTools/Source/C/VfrCompile/VfrSyntax.cpp
+BaseTools/Source/C/VfrCompile/VfrTokens.h
+BaseTools/Source/C/bin/
+BaseTools/Source/C/libs/
+Build/
+Conf/.cache/
+Conf/BuildEnv.sh
+Conf/build_rule.txt
+Conf/target.txt
+Conf/tools_def.txt
+PandaBoardPkg/Tools/chtool
+tmp.bin
diff --git a/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c b/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c
index d0eb075c6f..4805b40bc4 100644
--- a/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c
+++ b/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c
@@ -258,19 +258,20 @@ BdsBootLinuxFdt (
Status = BdsLoadImage (InitrdDevicePath, AllocateAnyPages, &InitrdImageBase, &InitrdImageBaseSize);
}
if (EFI_ERROR(Status)) {
- Print (L"ERROR: Did not find initrd image.\n");
- goto EXIT_FREE_LINUX;
- }
-
- // Check if the initrd is a uInitrd
- if (*(UINT32*)((UINTN)InitrdImageBase) == LINUX_UIMAGE_SIGNATURE) {
- // Skip the 64-byte image header
- InitrdImage = (EFI_PHYSICAL_ADDRESS)((UINTN)InitrdImageBase + 64);
- InitrdImageSize = InitrdImageBaseSize - 64;
- } else {
- InitrdImage = InitrdImageBase;
- InitrdImageSize = InitrdImageBaseSize;
+ Print (L"ERROR: Did not find initrd image, you may need to update your config. Attempting to continue without it.\n");
+ InitrdImageBase = 0;
}
+ else {
+ // Check if the initrd is a uInitrd
+ if (*(UINT32*)((UINTN)InitrdImageBase) == LINUX_UIMAGE_SIGNATURE) {
+ // Skip the 64-byte image header
+ InitrdImage = (EFI_PHYSICAL_ADDRESS)((UINTN)InitrdImageBase + 64);
+ InitrdImageSize = InitrdImageBaseSize - 64;
+ } else {
+ InitrdImage = InitrdImageBase;
+ InitrdImageSize = InitrdImageBaseSize;
+ }
+ }
}
// Load the FDT binary from a device path. The FDT will be reloaded later to a more appropriate location for the Linux kernel.
@@ -299,7 +300,6 @@ EXIT_FREE_INITRD:
gBS->FreePages (InitrdImageBase, EFI_SIZE_TO_PAGES (InitrdImageBaseSize));
}
-EXIT_FREE_LINUX:
gBS->FreePages (LinuxImage, EFI_SIZE_TO_PAGES (LinuxImageSize));
return Status;
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
index 81ba7372f7..8e13e05c36 100644
--- a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
+++ b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
@@ -14,9 +14,50 @@
#include <Library/BaseMemoryLib.h>
#include <Library/TimerLib.h>
+#include <Library/UefiBootServicesTableLib.h>
#include "Mmc.h"
+#define MAX_RETRY_COUNT 1000
+#define CMD_RETRY_COUNT 20
+
+#define TPL_FIRMWARE_INTERRUPTS ((EFI_TPL)((int) TPL_NOTIFY + 1))
+#define TPL_FOR_MMC_BLOCK_IO TPL_FIRMWARE_INTERRUPTS
+
+EFI_TPL
+CurrentTpl() {
+ const EFI_TPL Current = gBS->RaiseTPL(TPL_HIGH_LEVEL) ;
+ gBS->RestoreTPL(Current) ;
+ return Current ;
+}
+
+EFI_TPL
+RaiseTplIfLow() {
+ EFI_TPL Current = CurrentTpl() ;
+ /*
+ UEFI Spec states:
+ TPL_CALLBACK Interrupts code executing below TPL_CALLBACK level. Long
+ term operations (such as file system operations and disk I/O) can occur
+ at this level.
+ TPL_NOTIFY Interrupts code executing below TPL_NOTIFY level. Blocking is
+ not allowed at this level. Code executes to completion and returns. If
+ code requires more processing, it needs to signal an event to wait to
+ obtain control again at whatever level it requires. This level is
+ typically used to process low level IO to or from a device.
+ (Firmware Interrupts) This level is internal to the firmware . It is the
+ level at which internal interrupts occur. Code running at this level
+ interrupts code running at the TPL_NOTIFY level (or lower levels). If
+ the interrupt requires extended time to complete, firmware signals
+ another event (or events) to perform the longer term operations so that
+ other interrupts can occur.
+ */
+ if (Current < TPL_FOR_MMC_BLOCK_IO) {
+ Current = gBS->RaiseTPL(TPL_FOR_MMC_BLOCK_IO) ;
+ }
+ return Current ;
+}
+
+
EFI_STATUS
MmcNotifyState (
IN MMC_HOST_INSTANCE *MmcHostInstance,
@@ -405,6 +446,7 @@ MmcIoBlocks (
EFI_MMC_HOST_PROTOCOL *MmcHost;
UINTN BytesRemainingToBeTransfered;
UINTN BlockCount;
+ EFI_TPL Tpl;
BlockCount = 1;
MmcHostInstance = MMC_HOST_INSTANCE_FROM_BLOCK_IO_THIS (This);
@@ -484,8 +526,11 @@ MmcIoBlocks (
// Write a single block
Cmd = MMC_CMD24;
}
+ // Raise Tpl to protect against Timer events between command and block IO
+ Tpl = RaiseTplIfLow() ;
Status = MmcHost->SendCommand (MmcHost, Cmd, CmdArg);
if (EFI_ERROR (Status)) {
+ gBS->RestoreTPL(Tpl);
DEBUG ((EFI_D_ERROR, "MmcIoBlocks(MMC_CMD%d): Error %r\n", Cmd, Status));
return Status;
}
@@ -493,6 +538,7 @@ MmcIoBlocks (
if (Transfer == MMC_IOBLOCKS_READ) {
// Read one block of Data
Status = MmcHost->ReadBlockData (MmcHost, Lba, This->Media->BlockSize, Buffer);
+ gBS->RestoreTPL(Tpl) ;
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_BLKIO, "MmcIoBlocks(): Error Read Block Data and Status = %r\n", Status));
MmcStopTransmission (MmcHost);
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
index a35b4f2d0d..5134310d44 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
@@ -157,6 +157,15 @@ PartitionInstallMbrChildHandles (
BlockSize,
Mbr
);
+
+ // RMH - hack - Linaro's development boards use SD cards, currently we have
+ // a problem where each unique SD card has a different UUID when created
+ // with linaro-media-create / linaro-android-media create.
+ // This means that no one Boot Device configuration can boot Linaro images
+ // without some manual intervention from the user.
+ // This hack will zero the signature (UUID) read from the card.
+ ZeroMem(&(Mbr->UniqueMbrSignature[0]), sizeof (Mbr->UniqueMbrSignature));
+
if (EFI_ERROR (Status)) {
Found = Status;
goto Done;
diff --git a/edk2 b/edk2
new file mode 120000
index 0000000000..945c9b46d6
--- /dev/null
+++ b/edk2
@@ -0,0 +1 @@
+. \ No newline at end of file