Project

General

Profile

Actions

Bug #238

open

coreboot.rom containing big-endian code has little-endian encoded fmap headers.

Added by Marty Plummer over 4 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
10/20/2019
Due date:
% Done:

0%

Estimated time:
Affected versions:
Needs backport to:
Affected hardware:
Affected OS:

Description

So, as part of my work on fully porting coreboot for ppc64/power9/talos ii I've
been using qemu-ppc64 to emulate the system in a rough way. The bootblock to
romstage jump was failing for me, however. Stepping through the code I found it
to be failing in src/lib/cbfs.c:cbfs_master_header_props. Further investigation
shows that the fmap specific headers are encoded in little-endian format (this
is also true on qemu-i440fx; I've not yet had a chance to test building little
endian firmware on a big endian system but I suspect a similar issue may occur).

The cbfs headers are always encoded in big endian, even for little endian targets.

Actions #1

Updated by Marty Plummer over 4 years ago

Marty Plummer wrote:

So, as part of my work on fully porting coreboot for ppc64/power9/talos ii I've
been using qemu-ppc64 to emulate the system in a rough way. The bootblock to
romstage jump was failing for me, however. Stepping through the code I found it
to be failing in src/lib/cbfs.c:cbfs_master_header_props. Further investigation
shows that the fmap specific headers are encoded in little-endian format (this
is also true on qemu-i440fx; I've not yet had a chance to test building little
endian firmware on a big endian system but I suspect a similar issue may occur).

The cbfs headers are always encoded in big endian, even for little endian targets.

Just checked against the emulation/qemu-power8 target (clean tree) and it also has
the fmap headers in LE while the cbfs headers are BE.

Actions #2

Updated by Marty Plummer over 4 years ago

Ok, scratch that. I was under the impression that the four bytes at
the end of coreboot.rom(more properly the coreboot cbfs's end) was
from fmap, but that's from cbfstool add-master-header. Its encoded
as LE.

Actions

Also available in: Atom PDF