Hung-Te Lin uploaded patch set #7 to this change.

View Change

util: cbfstool: Check alignment at build time

Most FMAP sections that need to be updated independently should be
aligned to erase block size (e.g., 4k), otherwise power failure during
update may corrupt other sections.

FMD today allows implicit offset and size, so sometimes we may make few
sections being unaligned unexpectedly if there is no build time checks.

Since most sections (especially in chromeos.fmd) do need alignment, the
patch is assuming "aligned" as default. For sections that don't need to
be aligned, add a '%' after section name/offset explicitly. For example:

FMAP@0x1000% 0x800

Declared FMAP section to be in offset 0x1000, size 0x800, and no need to
be aligned.


Declared the CBFS section to be unaligned, using auto offset/size.

Since most boards already have CBFS and FMAP being unaligned, the patch
only gives warning when unaligned sections were found. Follow up patches
will fix FMD files, and eventually change warning to error.

TEST=make -j # pass

Change-Id: I26b394590c28667a4afcd521c7caa2009b5b98a9
Signed-off-by: Hung-Te Lin <>
M Documentation/lib/
M util/cbfstool/default-x86.fmd
M util/cbfstool/fmap_from_fmd.c
M util/cbfstool/fmd.h
M util/cbfstool/fmd_parser.c_shipped
M util/cbfstool/fmd_parser.h_shipped
M util/cbfstool/fmd_parser.y
M util/cbfstool/fmd_scanner.c_shipped
M util/cbfstool/fmd_scanner.h_shipped
M util/cbfstool/fmd_scanner.l
10 files changed, 619 insertions(+), 410 deletions(-)

git pull ssh:// refs/changes/62/37262/7

To view, visit change 37262. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I26b394590c28667a4afcd521c7caa2009b5b98a9
Gerrit-Change-Number: 37262
Gerrit-PatchSet: 7
Gerrit-Owner: Hung-Te Lin <>
Gerrit-Reviewer: Arthur Heymans <>
Gerrit-Reviewer: Hung-Te Lin <>
Gerrit-Reviewer: Julius Werner <>
Gerrit-Reviewer: Yu-Ping Wu <>
Gerrit-Reviewer: build bot (Jenkins) <>
Gerrit-CC: Paul Menzel <>
Gerrit-MessageType: newpatchset