2 * generic K8 debug code, used by mainboard specific romstage.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(0, 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 <= 255; 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(0, 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_spd_registers(const struct mem_controller *ctrl)
76 for(i = 0; i < 4; i++) {
78 device = ctrl->channel0[i];
81 print_debug("dimm: ");
84 print_debug_hex8(device);
85 for(j = 0; j < 256; j++) {
93 status = smbus_read_byte(device, j);
95 print_debug("bad device\r\n");
99 print_debug_hex8(byte);
100 print_debug_char(' ');
105 device = ctrl->channel1[i];
108 print_debug("dimm: ");
111 print_debug_hex8(device);
112 for(j = 0; j < 256; j++) {
115 if ((j & 0xf) == 0) {
120 status = smbus_read_byte(device, j);
122 print_debug("bad device\r\n");
125 byte = status & 0xff;
126 print_debug_hex8(byte);
127 print_debug_char(' ');
134 static void dump_smbus_registers(void)
138 for(i = 1; i < 0x80; i++) {
142 print_debug("smbus: ");
143 print_debug_hex8(device);
144 for(j = 0; j < 256; j++) {
147 if ((j & 0xf) == 0) {
152 status = smbus_read_byte(device, j);
154 print_debug("bad device\r\n");
157 byte = status & 0xff;
158 print_debug_hex8(byte);
159 print_debug_char(' ');