diff options
author | Eric Biederman <ebiederm@xmission.com> | 2004-12-10 20:50:43 +0000 |
---|---|---|
committer | Eric Biederman <ebiederm@xmission.com> | 2004-12-10 20:50:43 +0000 |
commit | ec01aa98d0a12f857137c469b15226e30a625331 (patch) | |
tree | ca70536c9ca2ed705bdc1b71d0adadc91f88d79a /src/drivers/generic | |
parent | a7dd86970619976265c2cc167668fa11da07e139 (diff) |
- Fix the definition of the linuxbios table so all of the compilers
will generate the struct lb_memory_range the same.
- Add a few pci_ids.
- Small readabiltiy clean ups to debug_dev
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1818 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/drivers/generic')
-rw-r--r-- | src/drivers/generic/debug/debug_dev.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/drivers/generic/debug/debug_dev.c b/src/drivers/generic/debug/debug_dev.c index 56558e1938..8454051602 100644 --- a/src/drivers/generic/debug/debug_dev.c +++ b/src/drivers/generic/debug/debug_dev.c @@ -13,14 +13,14 @@ static void print_pci_regs(struct device *dev) int i; for(i=0;i<256;i++) { - byte = pci_read_config8(dev, i); + byte = pci_read_config8(dev, i); - if((i & 0xf)==0) printk_debug("\n%02x:",i); - printk_debug(" %02x",byte); + if((i & 0xf)==0) printk_debug("\n%02x:",i); + printk_debug(" %02x",byte); } printk_debug("\n"); - } + static void print_mem(void) { unsigned int i; @@ -35,27 +35,29 @@ static void print_mem(void) static void print_pci_regs_all(void) { struct device *dev; - unsigned char i,j,k; + unsigned char bus, device, function; - for(i=0;i<=15;i++) { - for(j=0;j<=0x1f;j++) { - for (k=0;k<=6;k++){ - dev = dev_find_slot(i, PCI_DEVFN(j, k)); + for(bus=0; bus<=256; bus++) { + for(device=0; device<=0x1f; device++) { + for (function=0; function<=7; function++){ + unsigned devfn; + devfn = PCI_DEVFN(device, function); + dev = dev_find_slot(bus, devfn); if(!dev) { continue; } if(!dev->enabled) { continue; } - printk_debug("\n%02x:%02x:%02x aka %s",i,j,k, dev_path(dev)); + printk_debug("\n%02x:%02x:%02x aka %s", + bus, device, function, dev_path(dev)); print_pci_regs(dev); } } } - } -static void print_msr() +static void print_cpuid() { msr_t msr; unsigned index; @@ -126,6 +128,8 @@ static void print_smbus_regs_all(struct device *dev) static void debug_init(device_t dev) { device_t parent; + if (!dev->enabled) + return; switch(dev->path.u.pnp.device) { #if CONFIG_CHIP_NAME case 0: @@ -146,7 +150,7 @@ static void debug_init(device_t dev) print_mem(); break; case 3: - print_msr(); + print_cpuid(); break; case 4: print_smbus_regs_all(&dev_root); |