2 * This file is part of the coreboot project.
4 * (C) 2007-2009 coresystems GmbH
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
22 static void print_debug_pci_dev(unsigned dev)
25 print_debug_hex8((dev >> 16) & 0xff);
26 print_debug_char(':');
27 print_debug_hex8((dev >> 11) & 0x1f);
28 print_debug_char('.');
29 print_debug_hex8((dev >> 8) & 7);
32 static inline void print_pci_devices(void)
35 for (dev = PCI_DEV(0, 0, 0);
36 dev <= PCI_DEV(0x00, 0x1f, 0x7); dev += PCI_DEV(0, 0, 1)) {
38 id = pci_read_config32(dev, PCI_VENDOR_ID);
39 if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff)
40 || (((id >> 16) & 0xffff) == 0xffff)
41 || (((id >> 16) & 0xffff) == 0x0000)) {
44 print_debug_pci_dev(dev);
49 static void dump_pci_device(unsigned dev)
52 print_debug_pci_dev(dev);
55 for (i = 0; i <= 255; i++) {
57 if ((i & 0x0f) == 0) {
59 print_debug_char(':');
61 val = pci_read_config8(dev, i);
62 print_debug_char(' ');
63 print_debug_hex8(val);
64 if ((i & 0x0f) == 0x0f) {
70 static inline void dump_pci_devices(void)
73 for (dev = PCI_DEV(0, 0, 0);
74 dev <= PCI_DEV(0, 0x1f, 0x7); dev += PCI_DEV(0, 0, 1)) {
76 id = pci_read_config32(dev, PCI_VENDOR_ID);
77 if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff)
78 || (((id >> 16) & 0xffff) == 0xffff)
79 || (((id >> 16) & 0xffff) == 0x0000)) {
87 static inline void dump_io_resources(unsigned port)
91 print_debug_hex16(port);
93 for (i = 0; i < 256; i++) {
95 if ((i & 0x0f) == 0) {
97 print_debug_char(':');
100 print_debug_char(' ');
101 print_debug_hex8(val);
102 if ((i & 0x0f) == 0x0f) {