Changeset 5561 for i2c-tools/trunk
- Timestamp:
- 12/11/08 17:56:54 (3 years ago)
- Location:
- i2c-tools/trunk/eeprom
- Files:
-
- 5 modified
-
ddcmon (modified) (8 diffs)
-
decode-dimms (modified) (4 diffs)
-
decode-edid (modified) (3 diffs)
-
decode-vaio (modified) (8 diffs)
-
decode-xeon (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
i2c-tools/trunk/eeprom/ddcmon
r5164 r5561 78 78 my $offset = shift || 0; 79 79 my $bytes = ''; 80 80 81 81 sysopen(FH, $filename, O_RDONLY) 82 82 or die "Can't open $filename"; … … 142 142 { 143 143 my ($bytes, $offset) = @_; 144 144 145 145 return $bytes->[$offset]; 146 146 } … … 149 149 { 150 150 my ($bytes, $offset) = @_; 151 151 152 152 return ($bytes->[$offset] 153 153 | ($bytes->[$offset+1] << 8)); … … 168 168 { 169 169 my ($bytes, $offset) = @_; 170 170 171 171 return ($bytes->[$offset] 172 172 | ($bytes->[$offset+1] << 8) … … 177 177 { 178 178 my ($bytes, $offset) = @_; 179 179 180 180 return ($bytes->[$offset] 181 181 | ($bytes->[$offset+1] << 8) … … 221 221 return $mode[($bytes->[$offset] >> 3) & 0x03]; 222 222 } 223 223 224 224 sub good_signature 225 225 { 226 226 my $bytes = shift; 227 227 228 228 return $bytes->[0] == 0x00 229 229 && $bytes->[1] == 0xff … … 245 245 $cs += $bytes->[$i]; 246 246 } 247 247 248 248 return (($cs & 0xff) == 0 ? 'OK' : 'Not OK'); 249 249 } … … 535 535 { 536 536 my $error = print_edid($ARGV[0], $address); 537 537 538 538 if ($error == 1) 539 539 { -
i2c-tools/trunk/eeprom/decode-dimms
r5560 r5561 663 663 664 664 printl("Min RAS Pulse Width", 665 value_or_undefined($bytes->[30], "ns")); 665 value_or_undefined($bytes->[30], "ns")); 666 666 667 667 $temp = ""; … … 1108 1108 printl("Minimum Active to Auto-Refresh Delay (tRC)", 1109 1109 tns3((((($bytes->[21] >> 4) & 15) << 8) + $bytes->[23]) * $mtb)); 1110 printl("Minimum Recovery Delay (tRFC)", 1110 printl("Minimum Recovery Delay (tRFC)", 1111 1111 tns3((($bytes->[25] << 8) + $bytes->[24]) * $mtb)); 1112 1112 printl("Minimum Write to Read CMD Delay (tWTR)", … … 1154 1154 printl("Module Height (mm)", ($bytes->[60] & 31) + 15); 1155 1155 printl("Module Thickness (mm)", sprintf("%d front, %d back", 1156 ($bytes->[61] & 15) + 1, 1156 ($bytes->[61] & 15) + 1, 1157 1157 (($bytes->[61] >> 4) & 15) +1)); 1158 1158 printl("Module Width (mm)", ($bytes->[3] <= 2) ? 133.5 : … … 1712 1712 1713 1713 if ($type eq "DDR3 SDRAM") { 1714 # Decode DDR3-specific manufacturing data in bytes 1714 # Decode DDR3-specific manufacturing data in bytes 1715 1715 # 117-149 1716 1716 decode_ddr3_mfg_data(\@bytes) -
i2c-tools/trunk/eeprom/decode-edid
r5164 r5561 81 81 my ($filename, $length, $offset) = @_; 82 82 my $bytes = ''; 83 83 84 84 sysopen(FH, $filename, O_RDONLY) 85 85 or die "Can't open $filename"; … … 139 139 return $i; 140 140 } 141 } 142 } 143 141 } 142 } 143 144 144 return; # default 145 145 } … … 164 164 delete $SIG{__WARN__}; 165 165 binmode PIPE; 166 166 167 167 if ($mode == PROCFS) 168 168 { -
i2c-tools/trunk/eeprom/decode-vaio
r5172 r5561 18 18 # MA 02110-1301 USA. 19 19 # 20 # EEPROM data decoding for Sony Vaio laptops. 20 # EEPROM data decoding for Sony Vaio laptops. 21 21 # 22 22 # The eeprom driver must be loaded. For kernels older than 2.6.0, the … … 62 62 { 63 63 my ($label,$value) = @_; 64 64 65 65 printf("\%16s : \%s\n",$label,$value); 66 66 } … … 72 72 my ($bus, $addr, $offset, $length) = @_; 73 73 my $filename; 74 74 75 75 if ($sysfs) 76 76 { … … 95 95 } 96 96 close(FH); 97 97 98 98 return $bytes; 99 99 } … … 104 104 my $values = ''; 105 105 my $remains = $length + $offset; 106 106 107 107 # Get all lines in a single string 108 108 while ($remains > 0) … … 117 117 $base += 16; 118 118 } 119 119 120 120 # Store the useful part in an array 121 121 my @bytes = split(/[ \n]/, $values); … … 133 133 my $string = read_eeprom_bytes($bus, $addr, $offset, $length); 134 134 $string =~ s/\x00.*$//; 135 135 136 136 return($string); 137 137 } … … 181 181 { 182 182 my ($bus,$addr) = @_; 183 183 184 184 my $name = decode_string($bus, $addr, 128, 32); 185 185 # Simple heuristic to skip false positives -
i2c-tools/trunk/eeprom/decode-xeon
r5162 r5561 7 7 # 8 8 # 9 # ID ROM data decoding for Xeon processors. 9 # ID ROM data decoding for Xeon processors. 10 10 # Each Xeon processor contains two memories: 11 11 # - A scratch EEPROM at an even location 0x50, 52, 54, or 56; … … 25 25 # Decode flags in byte 0x7B (cartridge feature flags) 26 26 # 27 # References: 27 # References: 28 28 # "Pentium II Xeon Processor at 400 and 450 MHz" Data Sheet 29 # Intel 29 # Intel 30 30 # 31 31 # … … 44 44 if ((/^eeprom-/) && (/-51$/ || /-53$/ || /-55$/ || /-57$/)) { 45 45 $dimm_count=$dimm_count + 1; 46 46 47 47 print "\nDecoding Xeon ROM: /proc/sys/dev/sensors/$dimm_list[$i]\n"; 48 48 if (/^[^-]+-[^-]+-[^-]+-([^-]+)$/) { … … 55 55 $_=`cat /proc/sys/dev/sensors/$dimm_list[$i]/00`; 56 56 @bytes=split(" "); 57 57 58 58 printf("\tData Format Revision: \t\t\t\t0x%.4X\n", $bytes[0]); 59 59 … … 70 70 printf("\tFeature Data Address:\t\t\t\t0x%.2X\n", $bytes[9]); 71 71 printf("\tOther Data Address:\t\t\t\t0x%.2X\n", $bytes[10]); 72 72 73 73 print "\t\t----=== Xeon ROM Processor Data ===----\n"; 74 74 75 75 # Decode next 16 bytes 76 76 $_=`cat /proc/sys/dev/sensors/$dimm_list[$i]/10`; 77 77 @bbytes=split(" "); 78 print "\tS-spec/QDF Number:\t\t\t\t\"";78 print "\tS-spec/QDF Number:\t\t\t\t\""; 79 79 print pack("cccccc",$bytes[14],$bytes[15],$bbytes[0], 80 $bbytes[1],$bbytes[2],$bbytes[3]);80 $bbytes[1],$bbytes[2],$bbytes[3]); 81 81 print "\"\n"; 82 82 $tmp = $bbytes[4] & 0xC0 >> 6; … … 89 89 90 90 print "\t\t----=== Xeon ROM Core Data ===----\n"; 91 91 92 92 printf("\tProcessor Core Type:\t\t\t\t0x%.2X\n", 93 93 ($bbytes[6] & 0xC0) >> 6); … … 101 101 print ($bbytes[13] << 4) + $bbytes[14]; 102 102 print "\n"; 103 103 104 104 # Decode next 16 bytes (32-47) 105 105 $_=`cat /proc/sys/dev/sensors/$dimm_list[$i]/20`; … … 116 116 117 117 print "\t\t----=== Xeon ROM L2 Cache Data ===----\n"; 118 118 119 119 print "\tL2 Cache Size (KB):\t\t\t\t"; 120 120 print ($bytes[9] << 4) + $bytes[10]; … … 174 174 175 175 # Decode next 16 bytes (96-111) 176 # Not used... 176 # Not used... 177 177 178 178 # Decode next 16 bytes (112-127) 179 179 $_=`cat /proc/sys/dev/sensors/$dimm_list[$i]/70`; 180 180 @bytes=split(" "); 181 181 182 182 print "\t\t----=== Xeon Thermal Reference Data ===----\n"; 183 183 … … 192 192 printf("\tNumber of Devices in TAP Chain:\t\t\t%d\n", 193 193 ($bytes[12] & 0xF0) >> 4); 194 194 195 195 } 196 196 }
