Since some people disapprove of white space cleanups mixed in regular commits
[coreboot.git] / src / northbridge / intel / i440bx / debug.c
1
2 static void dump_spd_registers(void)
3 {
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 }
36
37 #if 0
38 void dump_spd_registers(void)
39 {
40         unsigned device;
41         device = SMBUS_MEM_DEVICE_START;
42         printk(BIOS_DEBUG, "\n");
43         while(device <= SMBUS_MEM_DEVICE_END) {
44                 int status = 0;
45                 int i;
46                 printk(BIOS_DEBUG, "dimm %02x", device);
47                 for(i = 0; (i < 256) && (status == 0); i++) {
48                         unsigned char byte;
49                         if ((i % 20) == 0) {
50                                 printk(BIOS_DEBUG, "\n%3d: ", i);
51                         }
52                         status = smbus_read_byte(device, i, &byte);
53                         if (status != 0) {
54                                 printk(BIOS_DEBUG, "bad device\n");
55                                 continue;
56                         }
57                         printk(BIOS_DEBUG, "%02x ", byte);
58                 }
59                 device += SMBUS_MEM_DEVICE_INC;
60                 printk(BIOS_DEBUG, "\n");
61         }
62 }
63 #endif