coreboot/src/include
Julius Werner e9879c0fbd CBFS: Automate ROM image layout and remove hardcoded offsets
Non-x86 boards currently need to hardcode the position of their CBFS
master header in a Kconfig. This is very brittle because it is usually
put in between the bootblock and the first CBFS entry, without any
checks to guarantee that it won't overlap either of those. It is not fun
to debug random failures that move and disappear with tiny alignment
changes because someone decided to write "ORBC1112" over some part of
your data section (in a way that is not visible in the symbolized .elf
binaries, only in the final image). This patch seeks to prevent those
issues and reduce the need for manual configuration by making the image
layout a completely automated part of cbfstool.

Since automated placement of the CBFS header means we can no longer
hardcode its position into coreboot, this patch takes the existing x86
solution of placing a pointer to the header at the very end of the
CBFS-managed section of the ROM and generalizes it to all architectures.
This is now even possible with the read-only/read-write split in
ChromeOS, since coreboot knows how large that section is from the
CBFS_SIZE Kconfig (which is by default equal to ROM_SIZE, but can be
changed on systems that place other data next to coreboot/CBFS in ROM).

Also adds a feature to cbfstool that makes the -B (bootblock file name)
argument on image creation optional, since we have recently found valid
use cases for CBFS images that are not the first boot medium of the
device (instead opened by an earlier bootloader that can already
interpret CBFS) and therefore don't really need a bootblock.

BRANCH=None
BUG=None
TEST=Built and booted on Veyron_Pinky, Nyan_Blaze and Falco.

