I have tried tonight on my personal computer with the latest revision of
Tianocore (rev1199).
Actually, there is two versions of the BeagleBoard UFEI upstream. There is the
original version.
And the version we are working on which reuses most of the framework we have
introduces for our development platform to avoid code duplication and
flexibilty.
This is the version I have tested, to build it you must use './build-next.sh'
instead of './build.sh'
Unfortunately, there are two patches you will need to apply. These patches are
pending and wait to be approved by the maintainers of their respective packages.
One of the patch in the source tree and the other one is attached to this email.
Configuration:
--------------
- ARM GCC CodeSourcery arm-none-eabi-2010q3
- qEmu-linaro:
commit 2d601b5fb663bb2876b85bec255d73bba01e38e6
Author: Peter Maydell <peter.mayd...@linaro.org>
Date: Wed Jun 15 15:08:48 2011 +0000
- Tianocore EDK2: revision 11999
Build process:
--------------
svn co https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2 edk2 --username
guest -r 11999
cd edk2
svn co
https://edk2-fatdriver2.svn.sourceforge.net/svnroot/edk2-fatdriver2/trunk/FatPkg
FatPkg --username guest
patch -p1 < ArmPlatformPkg/Documentation/patches/BaseTools-Pending-Patches.patch
patch -p1 < 0001-MdeModulePkg-DxeCore-Fix-the-loop-to-find-the-highes.patch
cd BeagleBoardPkg
I add to fix 2 easy warnings to make it build
./build-next.sh RELEASE
To test on qEmu:
----------------
./qemu-system-arm -M beagle -mtdblock
~/dev/edk2/Build/BeagleBoard/RELEASE_ARMGCC/FV/BeagleBoard_EFI_flashboot.fd
-serial stdio -sd ~/dev/linaro-image-tools-0.4.8/beagle_sd.img
Log: starting an ATAG kernel from UEFI (after editing its filepath):
------------------------------------------------------------------------------
VNC server running on `127.0.0.1:5900'
The default boot selection will start in 8 seconds
[1] Linux from SD
[2] EBL
[3] Boot Manager
Start: 1
ERROR: Did not find Linux kernel.
[1] Linux from SD
[2] EBL
[3] Boot Manager
Start: 3
[1] Add Boot Device Entry
[2] Update Boot Device Entry
[3] Remove Boot Device Entry
[4] Return to main menu
Choice: 2
[1] Linux from SD
Update entry: 1
File path of the EFI Application or the kernel: zImage-atag
Has FDT support? [y/n] n
Arguments to pass to the binary:
Description for this new Entry: Linux from SD
[1] Add Boot Device Entry
[2] Update Boot Device Entry
[3] Remove Boot Device Entry
[4] Return to main menu
Choice: 4
[1] Linux from SD
[2] EBL
[3] Boot Manager
Start: 1
PEI 160 ms
DXE 622 ms
BDS 22922 ms
BDS 1418980260529 ms
Total Time = 1418980284234 ms
Uncompressing Linux... done, booting the kernel.
[ 0.000000] Linux version 2.6.38.7 (olivier@olivier-laptop) (gcc version
4.5.1 (Sourcery G++ Lite 2010.09-51) ) #1 Sun Jul 3 15:42:26 BST 2011
[ 0.000000] CPU: ARMv7 Processor [412fc083] revision 3 (ARMv7), cr=10c53c7f
[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction
cache
[ 0.000000] Machine: OMAP3 Beagle Board
[ 0.000000] Reserving 33554432 bytes SDRAM for VRAM
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] OMAP3430/3530 ES3.1 (iva sgx neon isp )
[ 0.000000] SRAM: Mapped pa 0x40200000 to va 0xfe400000 size: 0x10000
[ 0.000000] Clocking rate (Crystal/Core/MPU): 26.0/332/500 MHz
[ 0.000000] Reprogramming SDRC clock to 332000000 Hz
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total
pages: 24320
[ 0.000000] Kernel command line: root=/dev/mmcblk0p2 rootwait
console=ttyO2,115200
[ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Memory: 96MB = 96MB total
(...)
Log: Boot from a FDT kernel added to the Boot Menu:
-----------------------------------------------------------------
UEFI firmware built at 23:09:40 on Jul 6 2011
omap_badwidth_read32: 32-bit register 0x00000000
The default boot selection will start in 8 seconds
[1] Linux from SD
[2] EBL
[3] Boot Manager
Start: 3
[1] Add Boot Device Entry
[2] Update Boot Device Entry
[3] Remove Boot Device Entry
[4] Return to main menu
Choice: 1
[1] SemihostFs (0 MB)
[2] boot (51 MB)
[3] VenHw(4D00EF14-C4E0-426B-81B7-30A00A14AAD6)
Select the Boot Device: 2
File path of the EFI Application or the kernel: zImage-fdt
Has FDT support? [y/n] y
Arguments to pass to the binary:
Description for this new Entry: FDT Kernel from SD
[1] Add Boot Device Entry
[2] Update Boot Device Entry
[3] Remove Boot Device Entry
[4] Return to main menu
Choice: 4
[1] Linux from SD
[2] FDT Kernel from SD
[3] EBL
[4] Boot Manager
Start: 2
PEI 149 ms
DXE 609 ms
BDS 222 ms
Total Time = 981 ms
omap2_inth_read: Bad register 0x00000020
[ 0.000000] Linux version 2.6.39.1 (cosgor01@cam-vm-424) (gcc version 4.5.1
(Sourcery G++ Lite 2010.09-51) ) #2 SMP Thu Jun 30 18:55:24 BST 2011
[ 0.000000] CPU: ARMv7 Processor [412fc083] revision 3 (ARMv7), cr=10c53c7f
[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction
cache
[ 0.000000] Machine: OMAP3 Beagle Board, model: TI OMAP3 BeagleBoard
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] OMAP3430/3530 ES3.1 (iva sgx neon isp )
[ 0.000000] SRAM: Mapped pa 0x40200000 to va 0xfe400000 size: 0x10000
[ 0.000000] Clocking rate (Crystal/Core/MPU): 26.0/332/500 MHz
[ 0.000000] Reprogramming SDRC clock to 332000000 Hz
[ 0.000000] PERCPU: Embedded 7 pages/cpu @c0cc7000 s8160 r8192 d12320 u32768
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total
pages: 32512
[ 0.000000] Kernel command line: root=/dev/mmcblk0p2 rootwait
console=ttyO2,115200n8
[ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
(...)
-- IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended recipient,
please notify the sender immediately and do not disclose the contents to any
other person, use it for any purpose, or store or copy the information in any
medium. Thank you.
From b2dceaa496fad428f5e90d908caa6649140318fe Mon Sep 17 00:00:00 2001
From: Olivier Martin <olivier.mar...@arm.com>
Date: Wed, 6 Jul 2011 10:59:01 +0100
Subject: [PATCH] MdeModulePkg/DxeCore: Fix the loop to find the highest
memory region to fix the DXE allocations
There was a wrong assignment which could lead to an infinte loop in DXE core in some conditions..
---
MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 59 ++++++++++++++------------------------
1 files changed, 22 insertions(+), 37 deletions(-)
mode change 100644 => 100755 MdeModulePkg/Core/Dxe/Gcd/Gcd.c
diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
old mode 100644
new mode 100755
index 0ec75ca..645cdc2
--- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
+++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
@@ -2038,50 +2038,35 @@ CoreInitializeMemoryServices (
// region that is big enough to initialize the DXE core. Always skip the PHIT Resource HOB.
// The max address must be within the physically addressible range for the processor.
//
- MaxMemoryLength = 0;
- MaxAddress = MAX_ADDRESS;
- do {
- HighAddress = 0;
- Found = FALSE;
+
+ //
+ // Search for a tested memory region that is above MaxAddress
+ //
+ MaxAddress = 0;
+ for (Hob.Raw = *HobStart; !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {
//
- // Search for a tested memory region that is below MaxAddress
+ // See if this is a resource descriptor HOB that does not contain the PHIT.
//
- for (Hob.Raw = *HobStart; !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {
+ if (Hob.ResourceDescriptor != PhitResourceHob && GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
+ ResourceHob = Hob.ResourceDescriptor;
//
- // See if this is a resource descriptor HOB that does not contain the PHIT.
+ // See if this resource descrior HOB describes tested system memory below MaxAddress
//
- if (Hob.ResourceDescriptor != PhitResourceHob && GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
-
- ResourceHob = Hob.ResourceDescriptor;
- //
- // See if this resource descrior HOB describes tested system memory below MaxAddress
- //
- if (ResourceHob->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY &&
- (ResourceHob->ResourceAttribute & MEMORY_ATTRIBUTE_MASK) == TESTED_MEMORY_ATTRIBUTES &&
- ResourceHob->PhysicalStart + ResourceHob->ResourceLength <= MaxAddress) {
- //
- // See if this is the highest tested system memory region below MaxAddress
- //
- if (ResourceHob->PhysicalStart > HighAddress) {
-
- MaxResourceHob = ResourceHob;
- HighAddress = MaxResourceHob->PhysicalStart;
- Found = TRUE;
- }
- }
+ if (ResourceHob->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY &&
+ (ResourceHob->ResourceAttribute & MEMORY_ATTRIBUTE_MASK) == TESTED_MEMORY_ATTRIBUTES &&
+ ResourceHob->PhysicalStart + ResourceHob->ResourceLength > MaxAddress &&
+ ResourceHob->ResourceLength > MINIMUM_INITIAL_MEMORY_SIZE)
+ {
+ MaxMemoryBaseAddress = PageAlignAddress (MaxResourceHob->PhysicalStart);
+ MaxMemoryLength = PageAlignLength (MaxResourceHob->PhysicalStart + MaxResourceHob->ResourceLength - MaxMemoryBaseAddress);
+ MaxMemoryAttributes = MaxResourceHob->ResourceAttribute;
+
+ // Update Max Address for this new Resource HOB
+ MaxAddress = ResourceHob->PhysicalStart;
}
}
- if (Found) {
- //
- // Compute the size of the tested memory region below MaxAddrees
- //
- MaxMemoryBaseAddress = PageAlignAddress (MaxResourceHob->PhysicalStart);
- MaxMemoryLength = PageAlignLength (MaxResourceHob->PhysicalStart + MaxResourceHob->ResourceLength - MaxMemoryBaseAddress);
- MaxMemoryAttributes = MaxResourceHob->ResourceAttribute;
- }
- MaxAddress = ResourceHob->PhysicalStart;
- } while (Found && MaxMemoryLength < MINIMUM_INITIAL_MEMORY_SIZE);
+ }
if ((Length < MINIMUM_INITIAL_MEMORY_SIZE) ||
(MaxMemoryBaseAddress > BaseAddress && MaxMemoryLength >= MINIMUM_INITIAL_MEMORY_SIZE)) {
--
1.7.5.1
_______________________________________________
boot-architecture mailing list
boot-architecture@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/boot-architecture