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