console: Add compile-time fast path when only CBMEM console is used

A common use case when running coreboot on production systems is that
only the CBMEM console (the one with the least impact on boot speed) is
enabled. In this case, some of the code in the console subsystem has no
effect. Due to the way it's all genericized over multiple consoles and
tied together with function pointers, not all of this can be
compile-time eliminated automatically, so this patch adds a little
helper to facilitate that. This results in roughly 200 (compressed)
bytes of savings per stage on an arm64 system.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: I1d5b8bda80d02a13ee0b7835e0805c4319fd21d8
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61613
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
This commit is contained in:
Julius Werner
2022-02-03 17:25:44 -08:00
parent 984d03c492
commit 266041f0e6
3 changed files with 19 additions and 4 deletions

View File

@ -11,6 +11,8 @@
#include <console/flash.h>
#include <console/system76_ec.h>
/* Note: when adding a new console, make sure you update the definition of
HAS_ONLY_FAST_CONSOLES in <console.h>! */
void console_hw_init(void)
{
__cbmemc_init();