6f253bd9412a75190ad0944095fd32022a3f13f1
[coreboot.git] / src / northbridge / intel / i440bx / debug.c
1 static void dump_spd_registers(void)
2 {
3 #if CONFIG_DEBUG_RAM_SETUP
4         int i;
5         print_debug("\n");
6         for(i = 0; i < DIMM_SOCKETS; i++) {
7                 unsigned device;
8                 device = DIMM_SPD_BASE + i;
9                 if (device) {
10                         int j;
11                         print_debug("dimm: ");
12                         print_debug_hex8(i);
13                         print_debug(".0: ");
14                         print_debug_hex8(device);
15                         for(j = 0; j < 256; j++) {
16                                 int status;
17                                 unsigned char byte;
18                                 if ((j & 0xf) == 0) {
19                                         print_debug("\n");
20                                         print_debug_hex8(j);
21                                         print_debug(": ");
22                                 }
23                                 status = spd_read_byte(device, j);
24                                 if (status < 0) {
25                                         print_debug("bad device\n");
26                                         break;
27                                 }
28                                 byte = status & 0xff;
29                                 print_debug_hex8(byte);
30                                 print_debug_char(' ');
31                         }
32                         print_debug("\n");
33                 }
34         }
35 #endif
36 }
37
38 #if 0
39 void dump_spd_registers(void)
40 {
41         unsigned device;
42         device = SMBUS_MEM_DEVICE_START;
43         printk(BIOS_DEBUG, "\n");
44         while(device <= SMBUS_MEM_DEVICE_END) {
45                 int status = 0;
46                 int i;
47                 printk(BIOS_DEBUG, "dimm %02x", device);
48                 for(i = 0; (i < 256) && (status == 0); i++) {
49                         unsigned char byte;
50                         if ((i % 20) == 0) {
51                                 printk(BIOS_DEBUG, "\n%3d: ", i);
52                         }
53                         status = smbus_read_byte(device, i, &byte);
54                         if (status != 0) {
55                                 printk(BIOS_DEBUG, "bad device\n");
56                                 continue;
57                         }
58                         printk(BIOS_DEBUG, "%02x ", byte);
59                 }
60                 device += SMBUS_MEM_DEVICE_INC;
61                 printk(BIOS_DEBUG, "\n");
62         }
63 }
64 #endif