(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

@ -20,7 +20,6 @@
#include <device/device.h>
extern const struct pci_bus_operations pci_cf8_conf1;
extern const struct pci_bus_operations pci_cf8_conf2;
#if defined(CONFIG_MMCONF_SUPPORT) && (CONFIG_MMCONF_SUPPORT==1)
extern const struct pci_bus_operations pci_ops_mmconf;

View file

@ -21,6 +21,7 @@
#include <shared.h> /* We share symbols from stage 0 */
#include <post_code.h>
#define BIOS_ALWAYS 0 /* log no matter what; not necessarily an error */
#define BIOS_EMERG 0 /* system is unusable */
#define BIOS_ALERT 1 /* action must be taken immediately */
#define BIOS_CRIT 2 /* critical conditions */

View file

@ -49,12 +49,13 @@ struct pci_operations {
/* Common pci bus operations */
struct pci_bus_operations {
u8 (*read8)(struct bus *pbus, int bus, int devfn, int where);
u16 (*read16)(struct bus *pbus, int bus, int devfn, int where);
u32 (*read32)(struct bus *pbus, int bus, int devfn, int where);
void (*write8)(struct bus *pbus, int bus, int devfn, int where, u8 val);
void (*write16)(struct bus *pbus, int bus, int devfn, int where, u16 val);
void (*write32)(struct bus *pbus, int bus, int devfn, int where, u32 val);
u8 (*read8)(u32 bdf, int where);
u16 (*read16)(u32 bdf, int where);
u32 (*read32)(u32 bdf, int where);
void (*write8)(u32 bdf, int where, u8 val);
void (*write16)(u32 bdf, int where, u16 val);
void (*write32)(u32 bdf, int where, u32 val);
int (*find)(u16 vendid, u16 devid, u32 *busdevfn);
};
struct pci_driver {

View file

@ -481,6 +481,8 @@
#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f)
#define PCI_FUNC(devfn) ((devfn) & 0x07)
#define PCI_BDF(bus,dev,func) ((bus) << 16 | (dev) << 11 | (func) << 8)
/* bus,devfn pairs are used many places as well */
#define PCI_BDEVFN(bus,devfn) ((bus) << 16 | (devfn) << 8)
#define PCI_ADDR(bus,dev,func,where) (PCI_BDF((bus),(dev),(func)) << 4 | (where & 0xfff))
#endif /* DEVICE_PCI_DEF_H */