2 * generic K8 debug code, used by mainboard specific auto.c
6 static void print_debug_pci_dev(unsigned dev)
9 print_debug_hex8((dev >> 16) & 0xff);
10 print_debug_char(':');
11 print_debug_hex8((dev >> 11) & 0x1f);
12 print_debug_char('.');
13 print_debug_hex8((dev >> 8) & 7);
16 static void print_pci_devices(void)
19 for(dev = PCI_DEV(0, 0, 0);
20 dev <= PCI_DEV(0xff, 0x1f, 0x7);
21 dev += PCI_DEV(0,0,1)) {
23 id = pci_read_config32(dev, PCI_VENDOR_ID);
24 if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff) ||
25 (((id >> 16) & 0xffff) == 0xffff) ||
26 (((id >> 16) & 0xffff) == 0x0000)) {
29 print_debug_pci_dev(dev);
34 static void dump_pci_device(unsigned dev)
37 print_debug_pci_dev(dev);
40 for(i = 0; i < 256; i++) {
42 if ((i & 0x0f) == 0) {
44 print_debug_char(':');
46 val = pci_read_config8(dev, i);
47 print_debug_char(' ');
48 print_debug_hex8(val);
49 if ((i & 0x0f) == 0x0f) {
55 static void dump_pci_devices(void)
58 for(dev = PCI_DEV(0, 0, 0);
59 dev <= PCI_DEV(0xff, 0x1f, 0x7);
60 dev += PCI_DEV(0,0,1)) {
62 id = pci_read_config32(dev, PCI_VENDOR_ID);
63 if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff) ||
64 (((id >> 16) & 0xffff) == 0xffff) ||
65 (((id >> 16) & 0xffff) == 0x0000)) {
72 static void dump_pci_devices_on_bus(unsigned busn)
75 for(dev = PCI_DEV(busn, 0, 0);
76 dev <= PCI_DEV(busn, 0x1f, 0x7);
77 dev += PCI_DEV(0,0,1)) {
79 id = pci_read_config32(dev, PCI_VENDOR_ID);
80 if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff) ||
81 (((id >> 16) & 0xffff) == 0xffff) ||
82 (((id >> 16) & 0xffff) == 0x0000)) {
89 static void dump_spd_registers(const struct mem_controller *ctrl)
93 for(i = 0; i < 4; i++) {
95 device = ctrl->channel0[i];
98 print_debug("dimm: ");
101 print_debug_hex8(device);
102 for(j = 0; j < 128; j++) {
105 if ((j & 0xf) == 0) {
110 status = smbus_read_byte(device, j);
114 byte = status & 0xff;
115 print_debug_hex8(byte);
116 print_debug_char(' ');
120 device = ctrl->channel1[i];
123 print_debug("dimm: ");
126 print_debug_hex8(device);
127 for(j = 0; j < 128; j++) {
130 if ((j & 0xf) == 0) {
135 status = smbus_read_byte(device, j);
139 byte = status & 0xff;
140 print_debug_hex8(byte);
141 print_debug_char(' ');
147 static void dump_smbus_registers(void)
151 for(device = 1; device < 0x80; device++) {
153 if( smbus_read_byte(device, 0) < 0 ) continue;
154 print_debug("smbus: ");
155 print_debug_hex8(device);
156 for(j = 0; j < 256; j++) {
159 status = smbus_read_byte(device, j);
163 if ((j & 0xf) == 0) {
168 byte = status & 0xff;
169 print_debug_hex8(byte);
170 print_debug_char(' ');
176 static void dump_io_resources(unsigned port)
181 print_debug_hex16(port);
182 print_debug(":\r\n");
185 if ((i & 0x0f) == 0) {
187 print_debug_char(':');
190 print_debug_char(' ');
191 print_debug_hex8(val);
192 if ((i & 0x0f) == 0x0f) {