From b73d61a5565c3ab9e207a288186049806ce13e1b Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 4 Nov 2020 09:59:13 -0700 Subject: [PATCH] x86: zimage: Add a little more logging Add logging for each part of the boot process, using a new Signed-off-by: Simon Glass Reviewed-by: Bin Meng Reviewed-by: Igor Opaniuk --- arch/x86/lib/zimage.c | 6 ++++++ common/log.c | 1 + include/log.h | 1 + 3 files changed, 8 insertions(+) diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index a00964cc8d..7418c9a5fe 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -12,10 +12,13 @@ * linux/Documentation/i386/boot.txt */ +#define LOG_CATEGORY LOGC_BOOT + #include #include #include #include +#include #include #include #include @@ -292,6 +295,7 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, struct setup_header *hdr = &setup_base->hdr; int bootproto = get_boot_protocol(hdr, false); + log_debug("Setup E820 entries\n"); setup_base->e820_entries = install_e820_map( ARRAY_SIZE(setup_base->e820_map), setup_base->e820_map); @@ -317,6 +321,7 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, } if (cmd_line) { + log_debug("Setup cmdline\n"); if (bootproto >= 0x0202) { hdr->cmd_line_ptr = (uintptr_t)cmd_line; } else if (bootproto >= 0x0200) { @@ -340,6 +345,7 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, if (IS_ENABLED(CONFIG_GENERATE_ACPI_TABLE)) setup_base->acpi_rsdp_addr = acpi_get_rsdp_addr(); + log_debug("Setup devicetree\n"); setup_device_tree(hdr, (const void *)env_get_hex("fdtaddr", 0)); setup_video(&setup_base->screen_info); diff --git a/common/log.c b/common/log.c index 4b6f3fcd04..ce39918e04 100644 --- a/common/log.c +++ b/common/log.c @@ -26,6 +26,7 @@ static const char *const log_cat_name[] = { "bloblist", "devres", "acpi", + "boot", }; _Static_assert(ARRAY_SIZE(log_cat_name) == LOGC_COUNT - LOGC_NONE, diff --git a/include/log.h b/include/log.h index 4d0692f155..29f18a82dc 100644 --- a/include/log.h +++ b/include/log.h @@ -96,6 +96,7 @@ enum log_category_t { LOGC_DEVRES, /** @LOGC_ACPI: Advanced Configuration and Power Interface (ACPI) */ LOGC_ACPI, + LOGC_BOOT, /* Related to boot process / boot image processing */ /** @LOGC_COUNT: Number of log categories */ LOGC_COUNT, -- 2.39.5