Attention is currently required from: Furquan Shaikh, Hung-Te Lin, Julius Werner.

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

View Change

The following approvals got outdated and were removed: Code-Review+2 by Furquan Shaikh, Code-Review+2 by Julius Werner, Code-Review-1 by Hung-Te Lin, Verified+1 by build bot (Jenkins)

util: cbfstool: Add '%<alignment>' in flashmap descriptor

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.

Flashmap descriptor (FMD) today allows implicit offset and size, so
sometimes the sections may not be properly aligned, causing failure
or unexpected results on updating (e.g., erase and write).

Because 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 (or aligned to different values), use the '%<num>' after
section name (or offset) explicitly to change the alignment. For example
'%0' means unaligned and '%512' aligns to 512 bytes. For example:

FMAP@0x1000 %0 0x800

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


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

Most boards already have CBFS and FMAP being unaligned, so the patch
only warns when seeing unaligned sections. Follow up patches will fix
FMD files, and eventually change warnings to errors.

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/default.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
11 files changed, 616 insertions(+), 407 deletions(-)

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

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: 12
Gerrit-Owner: Hung-Te Lin <>
Gerrit-Reviewer: Arthur Heymans <>
Gerrit-Reviewer: Furquan Shaikh <>
Gerrit-Reviewer: Hung-Te Lin <>
Gerrit-Reviewer: Julius Werner <>
Gerrit-Reviewer: Yu-Ping Wu <>
Gerrit-Reviewer: build bot (Jenkins) <>
Gerrit-CC: Aaron Durbin <>
Gerrit-CC: Paul Menzel <>
Gerrit-CC: Wim Vervoorn <>
Gerrit-Attention: Hung-Te Lin <>
Gerrit-Attention: Furquan Shaikh <>
Gerrit-Attention: Julius Werner <>
Gerrit-MessageType: newpatchset