Bug #238

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

Added by Marty Plummer about 1 month ago. Updated 27 days ago.

Status:NewStart date:10/20/2019
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

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.

History

#1 Updated by Marty Plummer about 1 month 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.

#2 Updated by Marty Plummer 27 days 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.

Also available in: Atom PDF