Add constants for fast path resume copying
[coreboot.git] / src / northbridge / intel / i82810 / debug.c
1 #include <console/console.h>
2 #include <arch/io.h>
3 #include <arch/romcc_io.h>
4 #include <spd.h>
5 #include "i82810.h"
6 #include "raminit.h"
7
8 #if CONFIG_DEBUG_RAM_SETUP
9 void dump_spd_registers(void)
10 {
11         int i;
12         print_debug("\n");
13         for(i = 0; i < DIMM_SOCKETS; i++) {
14                 unsigned device;
15                 device = DIMM0 + i;
16                 if (device) {
17                         int j;
18                         print_debug("dimm: ");
19                         print_debug_hex8(i);
20                         print_debug(".0: ");
21                         print_debug_hex8(device);
22                         for(j = 0; j < 256; j++) {
23                                 int status;
24                                 unsigned char byte;
25                                 if ((j & 0xf) == 0) {
26                                         print_debug("\n");
27                                         print_debug_hex8(j);
28                                         print_debug(": ");
29                                 }
30                                 status = smbus_read_byte(device, j);
31                                 if (status < 0) {
32                                         print_debug("bad device\n");
33                                         break;
34                                 }
35                                 byte = status & 0xff;
36                                 print_debug_hex8(byte);
37                                 print_debug_char(' ');
38                         }
39                         print_debug("\n");
40                 }
41         }
42 }
43
44 static void print_debug_pci_dev(unsigned dev)
45 {
46         print_debug("PCI: ");
47         print_debug_hex8((dev >> 16) & 0xff);
48         print_debug_char(':');
49         print_debug_hex8((dev >> 11) & 0x1f);
50         print_debug_char('.');
51         print_debug_hex8((dev >> 8) & 7);
52 }
53
54 void dump_pci_device(unsigned dev)
55 {
56         int i;
57         print_debug_pci_dev(dev);
58         print_debug("\n");
59
60         for (i = 0; i <= 255; i++) {
61                 unsigned char val;
62                 if ((i & 0x0f) == 0) {
63                         print_debug_hex8(i);
64                         print_debug_char(':');
65                 }
66                 val = pci_read_config8(dev, i);
67                 print_debug_char(' ');
68                 print_debug_hex8(val);
69                 if ((i & 0x0f) == 0x0f) {
70                         print_debug("\n");
71                 }
72         }
73 }
74 #endif