arch/x86/gdt: Correct format of multi-line comment
[coreboot.git] / src / lib / generic_dump_spd.c
blob63e47a2d28147efd5e55750cf178da0affe4d2b2
1 /*
2 * This code is derived from the Opteron boards' debug.c.
3 * It should go away either there or here, depending what fits better.
4 */
6 static void dump_spd_registers(const struct mem_controller *ctrl)
8 int i;
9 printk(BIOS_DEBUG, "\n");
10 for (i = 0; i < 4; i++) {
11 unsigned int device;
12 device = ctrl->channel0[i];
13 if (device) {
14 int j;
15 printk(BIOS_DEBUG, "dimm: %02x.0: %02x", i, device);
16 for (j = 0; j < 256; j++) {
17 int status;
18 unsigned int char byte;
19 if ((j & 0xf) == 0)
20 printk(BIOS_DEBUG, "\n%02x: ", j);
21 status = spd_read_byte(device, j);
22 if (status < 0) {
23 printk(BIOS_DEBUG, "bad device\n");
24 break;
26 byte = status & 0xff;
27 printk(BIOS_DEBUG, "%02x ", byte);
29 printk(BIOS_DEBUG, "\n");
31 device = ctrl->channel1[i];
32 if (device) {
33 int j;
34 printk(BIOS_DEBUG, "dimm: %02x.1: %02x", i, device);
35 for (j = 0; j < 256; j++) {
36 int status;
37 unsigned int char byte;
38 if ((j & 0xf) == 0)
39 printk(BIOS_DEBUG, "\n%02x: ");
40 status = spd_read_byte(device, j);
41 if (status < 0) {
42 printk(BIOS_DEBUG, "bad device\n");
43 break;
45 byte = status & 0xff;
46 printk(BIOS_DEBUG, "%02x ", byte);
48 printk(BIOS_DEBUG, "\n");
53 #if 0
54 void dump_spd_registers(void)
56 unsigned int device;
57 device = SMBUS_MEM_DEVICE_START;
58 printk(BIOS_DEBUG, "\n");
59 while (device <= SMBUS_MEM_DEVICE_END) {
60 int status = 0;
61 int i;
62 printk(BIOS_DEBUG, "dimm %02x", device);
63 for (i = 0; (i < 256) && (status == 0); i++) {
64 unsigned int char byte;
65 if ((i % 20) == 0)
66 printk(BIOS_DEBUG, "\n%3d: ", i);
67 status = smbus_read_byte(device, i, &byte);
68 if (status != 0) {
69 printk(BIOS_DEBUG, "bad device\n");
70 continue;
72 printk(BIOS_DEBUG, "%02x ", byte);
74 device += SMBUS_MEM_DEVICE_INC;
75 printk(BIOS_DEBUG, "\n");
78 #endif