(1)we now compile in all printks, which is good: we can print any message provided we can change
the console log level at any time. 
(2) The console log level is compiled in and unchangeable, which is bad, as it defeats the purpose of (1).

Add a BIOS_ALWAYS log level. Make console log level a variable. Make functions that set it and get it
visible everywhere. Always print out the version message; this is really *not* noise!

PCI: Simplify pci functions so that they can be used in stage1 or anywhere for that matter. Add
a find function which is needed for many stage1 functions. Note that we copy but also clean up
the libpayload stuff just a bit. 

Get rid of config space type 2. If there was ever a platform that used it, I don't know what it was, 
and the presence is a needless distraction. 

tested and working on DBE62 (which means the console and the pci functions work :-).

There is a remaining problem with dumplxmsrs which nobody understands. It prints out garbage if we use the 
%s for the msr names. 

Formatting is an issue; if somebody wants to fix formatting they can assume I will ack it. Sorry, 
my emacs has gone just nuts. 

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Peter Stuge <peter@stuge.se>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@729 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
Ronald G. Minnich 2008-08-09 21:03:57 +00:00
commit 649c9f99ff
12 changed files with 176 additions and 142 deletions

View file

@ -8,9 +8,30 @@
int vtxprintf(void (*)(unsigned char, void *arg),
void *arg, const char *, va_list);
static int console_loglevel(void)
static unsigned int loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
/**
* set the console log level
* There are no invalid settings, although there are ones that
* do not make much sense.
*
* @param level The new level
*/
void set_loglevel(unsigned int level) {
if (level > BIOS_SPEW)
printk(BIOS_ALWAYS, "Warning: ridiculous log level setting: %d (max %d)\n",
level, BIOS_SPEW);
loglevel = level;
}
/**
* get the console log level
*
* @return The level
*/
static unsigned int console_loglevel(void)
{
return CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
return loglevel;
}
#ifdef CONFIG_CONSOLE_BUFFER
@ -150,9 +171,9 @@ void console_init(void)
COREBOOT_EXTRA_VERSION
" "
COREBOOT_BUILD
" starting...\n";
" starting... (console_loglevel=%d)\n";
printk(BIOS_INFO, console_test);
printk(BIOS_ALWAYS, console_test, console_loglevel());
}
/**