- Add support _framework_ for the Asus p2b.
[coreboot.git] / src / northbridge / intel / i440bx / debug.c
1
2 static void dump_spd_registers(const struct mem_controller *ctrl)
3 {
4         int i;
5         print_debug("\r\n");
6         for(i = 0; i < 4; i++) {
7                 unsigned device;
8                 device = ctrl->channel0[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("\r\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\r\n");
26                                         break;
27                                 }
28                                 byte = status & 0xff;
29                                 print_debug_hex8(byte);
30                                 print_debug_char(' ');
31                         }
32                         print_debug("\r\n");
33                 }
34 #if 0  /* Enable this if you have 2 memory channels */
35                 device = ctrl->channel1[i];
36                 if (device) {
37                         int j;
38                         print_debug("dimm: "); 
39                         print_debug_hex8(i); 
40                         print_debug(".1: ");
41                         print_debug_hex8(device);
42                         for(j = 0; j < 256; j++) {
43                                 int status;
44                                 unsigned char byte;
45                                 if ((j & 0xf) == 0) {
46                                         print_debug("\r\n");
47                                         print_debug_hex8(j);
48                                         print_debug(": ");
49                                 }
50                                 status = spd_read_byte(device, j);
51                                 if (status < 0) {
52                                         print_debug("bad device\r\n");
53                                         break;
54                                 }
55                                 byte = status & 0xff;
56                                 print_debug_hex8(byte);
57                                 print_debug_char(' ');
58                         }
59                         print_debug("\r\n");
60                 }
61 #endif          
62         }
63 }
64
65 #if 0
66 void dump_spd_registers(void)
67 {
68         unsigned device;
69         device = SMBUS_MEM_DEVICE_START;
70         printk_debug("\n");
71         while(device <= SMBUS_MEM_DEVICE_END) {
72                 int status = 0;
73                 int i;
74                 printk_debug("dimm %02x", device);
75                 for(i = 0; (i < 256) && (status == 0); i++) {
76                         unsigned char byte;
77                         if ((i % 20) == 0) {
78                                 printk_debug("\n%3d: ", i);
79                         }
80                         status = smbus_read_byte(device, i, &byte);
81                         if (status != 0) {
82                                 printk_debug("bad device\n");
83                                 continue;
84                         }
85                         printk_debug("%02x ", byte);
86                 }
87                 device += SMBUS_MEM_DEVICE_INC;
88                 printk_debug("\n");
89         }
90 }
91 #endif