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

View Change

util: cbfstool: Add new flag 'ALIGNED' for checking alignment at build time

Some FMAP sections (for example MRC_VAR_CACHE, RW_DDR_TRAINING, ...) are
accessed directly by raw block I/O and must be aligned at SPI flash
erase block size (see spi_flash.c#spi_flash_erase_cmd, error "SF: Erase
offset/length not multiple of erase size").

If we don't add explicit offset to these sections in FMD files, changing
size of other sections may unexpectedly causing them to be unaligned.

This patch adds a new flag "ALIGNED" so we can declare a FMAP section as

RW_DDR_TRAINING(ALIGNED) 8k

to ensure an 8k section that its offset and size will be both aligned
at 4k.

Note: in current implementation the alignment is fixed at 4k, which is
supported on almost all SPI chipsets today.

TEST=Change bootblock from default.fmd to BOOTBLOCK(ALIGNED) 127k and build,
seeing error message:
"E: Section 'BOOTBLOCK'@0[0x1fc00] must be aligned to 0x1000"

Change-Id: I26b394590c28667a4afcd521c7caa2009b5b98a9
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
---
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
8 files changed, 629 insertions(+), 440 deletions(-)

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

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: 2
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-CC: Yu-Ping Wu <yupingso@google.com>
Gerrit-CC: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: newpatchset