blob: 34f4fd4fed611cfeb231a9447f0049249db341ce [file] [log] [blame]
Richard Smith924f92f2006-07-29 17:40:36 +00001
Uwe Hermann1683cef2008-11-27 00:47:07 +00002static void dump_spd_registers(void)
Richard Smith924f92f2006-07-29 17:40:36 +00003{
4 int i;
Stefan Reinauer64ed2b72010-03-31 14:47:43 +00005 print_debug("\n");
Uwe Hermann1683cef2008-11-27 00:47:07 +00006 for(i = 0; i < DIMM_SOCKETS; i++) {
Richard Smith924f92f2006-07-29 17:40:36 +00007 unsigned device;
Uwe Hermann1683cef2008-11-27 00:47:07 +00008 device = DIMM_SPD_BASE + i;
Richard Smith924f92f2006-07-29 17:40:36 +00009 if (device) {
10 int j;
Stefan Reinauer14e22772010-04-27 06:56:47 +000011 print_debug("dimm: ");
12 print_debug_hex8(i);
Richard Smith924f92f2006-07-29 17:40:36 +000013 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) {
Stefan Reinauer64ed2b72010-03-31 14:47:43 +000019 print_debug("\n");
Richard Smith924f92f2006-07-29 17:40:36 +000020 print_debug_hex8(j);
21 print_debug(": ");
22 }
23 status = spd_read_byte(device, j);
24 if (status < 0) {
Stefan Reinauer64ed2b72010-03-31 14:47:43 +000025 print_debug("bad device\n");
Richard Smith924f92f2006-07-29 17:40:36 +000026 break;
27 }
28 byte = status & 0xff;
29 print_debug_hex8(byte);
30 print_debug_char(' ');
31 }
Stefan Reinauer64ed2b72010-03-31 14:47:43 +000032 print_debug("\n");
Richard Smith924f92f2006-07-29 17:40:36 +000033 }
Richard Smith924f92f2006-07-29 17:40:36 +000034 }
35}
36
37#if 0
38void dump_spd_registers(void)
39{
40 unsigned device;
41 device = SMBUS_MEM_DEVICE_START;
Stefan Reinauerc02b4fc2010-03-22 11:42:32 +000042 printk(BIOS_DEBUG, "\n");
Richard Smith924f92f2006-07-29 17:40:36 +000043 while(device <= SMBUS_MEM_DEVICE_END) {
44 int status = 0;
45 int i;
Stefan Reinauerc02b4fc2010-03-22 11:42:32 +000046 printk(BIOS_DEBUG, "dimm %02x", device);
Richard Smith924f92f2006-07-29 17:40:36 +000047 for(i = 0; (i < 256) && (status == 0); i++) {
48 unsigned char byte;
49 if ((i % 20) == 0) {
Stefan Reinauerc02b4fc2010-03-22 11:42:32 +000050 printk(BIOS_DEBUG, "\n%3d: ", i);
Richard Smith924f92f2006-07-29 17:40:36 +000051 }
52 status = smbus_read_byte(device, i, &byte);
53 if (status != 0) {
Stefan Reinauerc02b4fc2010-03-22 11:42:32 +000054 printk(BIOS_DEBUG, "bad device\n");
Richard Smith924f92f2006-07-29 17:40:36 +000055 continue;
56 }
Stefan Reinauerc02b4fc2010-03-22 11:42:32 +000057 printk(BIOS_DEBUG, "%02x ", byte);
Richard Smith924f92f2006-07-29 17:40:36 +000058 }
59 device += SMBUS_MEM_DEVICE_INC;
Stefan Reinauerc02b4fc2010-03-22 11:42:32 +000060 printk(BIOS_DEBUG, "\n");
Richard Smith924f92f2006-07-29 17:40:36 +000061 }
62}
63#endif