Update binutils URL

kernel.org doesn't seem to host it anymore

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Copy OVMF to coreboot

We'll use OVMF as base for the coreboot payload effort

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Adapt SEC

- Drop MS/Intel assembly
- Hardcode FV location to 0x600000 (as we'll do in fdf)
- Don't uncompress PEI - we compress the entire payload

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Got corebootPkg to boot

It reuses more Ovmf libraries than is good for its health or mine,
it has no idea about coreboot and its tables yet.
It can't store "fault tolerant" (ie. non-volatile) variables.

The entry point is still 0x64 bytes off for unknown reasons, but
that luckily doesn't matter since 0x32 times 0x00 0x00 are just the
right instruction for x86 to survive.

It's half blind since I have no GOP driver - serial console works.

In short, it has tons of warts. Tons of places that can be improved.
Many things left to do.

But it boots into EFI Shell. Let's ship it.

build instructions Tiano side:
  . edksetup.sh
  build -a IA32 -p corebootPkg/corebootPkgIa32.dsc

build instructions coreboot side:
  build emulator/qemu-x86 image with 2MB and no payload
  cbfstool coreboot.rom add-flat-binary \
    -f edk2/Build/corebootIa32/DEBUG_UNIXGCC/FV/COREBOOT.fd \
    -n fallback/payload -l 0x800000 -e 0x800400 -c lzma

0x800000 is the location (see corebootPkgIa32.fdf)
0x800400 is the entry point (you have to believe me on that one)

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Drop useless variable
Delete some more files
Explicitely define config options
Generalize corebootPkg

It now builds for both IA32 and X64 from the same configuration files,
which are renamed from corebootPkgIa32.* to corebootPkg.* to reflect this.

Also drop OvmfPkgX64.*. I kept these as a reference since I wasn't sure
how large the differences between the architectures are.

Please note that X64 isn't functional yet: The entry point assumes 64bit mode
and the offset problem (with some semi-random number of 0-bytes before the
actual code) actually kills the opcode stream here.
Create README.md
corebootPkg/Sec/X64: Add 32bit entry point

Extend the X64 entry point to jump from 32bit flat to 64bit first
since that's what coreboot provides to payloads

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Update "documentation" for X64

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
corebootPkg/Sec: Don't hardcode FV base address

Tiano can fetch it from Pcd

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Remove some more Qemu/Xen stuff

We don't need that on real hardware, and we can still look it up
for reference in OvmfPkg if necessary

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
corebootPkg: Remove more libraries

Those are only used by Ovmf code that we directly import from
over there, using Ovmf libraries in the process.

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
corebootPkg: No need to initialize PCI and ACPI

Those registers must be configured on QEmu, but we
already do that in coreboot (right)?

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Parse coreboot table to get memory information

Add support to parse coreboot tables and use it to build Memory Hobs

Signed-off-by: Stefan Reinauer <reinauer@google.com>
corebootPkg/Sec/X64: Align SecEntry to page size

We need to setup page tables on X64 which must be page aligned.
This never quite worked since the final step (adding SecMain.efi to
the firmware volume) linked the file to some non-4K alignment, so
enforce it.

Requires latest cbfstool with support for alignment related padding
data in FV.

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
corebootPkg: MemDetect

Avoid a cast that fails on X64.

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Support GCC 4.7

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
OvmfPkg: Don't build in QemuVideoDxe when we have CSM

Windows 2008r2 will stupidly try to use int 10h calls even when booted
via EFI. If we don't have a VGA BIOS installed, it doesn't work very well.

So where we can, just use BiosVideoDxe instead of the native QemuVideoDxe
and then Windows will work fine.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>