Hung-Te Lin uploaded patch set #6 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 explicitly. For example:

FMAP%@0x1000 0x800

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

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 <hungte@chromium.org>
---
M Documentation/lib/flashmap.md
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, 597 insertions(+), 402 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/37262/6

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: 6
Gerrit-Owner: Hung-Te Lin <hungte@chromium.org>
Gerrit-Reviewer: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-Reviewer: Hung-Te Lin <hungte@chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner@chromium.org>
Gerrit-Reviewer: Yu-Ping Wu <yupingso@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-MessageType: newpatchset