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