util/cbfstool: Add support for mapping extended window for x86 platforms
commit0ae389cb237333bd7601952eef84e87075c77b76
authorFurquan Shaikh <furquan@google.com>
Sat, 21 Nov 2020 18:35:10 +0000 (21 10:35 -0800)
committerFurquan Shaikh <furquan@google.com>
Tue, 8 Dec 2020 18:58:57 +0000 (8 18:58 +0000)
treefa25f6cfb86eab8c500e5bf73c0644173840d160
parent0dcc0662f3c683248f3096f27de269fa0f88d357
util/cbfstool: Add support for mapping extended window for x86 platforms

All x86 platforms until now have memory mapped up to a maximum of
16MiB of SPI flash just below 4G boundary in host address space. For
newer platforms, cbfstool needs to be able to accommodate additional
windows in the host address space for mapping SPI flash size greater
than 16MiB.

This change adds two input parameters to cbfstool ext-win-base and
ext-win-size which a platform can use to provide the details of the
extended window in host address space. The extended window does not
necessarily have to be contiguous with the standard decode window
below 4G. But, it is left upto the platform to ensure that the fmap
sections are defined such that they do not cross the window boundary.

create_mmap_windows() uses the input parameters from the platform for
the extended window and the flash size to determine if extended mmap
window is used. If the entire window in host address space is not
covered by the SPI flash region below the top 16MiB, then mapping is
assumed to be done at the top of the extended window in host space.

BUG=b:171534504

Change-Id: Ie8f95993e9c690e34b0e8e792f9881c81459c6b6
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47882
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
util/cbfstool/cbfstool.c