Bug #238
opencoreboot.rom containing big-endian code has little-endian encoded fmap headers.
0%
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.
Updated by Marty Plummer about 5 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.
Updated by Marty Plummer about 5 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.