Index: /i2c-tools/trunk/eeprom/decode-dimms
===================================================================
--- /i2c-tools/trunk/eeprom/decode-dimms	(revision 5164)
+++ /i2c-tools/trunk/eeprom/decode-dimms	(revision 5287)
@@ -43,4 +43,7 @@
 use vars qw($opt_html $opt_bodyonly $opt_igncheck $use_sysfs $use_hexdump
 	    @vendors %decode_callback $revision @dimm_list %hexdump_cache);
+
+use constant LITTLEENDIAN	=> "little-endian";
+use constant BIGENDIAN		=> "big-endian";
 
 $revision = '$Revision$ ($Date$)';
@@ -1133,6 +1136,11 @@
 			if (/^(..)(..)$/) {
 			        $word |= 1;
-				$bytes[$addr++] = hex($1);
-				$bytes[$addr++] = hex($2);
+				if ($use_hexdump eq LITTLEENDIAN) {
+					$bytes[$addr++] = hex($2);
+					$bytes[$addr++] = hex($1);
+				} else {
+					$bytes[$addr++] = hex($1);
+					$bytes[$addr++] = hex($2);
+				}
 			} else {
 				$bytes[$addr++] = hex($_);
@@ -1142,5 +1150,5 @@
 	close F;
 	$header and die "Unable to parse any data from hexdump '$_[0]'";
-	$word and printc "Warning: Assuming big-endian order 16-bit hex dump";
+	$word and printc "Using $use_hexdump 16-bit hex dump";
 
 	# Cache the data for later use
@@ -1178,5 +1186,5 @@
 foreach (@ARGV) {
 	if ($_ eq '-h' || $_ eq '--help') {
-		print "Usage: $0 [-c] [-f [-b]] [-x file [files..]]\n",
+		print "Usage: $0 [-c] [-f [-b]] [-x|-X file [files..]]\n",
 			"       $0 -h\n\n",
 			"  -f, --format            Print nice html output\n",
@@ -1185,4 +1193,6 @@
 			"  -c, --checksum          Decode completely even if checksum fails\n",
 			"  -x,                     Read data from hexdump files\n",
+			"  -X,                     Same as -x except treat multibyte hex\n",
+			"                          data as little endian\n",
 			"  -h, --help              Display this usage summary\n";
 		print <<"EOF";
@@ -1191,6 +1201,6 @@
 likely many other progams producing hex dumps of one kind or another.  Note
 that the default output of "hexdump" will be byte-swapped on little-endian
-systems and will therefore not be parsed correctly.  It is better to use
-"hexdump -C", which is not ambiguous.
+systems and you must use -X instead of -x, otherwise the dump will not be
+parsed correctly.  It is better to use "hexdump -C", which is not ambiguous.
 EOF
 		exit;
@@ -1210,5 +1220,9 @@
 	}
 	if ($_ eq '-x') {
-		$use_hexdump = 1;
+		$use_hexdump = BIGENDIAN;
+		next;
+	}
+	if ($_ eq '-X') {
+		$use_hexdump = LITTLEENDIAN;
 		next;
 	}
Index: /i2c-tools/trunk/CHANGES
===================================================================
--- /i2c-tools/trunk/CHANGES	(revision 5280)
+++ /i2c-tools/trunk/CHANGES	(revision 5287)
@@ -3,4 +3,5 @@
 
 SVN
+  decode-dimms: Add support for little-endian word hexdumps
   decode-vaio: Remove history
   i2cdetect: Support i2c bus passed by name
