2003-10-07 16:56:48 +02:00
|
|
|
/*
|
|
|
|
* This code is derived from the Opteron boards' debug.c.
|
|
|
|
* It should go away either there or here, depending what fits better.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void dump_spd_registers(const struct mem_controller *ctrl)
|
|
|
|
{
|
|
|
|
int i;
|
2015-01-05 22:12:38 +01:00
|
|
|
printk(BIOS_DEBUG, "\n");
|
2003-10-07 16:56:48 +02:00
|
|
|
for(i = 0; i < 4; i++) {
|
|
|
|
unsigned device;
|
|
|
|
device = ctrl->channel0[i];
|
|
|
|
if (device) {
|
|
|
|
int j;
|
2015-01-05 22:12:38 +01:00
|
|
|
printk(BIOS_DEBUG, "dimm: %02x.0: %02x", i, device);
|
2003-10-07 16:56:48 +02:00
|
|
|
for(j = 0; j < 256; j++) {
|
|
|
|
int status;
|
|
|
|
unsigned char byte;
|
2015-01-05 22:12:38 +01:00
|
|
|
if ((j & 0xf) == 0)
|
|
|
|
printk(BIOS_DEBUG, "\n%02x: ", j);
|
2003-10-07 16:56:48 +02:00
|
|
|
status = spd_read_byte(device, j);
|
|
|
|
if (status < 0) {
|
2015-01-05 22:12:38 +01:00
|
|
|
printk(BIOS_DEBUG, "bad device\n");
|
2003-10-07 16:56:48 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
byte = status & 0xff;
|
2015-01-05 22:12:38 +01:00
|
|
|
printk(BIOS_DEBUG, "%02x ", byte);
|
2003-10-07 16:56:48 +02:00
|
|
|
}
|
2015-01-05 22:12:38 +01:00
|
|
|
printk(BIOS_DEBUG, "\n");
|
2003-10-07 16:56:48 +02:00
|
|
|
}
|
|
|
|
device = ctrl->channel1[i];
|
|
|
|
if (device) {
|
|
|
|
int j;
|
2015-01-05 22:12:38 +01:00
|
|
|
printk(BIOS_DEBUG, "dimm: %02x.1: %02x", i, device);
|
2003-10-07 16:56:48 +02:00
|
|
|
for(j = 0; j < 256; j++) {
|
|
|
|
int status;
|
|
|
|
unsigned char byte;
|
2015-01-05 22:12:38 +01:00
|
|
|
if ((j & 0xf) == 0)
|
|
|
|
printk(BIOS_DEBUG, "\n%02x: ");
|
2003-10-07 16:56:48 +02:00
|
|
|
status = spd_read_byte(device, j);
|
|
|
|
if (status < 0) {
|
2015-01-05 22:12:38 +01:00
|
|
|
printk(BIOS_DEBUG, "bad device\n");
|
2003-10-07 16:56:48 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
byte = status & 0xff;
|
2015-01-05 22:12:38 +01:00
|
|
|
printk(BIOS_DEBUG, "%02x ", byte);
|
2003-10-07 16:56:48 +02:00
|
|
|
}
|
2015-01-05 22:12:38 +01:00
|
|
|
printk(BIOS_DEBUG, "\n");
|
2003-10-07 16:56:48 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#if 0
|
2003-04-22 21:02:15 +02:00
|
|
|
void dump_spd_registers(void)
|
|
|
|
{
|
|
|
|
unsigned device;
|
|
|
|
device = SMBUS_MEM_DEVICE_START;
|
2010-03-22 12:42:32 +01:00
|
|
|
printk(BIOS_DEBUG, "\n");
|
2003-04-22 21:02:15 +02:00
|
|
|
while(device <= SMBUS_MEM_DEVICE_END) {
|
|
|
|
int status = 0;
|
|
|
|
int i;
|
2010-03-22 12:42:32 +01:00
|
|
|
printk(BIOS_DEBUG, "dimm %02x", device);
|
2003-04-22 21:02:15 +02:00
|
|
|
for(i = 0; (i < 256) && (status == 0); i++) {
|
|
|
|
unsigned char byte;
|
|
|
|
if ((i % 20) == 0) {
|
2010-03-22 12:42:32 +01:00
|
|
|
printk(BIOS_DEBUG, "\n%3d: ", i);
|
2003-04-22 21:02:15 +02:00
|
|
|
}
|
|
|
|
status = smbus_read_byte(device, i, &byte);
|
|
|
|
if (status != 0) {
|
2010-03-22 12:42:32 +01:00
|
|
|
printk(BIOS_DEBUG, "bad device\n");
|
2003-04-22 21:02:15 +02:00
|
|
|
continue;
|
|
|
|
}
|
2010-03-22 12:42:32 +01:00
|
|
|
printk(BIOS_DEBUG, "%02x ", byte);
|
2003-04-22 21:02:15 +02:00
|
|
|
}
|
|
|
|
device += SMBUS_MEM_DEVICE_INC;
|
2010-03-22 12:42:32 +01:00
|
|
|
printk(BIOS_DEBUG, "\n");
|
2003-04-22 21:02:15 +02:00
|
|
|
}
|
|
|
|
}
|
2003-10-07 16:56:48 +02:00
|
|
|
#endif
|