Change-Id: Ifcc755326832755cfbccd6f0a12104cba28a20af
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/229975
2014-12-03 06:09:54 +00:00
..
boot ramoops: Add support for passing ramoops buffer address and size through cb 2014-11-14 06:37:22 +00:00
console Add predefined __ROMSTAGE__ and __RAMSTAGE__ macros 2014-10-02 07:02:23 +00:00
cpu baytrail: Switch from ACPI mode to PCI mode for legacy support 2014-09-26 20:16:14 +00:00
device Broadwell FSP: Add new finalize functions for devices and chips 2014-11-20 20:49:36 +00:00
pc80 rtc: Add an RTC API, and implement it for x86. 2014-05-02 23:55:47 +00:00
smp Clean up #ifs 2012-05-08 00:34:34 +02:00
tpm_lite vboot2: read secdata and nvdata 2014-07-23 02:29:18 +00:00
antirollback.h vboot2: factory-initialize kernel space in tpm 2014-10-01 01:47:49 +00:00
assert.h gen: Add "assert" in assert.h. 2014-02-27 05:38:28 +00:00
base3.h gpio: Remove non-ternary tristate mode, make ternaries easier 2014-10-23 01:41:42 +00:00
bcd.h rtc: Add an RTC API, and implement it for x86. 2014-05-02 23:55:47 +00:00
boardid.h cbtables: Add RAM config information 2014-11-11 21:45:59 +00:00
bootstate.h coreboot: force 4-byte alignment for init structure with GCC 4.9 2014-10-14 23:59:10 +00:00
cbfs.h exynos: return correct value when init_default_cbfs_media fails 2014-12-02 05:32:24 +00:00
cbfs_core.h CBFS: Automate ROM image layout and remove hardcoded offsets 2014-12-03 06:09:54 +00:00
cbmem.h broadwell_fsp: Add intel FSP "driver" from coreboot.org 2014-11-19 04:10:00 +00:00
delay.h timer: generic udelay() 2014-09-29 08:42:38 +00:00
edid.h Peppy graphics 2013-09-27 23:07:14 +00:00
ehci.h Drop prototype guarding for romcc 2013-05-10 11:55:20 -07:00
elog.h elog: Add event type for CPU thermal trip 2014-05-12 22:12:36 +00:00
endian.h Extend CBFS to support arbitrary ROM source media. 2013-01-30 17:58:32 +01:00
fallback.h Make set_boot_successful depend on PC80_SYSTEM 2012-11-30 21:33:35 +01:00
gic.h drivers: add GIC support 2014-09-17 01:23:56 +00:00
gpio.h gpio: add a function to read GPIO array as base-2 value 2014-11-07 20:24:35 +00:00
inttypes.h x86: provide more C standard environment 2013-03-20 04:20:25 +01:00
ip_checksum.h Drop prototype guarding for romcc 2013-05-10 11:55:20 -07:00
kconfig.h Add config_enabled() from Linux 2012-05-08 00:36:09 +02:00
lib.h broadwell_fsp: Add intel FSP "driver" from coreboot.org 2014-11-19 04:10:00 +00:00
memlayout.h memlayout: Add TIMESTAMP region 2014-11-04 21:34:36 +00:00
memory_info.h smbios: add funtion for smbios type17 2014-08-12 02:40:38 +00:00
memrange.h coreboot memrange: Changes to memrange lib 2014-07-22 01:23:24 +00:00
ramstage_cache.h ramstage_cache: allow ramstage usage add valid helper 2013-12-13 00:07:08 +00:00
reg_script.h Add table driven way to add platform specific reg_script routines 2014-11-20 23:04:25 +00:00
reset.h vboot2: implement select_firmware for pre-romstage verification 2014-06-30 18:45:09 +00:00
rmodule-defs.h rmodules: add support for rmodtool 2014-03-31 22:25:57 +00:00
rmodule.h rmodules: add support for rmodtool 2014-03-31 22:25:57 +00:00
romstage_handoff.h Add predefined __ROMSTAGE__ and __RAMSTAGE__ macros 2014-10-02 07:02:23 +00:00
rtc.h rtc: Add an RTC API, and implement it for x86. 2014-05-02 23:55:47 +00:00
sdram_mode.h GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00
smbios.h smbios: add a family id in smbios type1 family 2014-09-19 02:59:43 +00:00
spd.h smbios: add funtion for smbios type17 2014-08-12 02:40:38 +00:00
spd_ddr2.h GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00
spi-generic.h spi: support controllers with limited transfer size capabilities 2014-12-03 05:03:05 +00:00
spi_flash.h spi: Remove unused parameters from spi_flash_probe and setup_spi_slave. 2014-04-01 23:21:22 +00:00
stddef.h stddef: Add KHz, MHz and GHz constants 2014-10-07 20:59:39 +00:00
stdlib.h exynos5420: Fix mmc clock source. 2013-08-22 16:03:17 -07:00
string.h BACKPORT: string: Add STRINGIFY macro 2013-05-01 14:29:58 -07:00
swab.h Add macros for 64bit byte order swapping 2011-10-21 14:13:19 +02:00
symbols.h memlayout: Add TIMESTAMP region 2014-11-04 21:34:36 +00:00
thread.h Possible thread stack implementation. 2013-08-23 10:38:10 -07:00
timer.h timer: remove rela_time type 2014-09-29 08:42:30 +00:00
timestamp.h broadwell_fsp: Add intel FSP "driver" from coreboot.org 2014-11-19 04:10:00 +00:00
tpm.h tpm: Clean up I2C TPM driver 2013-11-11 23:47:09 +00:00
trace.h GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00
types.h GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00
uart.h ipq8064: prepare include files before adding UART driver 2014-04-25 01:48:53 +00:00
uart8250.h UART 8250: Unconditionally provide register constants and use UART8250 prefix. 2013-10-02 09:18:38 +00:00
usb_ch9.h USB Debug Port related license header fixes (trivial). 2010-09-23 18:16:46 +00:00
usbdebug.h Drop prototype guarding for romcc 2013-05-10 11:55:20 -07:00
vbe.h Peppy graphics 2013-09-27 23:07:14 +00:00
version.h coreboot: Introduce stage-specific architecture for coreboot 2014-05-09 04:41:47 +00:00
watchdog.h watchdog.h: Fix compile time error on disabling watchdog handling 2013-03-12 12:06:43 +01:00