include/console: Add CFR object for setting the logging level

Add a header with a CFR object for setting the coreboot console log
level, so that all mainboards can make use of it without duplication.

Change-Id: I473421e0e6b2031eb9846f5a798b427104dc3af3
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87487
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
This commit is contained in:
Matt DeVillier 2025-04-20 18:11:24 -05:00
commit 1166f9be0d

30
src/include/console/cfr.h Normal file
View file

@ -0,0 +1,30 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* CFR enums and structs for console
*/
#ifndef _CONSOLE_CFR_H_
#define _CONSOLE_CFR_H_
#include <drivers/option/cfr_frontend.h>
const struct sm_object debug_level = SM_DECLARE_ENUM({
.opt_name = "debug_level",
.ui_name = "Console Log Level",
.ui_helptext = "Set the verbosity of the coreboot console output.",
.default_value = CONFIG_DEFAULT_CONSOLE_LOGLEVEL,
.values = (const struct sm_enum_value[]) {
{ "Emergency", 0 },
{ "Alert", 1 },
{ "Critical", 2 },
{ "Error", 3 },
{ "Warning", 4 },
{ "Notice", 5 },
{ "Info", 6 },
{ "Debug", 7 },
{ "Spew", 8 },
SM_ENUM_VALUE_END },
});
#endif /* _CONSOLE_CFR_H_ */