summaryrefslogtreecommitdiff
path: root/src/include/console
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2020-04-21 16:03:53 -0700
committerJulius Werner <jwerner@chromium.org>2020-04-23 01:21:56 +0000
commit21a4053fde87801b42a0de39d5b6536c1ed4b475 (patch)
treea2cd4a48dbd4a2512c7e8e9c9e2a2b74e78aa98d /src/include/console
parentd9f26edfec760ff81f88f164fc0e601fe8e20e3e (diff)
rules.h: Rename ENV_VERSTAGE to ENV_SEPARATE_VERSTAGE
When CONFIG_SEPARATE_VERSTAGE=n, all verstage code gets linked into the appropriate calling stage (bootblock or romstage). This means that ENV_VERSTAGE is actually 0, and instead ENV_BOOTBLOCK or ENV_ROMSTAGE are 1. This keeps tripping up people who are just trying to write a simple "are we in verstage (i.e. wherever the vboot init logic runs)" check, e.g. for TPM init functions which may run in "verstage" or ramstage depending on whether vboot is enabled. Those checks will not work as intended for CONFIG_SEPARATE_VERSTAGE=n. This patch renames ENV_VERSTAGE to ENV_SEPARATE_VERSTAGE to try to clarify that this macro can really only be used to check whether code is running in a *separate* verstage, and clue people in that they may need to cover the linked-in verstage case as well. Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: I2ff3a3c3513b3db44b3cff3d93398330cd3632ea Reviewed-on: https://review.coreboot.org/c/coreboot/+/40582 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/include/console')
-rw-r--r--src/include/console/cbmem_console.h4
-rw-r--r--src/include/console/console.h6
-rw-r--r--src/include/console/uart.h4
-rw-r--r--src/include/console/usb.h2
4 files changed, 8 insertions, 8 deletions
diff --git a/src/include/console/cbmem_console.h b/src/include/console/cbmem_console.h
index a291db862d..2996f7c862 100644
--- a/src/include/console/cbmem_console.h
+++ b/src/include/console/cbmem_console.h
@@ -9,8 +9,8 @@ void cbmemc_init(void);
void cbmemc_tx_byte(unsigned char data);
#define __CBMEM_CONSOLE_ENABLE__ (CONFIG(CONSOLE_CBMEM) && \
- (ENV_RAMSTAGE || ENV_VERSTAGE || ENV_POSTCAR || ENV_ROMSTAGE || \
- (ENV_BOOTBLOCK && CONFIG(BOOTBLOCK_CONSOLE))))
+ (ENV_RAMSTAGE || ENV_SEPARATE_VERSTAGE || ENV_POSTCAR || \
+ ENV_ROMSTAGE || (ENV_BOOTBLOCK && CONFIG(BOOTBLOCK_CONSOLE))))
#if __CBMEM_CONSOLE_ENABLE__
static inline void __cbmemc_init(void) { cbmemc_init(); }
diff --git a/src/include/console/console.h b/src/include/console/console.h
index fdc48da73f..be06c66b58 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -31,9 +31,9 @@ void die_notify(void);
#define __CONSOLE_ENABLE__ \
((ENV_BOOTBLOCK && CONFIG(BOOTBLOCK_CONSOLE)) || \
- (ENV_POSTCAR && CONFIG(POSTCAR_CONSOLE)) || \
- ENV_VERSTAGE || ENV_ROMSTAGE || ENV_RAMSTAGE || ENV_LIBAGESA || \
- (ENV_SMM && CONFIG(DEBUG_SMI)))
+ (ENV_POSTCAR && CONFIG(POSTCAR_CONSOLE)) || \
+ ENV_SEPARATE_VERSTAGE || ENV_ROMSTAGE || ENV_RAMSTAGE || \
+ ENV_LIBAGESA || (ENV_SMM && CONFIG(DEBUG_SMI)))
#if __CONSOLE_ENABLE__
asmlinkage void console_init(void);
diff --git a/src/include/console/uart.h b/src/include/console/uart.h
index 1bd6ef0f6e..d423d9d681 100644
--- a/src/include/console/uart.h
+++ b/src/include/console/uart.h
@@ -51,8 +51,8 @@ static inline void *uart_platform_baseptr(int idx)
void oxford_remap(unsigned int new_base);
#define __CONSOLE_SERIAL_ENABLE__ (CONFIG(CONSOLE_SERIAL) && \
- (ENV_BOOTBLOCK || ENV_ROMSTAGE || ENV_RAMSTAGE || ENV_VERSTAGE || \
- ENV_POSTCAR || (ENV_SMM && CONFIG(DEBUG_SMI))))
+ (ENV_BOOTBLOCK || ENV_ROMSTAGE || ENV_RAMSTAGE || ENV_SEPARATE_VERSTAGE \
+ || ENV_POSTCAR || (ENV_SMM && CONFIG(DEBUG_SMI))))
#if __CONSOLE_SERIAL_ENABLE__
static inline void __uart_init(void)
diff --git a/src/include/console/usb.h b/src/include/console/usb.h
index b7bc7f4a6e..e67f125c88 100644
--- a/src/include/console/usb.h
+++ b/src/include/console/usb.h
@@ -18,7 +18,7 @@ int usb_can_rx_byte(int idx);
((ENV_BOOTBLOCK && CONFIG(USBDEBUG_IN_PRE_RAM)) || \
(ENV_ROMSTAGE && CONFIG(USBDEBUG_IN_PRE_RAM)) || \
(ENV_POSTCAR && CONFIG(USBDEBUG_IN_PRE_RAM)) || \
- (ENV_VERSTAGE && CONFIG(USBDEBUG_IN_PRE_RAM)) || \
+ (ENV_SEPARATE_VERSTAGE && CONFIG(USBDEBUG_IN_PRE_RAM)) || \
ENV_RAMSTAGE))
#define USB_PIPE_FOR_CONSOLE 0