2 * This code is derived from the Opteron boards' debug.c.
3 * It should go away either there or here, depending what fits better.
6 static void dump_spd_registers(const struct mem_controller
*ctrl
)
9 printk(BIOS_DEBUG
, "\n");
10 for (i
= 0; i
< 4; i
++) {
12 device
= ctrl
->channel0
[i
];
15 printk(BIOS_DEBUG
, "dimm: %02x.0: %02x", i
, device
);
16 for (j
= 0; j
< 256; j
++) {
18 unsigned int char byte
;
20 printk(BIOS_DEBUG
, "\n%02x: ", j
);
21 status
= spd_read_byte(device
, j
);
23 printk(BIOS_DEBUG
, "bad device\n");
27 printk(BIOS_DEBUG
, "%02x ", byte
);
29 printk(BIOS_DEBUG
, "\n");
31 device
= ctrl
->channel1
[i
];
34 printk(BIOS_DEBUG
, "dimm: %02x.1: %02x", i
, device
);
35 for (j
= 0; j
< 256; j
++) {
37 unsigned int char byte
;
39 printk(BIOS_DEBUG
, "\n%02x: ");
40 status
= spd_read_byte(device
, j
);
42 printk(BIOS_DEBUG
, "bad device\n");
46 printk(BIOS_DEBUG
, "%02x ", byte
);
48 printk(BIOS_DEBUG
, "\n");
54 void dump_spd_registers(void)
57 device
= SMBUS_MEM_DEVICE_START
;
58 printk(BIOS_DEBUG
, "\n");
59 while (device
<= SMBUS_MEM_DEVICE_END
) {
62 printk(BIOS_DEBUG
, "dimm %02x", device
);
63 for (i
= 0; (i
< 256) && (status
== 0); i
++) {
64 unsigned int char byte
;
66 printk(BIOS_DEBUG
, "\n%3d: ", i
);
67 status
= smbus_read_byte(device
, i
, &byte
);
69 printk(BIOS_DEBUG
, "bad device\n");
72 printk(BIOS_DEBUG
, "%02x ", byte
);
74 device
+= SMBUS_MEM_DEVICE_INC
;
75 printk(BIOS_DEBUG
, "\n");