Attention is currently required from: Nico Huber, Subrata Banik, Tim Wawrzynczak, EricR Lai. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/60470 )
Change subject: console: Create helper function to get max console log level ......................................................................
Patch Set 3:
(1 comment)
File src/console/init.c:
https://review.coreboot.org/c/coreboot/+/60470/comment/8e6a7e4c_2d7fbe03 PS2, Line 55: return get_log_level();
Initially I had the same understanding as well but later I realised that `get_log_level()` will return always Kconfig value irrespective of the console level. For example: irrespective of console type (CONSOLE_LOG_FAST), it will alway return '8' (BIOS_SPEW).
The idea behind `CONSOLE_LOG_FAST` is to log up to BIOS_DEBUG in CBMEM, even if the chosen log level is lower. This is because CBMEM is fast (it's just writing to CAR/RAM) compared to other consoles, e.g. serial, usbdebug, flashconsole...
Note that `get_max_console_log_level(CONSOLE_LOG_FAST)` can only return `BIOS_DEBUG` or `-1` depending on whether `CONFIG(CBMEM)` is true or false. I'm not sure if this is very useful.
Note that `get_log_level()` can also return the value from the `debug_level` CMOS option, or `get_console_loglevel()` if `CONSOLE_OVERRIDE_LOGLEVEL` is selected.
Will also let Nico to share his thoughts as he suggested to create console level to msg level function at the first place.
Sure!