Richard Smith | 924f92f | 2006-07-29 17:40:36 +0000 | [diff] [blame] | 1 | |
Uwe Hermann | 1683cef | 2008-11-27 00:47:07 +0000 | [diff] [blame] | 2 | static void dump_spd_registers(void) |
Richard Smith | 924f92f | 2006-07-29 17:40:36 +0000 | [diff] [blame] | 3 | { |
| 4 | int i; |
Stefan Reinauer | 64ed2b7 | 2010-03-31 14:47:43 +0000 | [diff] [blame] | 5 | print_debug("\n"); |
Uwe Hermann | 1683cef | 2008-11-27 00:47:07 +0000 | [diff] [blame] | 6 | for(i = 0; i < DIMM_SOCKETS; i++) { |
Richard Smith | 924f92f | 2006-07-29 17:40:36 +0000 | [diff] [blame] | 7 | unsigned device; |
Uwe Hermann | 1683cef | 2008-11-27 00:47:07 +0000 | [diff] [blame] | 8 | device = DIMM_SPD_BASE + i; |
Richard Smith | 924f92f | 2006-07-29 17:40:36 +0000 | [diff] [blame] | 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) { |
Stefan Reinauer | 64ed2b7 | 2010-03-31 14:47:43 +0000 | [diff] [blame] | 19 | print_debug("\n"); |
Richard Smith | 924f92f | 2006-07-29 17:40:36 +0000 | [diff] [blame] | 20 | print_debug_hex8(j); |
| 21 | print_debug(": "); |
| 22 | } |
| 23 | status = spd_read_byte(device, j); |
| 24 | if (status < 0) { |
Stefan Reinauer | 64ed2b7 | 2010-03-31 14:47:43 +0000 | [diff] [blame] | 25 | print_debug("bad device\n"); |
Richard Smith | 924f92f | 2006-07-29 17:40:36 +0000 | [diff] [blame] | 26 | break; |
| 27 | } |
| 28 | byte = status & 0xff; |
| 29 | print_debug_hex8(byte); |
| 30 | print_debug_char(' '); |
| 31 | } |
Stefan Reinauer | 64ed2b7 | 2010-03-31 14:47:43 +0000 | [diff] [blame] | 32 | print_debug("\n"); |
Richard Smith | 924f92f | 2006-07-29 17:40:36 +0000 | [diff] [blame] | 33 | } |
Richard Smith | 924f92f | 2006-07-29 17:40:36 +0000 | [diff] [blame] | 34 | } |
| 35 | } |
| 36 | |
| 37 | #if 0 |
| 38 | void dump_spd_registers(void) |
| 39 | { |
| 40 | unsigned device; |
| 41 | device = SMBUS_MEM_DEVICE_START; |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 42 | printk(BIOS_DEBUG, "\n"); |
Richard Smith | 924f92f | 2006-07-29 17:40:36 +0000 | [diff] [blame] | 43 | while(device <= SMBUS_MEM_DEVICE_END) { |
| 44 | int status = 0; |
| 45 | int i; |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 46 | printk(BIOS_DEBUG, "dimm %02x", device); |
Richard Smith | 924f92f | 2006-07-29 17:40:36 +0000 | [diff] [blame] | 47 | for(i = 0; (i < 256) && (status == 0); i++) { |
| 48 | unsigned char byte; |
| 49 | if ((i % 20) == 0) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 50 | printk(BIOS_DEBUG, "\n%3d: ", i); |
Richard Smith | 924f92f | 2006-07-29 17:40:36 +0000 | [diff] [blame] | 51 | } |
| 52 | status = smbus_read_byte(device, i, &byte); |
| 53 | if (status != 0) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 54 | printk(BIOS_DEBUG, "bad device\n"); |
Richard Smith | 924f92f | 2006-07-29 17:40:36 +0000 | [diff] [blame] | 55 | continue; |
| 56 | } |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 57 | printk(BIOS_DEBUG, "%02x ", byte); |
Richard Smith | 924f92f | 2006-07-29 17:40:36 +0000 | [diff] [blame] | 58 | } |
| 59 | device += SMBUS_MEM_DEVICE_INC; |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 60 | printk(BIOS_DEBUG, "\n"); |
Richard Smith | 924f92f | 2006-07-29 17:40:36 +0000 | [diff] [blame] | 61 | } |
| 62 | } |
| 63 | #endif |