Tim Wawrzynczak has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31649
Change subject: console: Add timestamp prints to boot stages. ......................................................................
console: Add timestamp prints to boot stages.
When a new bootstage starts, if it has console support and the RTC enabled, the current RTC timestamp will be printed.
Change-Id: I27676ceac8bccc56ac3d775915f217c8b3c47f4d Signed-off-by: Tim Wawrzynczak twawrzynczak@chromium.org --- M src/console/init.c M src/drivers/pc80/rtc/Makefile.inc M src/lib/Makefile.inc 3 files changed, 30 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/31649/1
diff --git a/src/console/init.c b/src/console/init.c index 7d1f31a..630478a 100644 --- a/src/console/init.c +++ b/src/console/init.c @@ -21,6 +21,7 @@ #include <device/pci.h> #include <option.h> #include <version.h> +#include <rtc.h>
/* Mutable console log level only allowed when RAM comes online. */ #if defined(__PRE_RAM__) @@ -84,4 +85,10 @@ printk(BIOS_NOTICE, "\n\ncoreboot-%s%s %s " ENV_STRING " starting (log level: %i)...\n", coreboot_version, coreboot_extra_version, coreboot_build, get_log_level()); + +#if IS_ENABLED(CONFIG_RTC) + struct rtc_time tm; + if (!rtc_get(&tm)) + rtc_display(&tm); +#endif } diff --git a/src/drivers/pc80/rtc/Makefile.inc b/src/drivers/pc80/rtc/Makefile.inc index 998b7e7..9047536 100644 --- a/src/drivers/pc80/rtc/Makefile.inc +++ b/src/drivers/pc80/rtc/Makefile.inc @@ -7,6 +7,14 @@ ramstage-$(CONFIG_DRIVERS_MC146818) += mc146818rtc.c smm-$(CONFIG_DRIVERS_MC146818) += mc146818rtc.c
+bootblock-$(CONFIG_RTC) += mc146818rtc_boot.c +bootblock-$(CONFIG_RTC) += mc146818rtc.c +postcar-$(CONFIG_RTC) += mc146818rtc.c +romstage-$(CONFIG_RTC) += mc146818rtc.c +ramstage-$(CONFIG_RTC) += mc146818rtc.c +smm-$(CONFIG_RTC) += mc146818rtc.c +verstage-$(CONFIG_RTC) += mc146818rtc.c + ifeq ($(CONFIG_USE_OPTION_TABLE),y) cbfs-files-$(CONFIG_HAVE_CMOS_DEFAULT) += cmos.default cmos.default-file = $(CONFIG_CMOS_DEFAULT_FILE):nvramtool diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index fa1ff8b..86a17b2 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -36,6 +36,10 @@ bootblock-y += bootblock.c endif
+ifeq ($(CONFIG_BOOTBLOCK_CONSOLE),y) +bootblock-$(CONFIG_RTC) += rtc.c +endif + bootblock-y += prog_loaders.c bootblock-y += prog_ops.c bootblock-y += cbfs.c @@ -66,6 +70,7 @@
verstage-$(CONFIG_GENERIC_UDELAY) += timer.c verstage-$(CONFIG_GENERIC_GPIO_LIB) += gpio.c +verstage-$(CONFIG_RTC) += rtc.c
romstage-y += prog_loaders.c romstage-y += prog_ops.c @@ -109,6 +114,8 @@
romstage-$(CONFIG_GENERIC_UDELAY) += timer.c
+romstage-$(CONFIG_RTC) += rtc.c + ramstage-y += prog_loaders.c ramstage-y += prog_ops.c ramstage-y += hardwaremain.c @@ -165,6 +172,10 @@ postcar-y += imd.c postcar-y += romstage_handoff.c
+ifeq ($(CONFIG_POSTCAR_CONSOLE),y) +postcar-$(CONFIG_RTC) += rtc.c +endif + bootblock-y += hexdump.c ramstage-y += hexdump.c romstage-y += hexdump.c @@ -196,6 +207,10 @@ smm-y += cbfs.c memcmp.c smm-$(CONFIG_GENERIC_UDELAY) += timer.c
+ifeq ($(CONFIG_DEBUG_SMI),y) +smm-$(CONFIG_RTC) += rtc.c +endif + bootblock-y += version.c romstage-y += version.c ramstage-y += version.c