Allow to build romstage sources inside the bootblock

Having a separate romstage is only desirable:
 - with advanced setups like vboot or normal/fallback
 - boot medium is slow at startup (some ARM SOCs)
 - bootblock is limited in size (Intel APL 32K)

When this is not the case there is no need for the extra complexity
that romstage brings. Including the romstage sources inside the
bootblock substantially reduces the total code footprint. Often the
resulting code is 10-20k smaller.

This is controlled via a Kconfig option.

TESTED: works on qemu x86, arm and aarch64 with and without VBOOT.

Change-Id: Id68390edc1ba228b121cca89b80c64a92553e284
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55068
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
Arthur Heymans 2021-05-29 08:10:49 +02:00 committed by Felix Held
commit a2bc2540c2
46 changed files with 118 additions and 66 deletions

View file

@ -42,7 +42,7 @@ void nc_fpga_post(uint8_t value)
/* The function pci_early_device_probe is called in bootblock and romstage. Make sure
that in these stages the initialization code was successful before the POST code
value is written to the register. */
if ((ENV_BOOTBLOCK || ENV_ROMSTAGE) && nc_fpga_present == false)
if ((ENV_BOOTBLOCK || ENV_SEPARATE_ROMSTAGE) && nc_fpga_present == false)
return;
write32p(fpga_bar + NC_FPGA_POST_OFFSET, value);
}

View file

@ -53,7 +53,7 @@ static inline struct ehci_debug_info *dbgp_ehci_info(void)
{
if (glob_dbg_info_p == NULL) {
struct ehci_debug_info *info;
if (ENV_BOOTBLOCK || ENV_SEPARATE_VERSTAGE || ENV_ROMSTAGE) {
if (ENV_BOOTBLOCK || ENV_SEPARATE_VERSTAGE || ENV_SEPARATE_ROMSTAGE) {
/* The message likely does not show if we hit this. */
if (sizeof(*info) > _car_ehci_dbg_info_size)
die("BUG: Increase ehci_dbg_info reserve in CAR");
@ -730,7 +730,7 @@ void usbdebug_init(void)
* from CBMEM.
*/
if (CONFIG(USBDEBUG_IN_PRE_RAM)
&& (ENV_ROMSTAGE || ENV_BOOTBLOCK))
&& (ENV_SEPARATE_ROMSTAGE || ENV_BOOTBLOCK))
usbdebug_hw_init(false);
/* USB console init is done early in ramstage if it was