All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] patch to sensor-detect script to support SMSC EMC1023
@ 2011-01-17 16:14 Anish Patel
  2011-01-17 18:09 ` [lm-sensors] patch to sensor-detect script to support SMSC Guenter Roeck
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Anish Patel @ 2011-01-17 16:14 UTC (permalink / raw)
  To: lm-sensors

[-- Attachment #1: Type: text/plain, Size: 17 bytes --]

patch attached.


[-- Attachment #2: sensors-detect.patch --]
[-- Type: text/plain, Size: 1295 bytes --]

*** sensors-detect	Fri Jan 14 11:11:56 2011
--- sensors-detect-new	Sat Jan 15 03:01:01 2011
***************
*** 1205,1210 ****
--- 1205,1215 ----
  		i2c_addrs => [0x18, 0x2a, 0x4c, 0x4d],
  		i2c_detect => sub { emc1403_detect(@_, 3); },
  	}, {
+ 		name => "SMSC_EMC1023",
+ 		driver => "emc1023",
+ 		i2c_addrs => [0x48,0x49,0x4c,0x4d],
+ 		i2c_detect => sub { emc1023_detect(@_); },
+ 	}, {
  		name => "ST STTS424",
  		driver => "jc42",
  		i2c_addrs => [0x18..0x1f],
***************
*** 5387,5392 ****
--- 5392,5418 ----
  	return 6;
  }
  
+ # Chip to detect:
+ # Registers used:
+ #   0xed: Device ID register
+ #   0xfe: Vendor ID register
+ #   0xff: Revision register
+ sub emc1023_detect
+ {
+ 	my ($file, $addr, $chip) = @_;
+ 	my $dev_id = i2c_smbus_read_byte_data($file, 0xed);
+ 	my $man_id = i2c_smbus_read_byte_data($file, 0xfe);
+ 	my $rev = i2c_smbus_read_byte_data($file, 0xff);
+ 
+ 	return unless $man_id == 0x5d;	# SMSC
+ 
+ 	return unless ($dev_id == 0x0c) || ($dev_id == 0x0d) || ($dev_id == 0x08) || ($dev_id == 0x09) ;
+ 	return unless $rev == 0x01;
+ 	
+ 	return 9;
+ }
+ 
+ 
  # This checks for non-FFFF values for temperature, voltage, and current.
  # The address (0x0b) is specified by the SMBus standard so it's likely
  # that this really is a smart battery.

[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] patch to sensor-detect script to support SMSC
  2011-01-17 16:14 [lm-sensors] patch to sensor-detect script to support SMSC EMC1023 Anish Patel
@ 2011-01-17 18:09 ` Guenter Roeck
  2011-01-17 19:04 ` Anish Patel
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2011-01-17 18:09 UTC (permalink / raw)
  To: lm-sensors

On Mon, Jan 17, 2011 at 11:14:02AM -0500, Anish Patel wrote:
> patch attached.
> 

> *** sensors-detect	Fri Jan 14 11:11:56 2011
> --- sensors-detect-new	Sat Jan 15 03:01:01 2011
> ***************
> *** 1205,1210 ****
> --- 1205,1215 ----
>   		i2c_addrs => [0x18, 0x2a, 0x4c, 0x4d],
>   		i2c_detect => sub { emc1403_detect(@_, 3); },
>   	}, {
> + 		name => "SMSC_EMC1023",
> + 		driver => "emc1023",
> + 		i2c_addrs => [0x48,0x49,0x4c,0x4d],
> + 		i2c_detect => sub { emc1023_detect(@_); },
> + 	}, {
>   		name => "ST STTS424",
>   		driver => "jc42",
>   		i2c_addrs => [0x18..0x1f],
> ***************
> *** 5387,5392 ****
> --- 5392,5418 ----
>   	return 6;
>   }
>   
> + # Chip to detect:
> + # Registers used:
> + #   0xed: Device ID register
> + #   0xfe: Vendor ID register
> + #   0xff: Revision register
> + sub emc1023_detect
> + {
> + 	my ($file, $addr, $chip) = @_;

You don't pass $chip as argument, so you should not extract it either.

> + 	my $dev_id = i2c_smbus_read_byte_data($file, 0xed);
> + 	my $man_id = i2c_smbus_read_byte_data($file, 0xfe);
> + 	my $rev = i2c_smbus_read_byte_data($file, 0xff);
> + 
> + 	return unless $man_id = 0x5d;	# SMSC
> + 
> + 	return unless ($dev_id = 0x0c) || ($dev_id = 0x0d) || ($dev_id = 0x08) || ($dev_id = 0x09) ;

Per emc1023 datasheet, Product ID values should be 0x04 .. 0x07. Am I missing something ?

Also, the Product ID and the chip address should match. So you could enhance detection
by checking for the match.

Thanks,
Guenter


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] patch to sensor-detect script to support SMSC
  2011-01-17 16:14 [lm-sensors] patch to sensor-detect script to support SMSC EMC1023 Anish Patel
  2011-01-17 18:09 ` [lm-sensors] patch to sensor-detect script to support SMSC Guenter Roeck
@ 2011-01-17 19:04 ` Anish Patel
  2011-01-17 19:36 ` Guenter Roeck
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Anish Patel @ 2011-01-17 19:04 UTC (permalink / raw)
  To: lm-sensors

[-- Attachment #1: Type: text/plain, Size: 1989 bytes --]

On 01/17/11 13:09, Guenter Roeck wrote:
> On Mon, Jan 17, 2011 at 11:14:02AM -0500, Anish Patel wrote:
>> patch attached.
>>
>> *** sensors-detect	Fri Jan 14 11:11:56 2011
>> --- sensors-detect-new	Sat Jan 15 03:01:01 2011
>> ***************
>> *** 1205,1210 ****
>> --- 1205,1215 ----
>>    		i2c_addrs =>  [0x18, 0x2a, 0x4c, 0x4d],
>>    		i2c_detect =>  sub { emc1403_detect(@_, 3); },
>>    	}, {
>> + 		name =>  "SMSC_EMC1023",
>> + 		driver =>  "emc1023",
>> + 		i2c_addrs =>  [0x48,0x49,0x4c,0x4d],
>> + 		i2c_detect =>  sub { emc1023_detect(@_); },
>> + 	}, {
>>    		name =>  "ST STTS424",
>>    		driver =>  "jc42",
>>    		i2c_addrs =>  [0x18..0x1f],
>> ***************
>> *** 5387,5392 ****
>> --- 5392,5418 ----
>>    	return 6;
>>    }
>>
>> + # Chip to detect:
>> + # Registers used:
>> + #   0xed: Device ID register
>> + #   0xfe: Vendor ID register
>> + #   0xff: Revision register
>> + sub emc1023_detect
>> + {
>> + 	my ($file, $addr, $chip) = @_;
> You don't pass $chip as argument, so you should not extract it either.
fixed
>> + 	my $dev_id = i2c_smbus_read_byte_data($file, 0xed);
>> + 	my $man_id = i2c_smbus_read_byte_data($file, 0xfe);
>> + 	my $rev = i2c_smbus_read_byte_data($file, 0xff);
>> +
>> + 	return unless $man_id == 0x5d;	# SMSC
>> +
>> + 	return unless ($dev_id == 0x0c) || ($dev_id == 0x0d) || ($dev_id == 0x08) || ($dev_id == 0x09) ;
> Per emc1023 datasheet, Product ID values should be 0x04 .. 0x07. Am I missing something ?
>
> Also, the Product ID and the chip address should match. So you could enhance detection
> by checking for the match.
i don't this this can happen, if you look at pg 2 of the data sheet, you 
can see where they hard code the addresses for the part.
when you read out of ED, it seems to have stored the lower 4bits of the 
address as the product ID.  this is all i can say for the 5 boards i 
have here with the emc1023-1 and emc1023-2.

corrected patch attached, driver to follow
> Thanks,
> Guenter
>
>

thanks
anish



[-- Attachment #2: sensors-detect.patch --]
[-- Type: text/plain, Size: 1256 bytes --]

--- lm-sensors/prog/detect/sensors-detect	2011-01-17 03:12:10.000000000 -0500
+++ lm-sensors/prog/detect/sensors-detect.new	2011-01-17 13:32:45.751002637 -0500
@@ -1205,6 +1205,11 @@
 		i2c_addrs => [0x18, 0x2a, 0x4c, 0x4d],
 		i2c_detect => sub { emc1403_detect(@_, 3); },
 	}, {
+		name => "SMSC_EMC1023",
+		driver => "emc1023",
+		i2c_addrs => [0x48,0x49,0x4c,0x4d],
+		i2c_detect => sub { emc1023_detect(@_); },
+	}, {
 		name => "ST STTS424",
 		driver => "jc42",
 		i2c_addrs => [0x18..0x1f],
@@ -5387,6 +5392,27 @@
 	return 6;
 }
 
+# Chip to detect:
+# Registers used:
+#   0xed: Device ID register
+#   0xfe: Vendor ID register
+#   0xff: Revision register
+sub emc1023_detect
+{
+	my ($file, $addr) = @_;
+	my $dev_id = i2c_smbus_read_byte_data($file, 0xed);
+	my $man_id = i2c_smbus_read_byte_data($file, 0xfe);
+	my $rev = i2c_smbus_read_byte_data($file, 0xff);
+
+	return unless $man_id == 0x5d;	# SMSC
+
+	return unless ($dev_id == 0x0c) || ($dev_id == 0x0d) || ($dev_id == 0x08) || ($dev_id == 0x09) ;
+	return unless $rev == 0x01;
+	
+	return 8;
+}
+
+
 # This checks for non-FFFF values for temperature, voltage, and current.
 # The address (0x0b) is specified by the SMBus standard so it's likely
 # that this really is a smart battery.

[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] patch to sensor-detect script to support SMSC
  2011-01-17 16:14 [lm-sensors] patch to sensor-detect script to support SMSC EMC1023 Anish Patel
  2011-01-17 18:09 ` [lm-sensors] patch to sensor-detect script to support SMSC Guenter Roeck
  2011-01-17 19:04 ` Anish Patel
@ 2011-01-17 19:36 ` Guenter Roeck
  2011-01-17 20:29 ` Anish Patel
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2011-01-17 19:36 UTC (permalink / raw)
  To: lm-sensors

On Mon, 2011-01-17 at 14:04 -0500, Anish Patel wrote:
> On 01/17/11 13:09, Guenter Roeck wrote:
> > On Mon, Jan 17, 2011 at 11:14:02AM -0500, Anish Patel wrote:
> >> patch attached.
> >>
> >> *** sensors-detect	Fri Jan 14 11:11:56 2011
> >> --- sensors-detect-new	Sat Jan 15 03:01:01 2011
> >> ***************
> >> *** 1205,1210 ****
> >> --- 1205,1215 ----
> >>    		i2c_addrs =>  [0x18, 0x2a, 0x4c, 0x4d],
> >>    		i2c_detect =>  sub { emc1403_detect(@_, 3); },
> >>    	}, {
> >> + 		name =>  "SMSC_EMC1023",
> >> + 		driver =>  "emc1023",
> >> + 		i2c_addrs =>  [0x48,0x49,0x4c,0x4d],
> >> + 		i2c_detect =>  sub { emc1023_detect(@_); },
> >> + 	}, {
> >>    		name =>  "ST STTS424",
> >>    		driver =>  "jc42",
> >>    		i2c_addrs =>  [0x18..0x1f],
> >> ***************
> >> *** 5387,5392 ****
> >> --- 5392,5418 ----
> >>    	return 6;
> >>    }
> >>
> >> + # Chip to detect:
> >> + # Registers used:
> >> + #   0xed: Device ID register
> >> + #   0xfe: Vendor ID register
> >> + #   0xff: Revision register
> >> + sub emc1023_detect
> >> + {
> >> + 	my ($file, $addr, $chip) = @_;
> > You don't pass $chip as argument, so you should not extract it either.
> fixed
> >> + 	my $dev_id = i2c_smbus_read_byte_data($file, 0xed);
> >> + 	my $man_id = i2c_smbus_read_byte_data($file, 0xfe);
> >> + 	my $rev = i2c_smbus_read_byte_data($file, 0xff);
> >> +
> >> + 	return unless $man_id = 0x5d;	# SMSC
> >> +
> >> + 	return unless ($dev_id = 0x0c) || ($dev_id = 0x0d) || ($dev_id = 0x08) || ($dev_id = 0x09) ;
> > Per emc1023 datasheet, Product ID values should be 0x04 .. 0x07. Am I missing something ?
> >
> > Also, the Product ID and the chip address should match. So you could enhance detection
> > by checking for the match.
> i don't this this can happen, if you look at pg 2 of the data sheet, you 
> can see where they hard code the addresses for the part.
> when you read out of ED, it seems to have stored the lower 4bits of the 
> address as the product ID.  this is all i can say for the 5 boards i 
> have here with the emc1023-1 and emc1023-2.
> 
Page 11 says:
Read address	Register Name	Default Value (hex)
ED		Product ID	04 (-01)
				05 (-02)
				06 (-03)
				07 (-04)
and on page 2:

EMC1023-1-ACZL-TR (Address - 1001100b)
EMC1023-2-ACZL-TR (Address - 1001101b)
EMC1023-3-ACZL-TR (Address - 1001000b)
EMC1023-4-ACZL-TR (Address - 1001001b)

So, as example, one should assume that EMC1023-1 should always be on
address 0x4c, and that reading register 0xed should return 0x04. I don't
see where it says that reading register 0xed should ever return the
lower 4 bits of the chip address.

Looking up other chips, I found the following product IDs for various
EMCxxxx chips using register 0xed as Product ID register.

Chip		Register 0xed
emc1043		0x0c .. 0x0f, 0x2c
emc1053		0x3c .. 0x3f
emc1063		0x30 .. 0x33

So I wonder if you might really have emc1043 on your board instead of
emc1023. Would that be possible ?

Guenter



_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] patch to sensor-detect script to support SMSC
  2011-01-17 16:14 [lm-sensors] patch to sensor-detect script to support SMSC EMC1023 Anish Patel
                   ` (2 preceding siblings ...)
  2011-01-17 19:36 ` Guenter Roeck
@ 2011-01-17 20:29 ` Anish Patel
  2011-01-17 21:04 ` Guenter Roeck
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Anish Patel @ 2011-01-17 20:29 UTC (permalink / raw)
  To: lm-sensors

On 01/17/11 14:36, Guenter Roeck wrote:
> On Mon, 2011-01-17 at 14:04 -0500, Anish Patel wrote:
>> On 01/17/11 13:09, Guenter Roeck wrote:
>>> On Mon, Jan 17, 2011 at 11:14:02AM -0500, Anish Patel wrote:
>>>> patch attached.
>>>>
>>>> *** sensors-detect	Fri Jan 14 11:11:56 2011
>>>> --- sensors-detect-new	Sat Jan 15 03:01:01 2011
>>>> ***************
>>>> *** 1205,1210 ****
>>>> --- 1205,1215 ----
>>>>     		i2c_addrs =>   [0x18, 0x2a, 0x4c, 0x4d],
>>>>     		i2c_detect =>   sub { emc1403_detect(@_, 3); },
>>>>     	}, {
>>>> + 		name =>   "SMSC_EMC1023",
>>>> + 		driver =>   "emc1023",
>>>> + 		i2c_addrs =>   [0x48,0x49,0x4c,0x4d],
>>>> + 		i2c_detect =>   sub { emc1023_detect(@_); },
>>>> + 	}, {
>>>>     		name =>   "ST STTS424",
>>>>     		driver =>   "jc42",
>>>>     		i2c_addrs =>   [0x18..0x1f],
>>>> ***************
>>>> *** 5387,5392 ****
>>>> --- 5392,5418 ----
>>>>     	return 6;
>>>>     }
>>>>
>>>> + # Chip to detect:
>>>> + # Registers used:
>>>> + #   0xed: Device ID register
>>>> + #   0xfe: Vendor ID register
>>>> + #   0xff: Revision register
>>>> + sub emc1023_detect
>>>> + {
>>>> + 	my ($file, $addr, $chip) = @_;
>>> You don't pass $chip as argument, so you should not extract it either.
>> fixed
>>>> + 	my $dev_id = i2c_smbus_read_byte_data($file, 0xed);
>>>> + 	my $man_id = i2c_smbus_read_byte_data($file, 0xfe);
>>>> + 	my $rev = i2c_smbus_read_byte_data($file, 0xff);
>>>> +
>>>> + 	return unless $man_id = 0x5d;	# SMSC
>>>> +
>>>> + 	return unless ($dev_id = 0x0c) || ($dev_id = 0x0d) || ($dev_id = 0x08) || ($dev_id = 0x09) ;
>>> Per emc1023 datasheet, Product ID values should be 0x04 .. 0x07. Am I missing something ?
>>>
>>> Also, the Product ID and the chip address should match. So you could enhance detection
>>> by checking for the match.
>> i don't this this can happen, if you look at pg 2 of the data sheet, you
>> can see where they hard code the addresses for the part.
>> when you read out of ED, it seems to have stored the lower 4bits of the
>> address as the product ID.  this is all i can say for the 5 boards i
>> have here with the emc1023-1 and emc1023-2.
>>
> Page 11 says:
> Read address	Register Name	Default Value (hex)
> ED		Product ID	04 (-01)
> 				05 (-02)
> 				06 (-03)
> 				07 (-04)
> and on page 2:
>
> EMC1023-1-ACZL-TR (Address - 1001100b)
> EMC1023-2-ACZL-TR (Address - 1001101b)
> EMC1023-3-ACZL-TR (Address - 1001000b)
> EMC1023-4-ACZL-TR (Address - 1001001b)
>
> So, as example, one should assume that EMC1023-1 should always be on
> address 0x4c, and that reading register 0xed should return 0x04. I don't
> see where it says that reading register 0xed should ever return the
> lower 4 bits of the chip address.
yes, that is what one would assume, but thats not whats happening, and 
you are correct, the DS does not say that reading register 0xed should 
return the lower 4bits of the chip address, but that is what i am seeing 
while working on the system that has the EMC1023-1 and EMC1023-2.
> Looking up other chips, I found the following product IDs for various
> EMCxxxx chips using register 0xed as Product ID register.
>
> Chip		Register 0xed
> emc1043		0x0c .. 0x0f, 0x2c
> emc1053		0x3c .. 0x3f
> emc1063		0x30 .. 0x33
>
> So I wonder if you might really have emc1043 on your board instead of
> emc1023. Would that be possible ?
its possible, but i just found a spare CPU carrier card and looked at 
it.  the IC is def a 1023.
I guess it is possible that i have fake/rebadged 1023.
> Guenter
>
>
>
Anish


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] patch to sensor-detect script to support SMSC
  2011-01-17 16:14 [lm-sensors] patch to sensor-detect script to support SMSC EMC1023 Anish Patel
                   ` (3 preceding siblings ...)
  2011-01-17 20:29 ` Anish Patel
@ 2011-01-17 21:04 ` Guenter Roeck
  2011-01-18 22:02 ` Anish Patel
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2011-01-17 21:04 UTC (permalink / raw)
  To: lm-sensors

On Mon, 2011-01-17 at 15:29 -0500, Anish Patel wrote:
> On 01/17/11 14:36, Guenter Roeck wrote:
> > On Mon, 2011-01-17 at 14:04 -0500, Anish Patel wrote:
> >> On 01/17/11 13:09, Guenter Roeck wrote:
> >>> On Mon, Jan 17, 2011 at 11:14:02AM -0500, Anish Patel wrote:
> >>>> patch attached.
> >>>>
> >>>> *** sensors-detect	Fri Jan 14 11:11:56 2011
> >>>> --- sensors-detect-new	Sat Jan 15 03:01:01 2011
> >>>> ***************
> >>>> *** 1205,1210 ****
> >>>> --- 1205,1215 ----
> >>>>     		i2c_addrs =>   [0x18, 0x2a, 0x4c, 0x4d],
> >>>>     		i2c_detect =>   sub { emc1403_detect(@_, 3); },
> >>>>     	}, {
> >>>> + 		name =>   "SMSC_EMC1023",
> >>>> + 		driver =>   "emc1023",
> >>>> + 		i2c_addrs =>   [0x48,0x49,0x4c,0x4d],
> >>>> + 		i2c_detect =>   sub { emc1023_detect(@_); },
> >>>> + 	}, {
> >>>>     		name =>   "ST STTS424",
> >>>>     		driver =>   "jc42",
> >>>>     		i2c_addrs =>   [0x18..0x1f],
> >>>> ***************
> >>>> *** 5387,5392 ****
> >>>> --- 5392,5418 ----
> >>>>     	return 6;
> >>>>     }
> >>>>
> >>>> + # Chip to detect:
> >>>> + # Registers used:
> >>>> + #   0xed: Device ID register
> >>>> + #   0xfe: Vendor ID register
> >>>> + #   0xff: Revision register
> >>>> + sub emc1023_detect
> >>>> + {
> >>>> + 	my ($file, $addr, $chip) = @_;
> >>> You don't pass $chip as argument, so you should not extract it either.
> >> fixed
> >>>> + 	my $dev_id = i2c_smbus_read_byte_data($file, 0xed);
> >>>> + 	my $man_id = i2c_smbus_read_byte_data($file, 0xfe);
> >>>> + 	my $rev = i2c_smbus_read_byte_data($file, 0xff);
> >>>> +
> >>>> + 	return unless $man_id = 0x5d;	# SMSC
> >>>> +
> >>>> + 	return unless ($dev_id = 0x0c) || ($dev_id = 0x0d) || ($dev_id = 0x08) || ($dev_id = 0x09) ;
> >>> Per emc1023 datasheet, Product ID values should be 0x04 .. 0x07. Am I missing something ?
> >>>
> >>> Also, the Product ID and the chip address should match. So you could enhance detection
> >>> by checking for the match.
> >> i don't this this can happen, if you look at pg 2 of the data sheet, you
> >> can see where they hard code the addresses for the part.
> >> when you read out of ED, it seems to have stored the lower 4bits of the
> >> address as the product ID.  this is all i can say for the 5 boards i
> >> have here with the emc1023-1 and emc1023-2.
> >>
> > Page 11 says:
> > Read address	Register Name	Default Value (hex)
> > ED		Product ID	04 (-01)
> > 				05 (-02)
> > 				06 (-03)
> > 				07 (-04)
> > and on page 2:
> >
> > EMC1023-1-ACZL-TR (Address - 1001100b)
> > EMC1023-2-ACZL-TR (Address - 1001101b)
> > EMC1023-3-ACZL-TR (Address - 1001000b)
> > EMC1023-4-ACZL-TR (Address - 1001001b)
> >
> > So, as example, one should assume that EMC1023-1 should always be on
> > address 0x4c, and that reading register 0xed should return 0x04. I don't
> > see where it says that reading register 0xed should ever return the
> > lower 4 bits of the chip address.
> yes, that is what one would assume, but thats not whats happening, and 
> you are correct, the DS does not say that reading register 0xed should 
> return the lower 4bits of the chip address, but that is what i am seeing 
> while working on the system that has the EMC1023-1 and EMC1023-2.
> > Looking up other chips, I found the following product IDs for various
> > EMCxxxx chips using register 0xed as Product ID register.
> >
> > Chip		Register 0xed
> > emc1043		0x0c .. 0x0f, 0x2c
> > emc1053		0x3c .. 0x3f
> > emc1063		0x30 .. 0x33
> >
> > So I wonder if you might really have emc1043 on your board instead of
> > emc1023. Would that be possible ?
> its possible, but i just found a spare CPU carrier card and looked at 
> it.  the IC is def a 1023.
> I guess it is possible that i have fake/rebadged 1023.

Interesting. Should be easy to find out, though. emc1043 has register
0x04 with a default value of 0x09. That register does not exist on
emc1023 and should either return the previously read value or an error.
emc1043 also has registers 0x29 and 0x2a which don't exist on the
emc1023. Maybe you can use i2cdump to see what registers the chip
supports, and send the result to the list.

Thanks,
Guenter



_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] patch to sensor-detect script to support SMSC
  2011-01-17 16:14 [lm-sensors] patch to sensor-detect script to support SMSC EMC1023 Anish Patel
                   ` (4 preceding siblings ...)
  2011-01-17 21:04 ` Guenter Roeck
@ 2011-01-18 22:02 ` Anish Patel
  2011-01-18 22:15 ` Guenter Roeck
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Anish Patel @ 2011-01-18 22:02 UTC (permalink / raw)
  To: lm-sensors

On 01/17/11 16:04, Guenter Roeck wrote:
> On Mon, 2011-01-17 at 15:29 -0500, Anish Patel wrote:
>> On 01/17/11 14:36, Guenter Roeck wrote:
>>> On Mon, 2011-01-17 at 14:04 -0500, Anish Patel wrote:
>>>> On 01/17/11 13:09, Guenter Roeck wrote:
>>>>> On Mon, Jan 17, 2011 at 11:14:02AM -0500, Anish Patel wrote:
>>>>>> patch attached.
>>>>>>
>>>>>> *** sensors-detect	Fri Jan 14 11:11:56 2011
>>>>>> --- sensors-detect-new	Sat Jan 15 03:01:01 2011
>>>>>> ***************
>>>>>> *** 1205,1210 ****
>>>>>> --- 1205,1215 ----
>>>>>>      		i2c_addrs =>    [0x18, 0x2a, 0x4c, 0x4d],
>>>>>>      		i2c_detect =>    sub { emc1403_detect(@_, 3); },
>>>>>>      	}, {
>>>>>> + 		name =>    "SMSC_EMC1023",
>>>>>> + 		driver =>    "emc1023",
>>>>>> + 		i2c_addrs =>    [0x48,0x49,0x4c,0x4d],
>>>>>> + 		i2c_detect =>    sub { emc1023_detect(@_); },
>>>>>> + 	}, {
>>>>>>      		name =>    "ST STTS424",
>>>>>>      		driver =>    "jc42",
>>>>>>      		i2c_addrs =>    [0x18..0x1f],
>>>>>> ***************
>>>>>> *** 5387,5392 ****
>>>>>> --- 5392,5418 ----
>>>>>>      	return 6;
>>>>>>      }
>>>>>>
>>>>>> + # Chip to detect:
>>>>>> + # Registers used:
>>>>>> + #   0xed: Device ID register
>>>>>> + #   0xfe: Vendor ID register
>>>>>> + #   0xff: Revision register
>>>>>> + sub emc1023_detect
>>>>>> + {
>>>>>> + 	my ($file, $addr, $chip) = @_;
>>>>> You don't pass $chip as argument, so you should not extract it either.
>>>> fixed
>>>>>> + 	my $dev_id = i2c_smbus_read_byte_data($file, 0xed);
>>>>>> + 	my $man_id = i2c_smbus_read_byte_data($file, 0xfe);
>>>>>> + 	my $rev = i2c_smbus_read_byte_data($file, 0xff);
>>>>>> +
>>>>>> + 	return unless $man_id = 0x5d;	# SMSC
>>>>>> +
>>>>>> + 	return unless ($dev_id = 0x0c) || ($dev_id = 0x0d) || ($dev_id = 0x08) || ($dev_id = 0x09) ;
>>>>> Per emc1023 datasheet, Product ID values should be 0x04 .. 0x07. Am I missing something ?
>>>>>
>>>>> Also, the Product ID and the chip address should match. So you could enhance detection
>>>>> by checking for the match.
>>>> i don't this this can happen, if you look at pg 2 of the data sheet, you
>>>> can see where they hard code the addresses for the part.
>>>> when you read out of ED, it seems to have stored the lower 4bits of the
>>>> address as the product ID.  this is all i can say for the 5 boards i
>>>> have here with the emc1023-1 and emc1023-2.
>>>>
>>> Page 11 says:
>>> Read address	Register Name	Default Value (hex)
>>> ED		Product ID	04 (-01)
>>> 				05 (-02)
>>> 				06 (-03)
>>> 				07 (-04)
>>> and on page 2:
>>>
>>> EMC1023-1-ACZL-TR (Address - 1001100b)
>>> EMC1023-2-ACZL-TR (Address - 1001101b)
>>> EMC1023-3-ACZL-TR (Address - 1001000b)
>>> EMC1023-4-ACZL-TR (Address - 1001001b)
>>>
>>> So, as example, one should assume that EMC1023-1 should always be on
>>> address 0x4c, and that reading register 0xed should return 0x04. I don't
>>> see where it says that reading register 0xed should ever return the
>>> lower 4 bits of the chip address.
>> yes, that is what one would assume, but thats not whats happening, and
>> you are correct, the DS does not say that reading register 0xed should
>> return the lower 4bits of the chip address, but that is what i am seeing
>> while working on the system that has the EMC1023-1 and EMC1023-2.
>>> Looking up other chips, I found the following product IDs for various
>>> EMCxxxx chips using register 0xed as Product ID register.
>>>
>>> Chip		Register 0xed
>>> emc1043		0x0c .. 0x0f, 0x2c
>>> emc1053		0x3c .. 0x3f
>>> emc1063		0x30 .. 0x33
>>>
>>> So I wonder if you might really have emc1043 on your board instead of
>>> emc1023. Would that be possible ?
>> its possible, but i just found a spare CPU carrier card and looked at
>> it.  the IC is def a 1023.
>> I guess it is possible that i have fake/rebadged 1023.
> Interesting. Should be easy to find out, though. emc1043 has register
> 0x04 with a default value of 0x09. That register does not exist on
> emc1023 and should either return the previously read value or an error.
> emc1043 also has registers 0x29 and 0x2a which don't exist on the
> emc1023. Maybe you can use i2cdump to see what registers the chip
> supports, and send the result to the list.
>
> Thanks,
> Guenter
>
>
>
here is the i2cdump for both ic's

its pretty strange, i have the dump of what seems to be a 1043, but the part is labeled 1023
link to imgshack ->  http://img692.imageshack.us/img692/1006/20110118165728.jpg

0x04C emc1023
No size specified (using byte-data access)

      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 1f 1f 80 07 09 00 00 00 00 00 00 00 00 00 00 00    ?????...........
10: c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ?...............
20: 00 00 00 60 00 00 00 12 12 03 03 00 00 00 00 00    ...`...????.....
30: 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00      ..............
40: 00 00 00 2b 12 00 78 00 00 00 00 00 00 00 00 00    ...+?.x.........
50: 00 00 00 0c 5f 60 00 00 00 00 00 00 00 00 00 00    ...?_`..........
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 00 00    .............?..
f0: 00 00 00 00 00 00 00 00 1f 60 df c0 df 40 5d 01    ........?`???@]?

0x04D emc1023
No size specified (using byte-data access)

      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 21 1e 80 07 09 00 00 00 00 00 00 00 00 00 00 00    !????...........
10: 60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    `...............
20: 00 00 00 40 00 00 00 12 12 03 03 00 00 00 00 00    ...@...????.....
30: 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00      ..............
40: 00 00 00 65 12 00 78 00 00 00 00 00 00 00 00 00    ...e?.x.........
50: 00 00 00 0c 61 40 00 00 00 00 00 00 00 00 00 00    ...?a@..........
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 0d 00 00    .............?..
f0: 00 00 00 00 00 00 00 00 1e c0 de 60 de c0 5d 01    ........???`??]?





_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] patch to sensor-detect script to support SMSC
  2011-01-17 16:14 [lm-sensors] patch to sensor-detect script to support SMSC EMC1023 Anish Patel
                   ` (5 preceding siblings ...)
  2011-01-18 22:02 ` Anish Patel
@ 2011-01-18 22:15 ` Guenter Roeck
  2011-01-18 22:25 ` Anish Patel
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2011-01-18 22:15 UTC (permalink / raw)
  To: lm-sensors

On Tue, Jan 18, 2011 at 05:02:46PM -0500, Anish Patel wrote:
[ ... ]
> >>>
> >>> Chip		Register 0xed
> >>> emc1043		0x0c .. 0x0f, 0x2c
> >>> emc1053		0x3c .. 0x3f
> >>> emc1063		0x30 .. 0x33
> >>>
> >>> So I wonder if you might really have emc1043 on your board instead of
> >>> emc1023. Would that be possible ?
> >> its possible, but i just found a spare CPU carrier card and looked at
> >> it.  the IC is def a 1023.
> >> I guess it is possible that i have fake/rebadged 1023.
> > Interesting. Should be easy to find out, though. emc1043 has register
> > 0x04 with a default value of 0x09. That register does not exist on
> > emc1023 and should either return the previously read value or an error.
> > emc1043 also has registers 0x29 and 0x2a which don't exist on the
> > emc1023. Maybe you can use i2cdump to see what registers the chip
> > supports, and send the result to the list.
> >
> > Thanks,
> > Guenter
> >
> >
> >
> here is the i2cdump for both ic's
> 
> its pretty strange, i have the dump of what seems to be a 1043, but the part is labeled 1023
> link to imgshack ->  http://img692.imageshack.us/img692/1006/20110118165728.jpg
> 
Thought so. On the plus side, we can get support for four chips, not just one...

Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] patch to sensor-detect script to support SMSC
  2011-01-17 16:14 [lm-sensors] patch to sensor-detect script to support SMSC EMC1023 Anish Patel
                   ` (6 preceding siblings ...)
  2011-01-18 22:15 ` Guenter Roeck
@ 2011-01-18 22:25 ` Anish Patel
  2011-01-18 22:34 ` Guenter Roeck
  2011-01-19  4:04 ` Anish Patel
  9 siblings, 0 replies; 11+ messages in thread
From: Anish Patel @ 2011-01-18 22:25 UTC (permalink / raw)
  To: lm-sensors

On 01/18/11 17:15, Guenter Roeck wrote:
> On Tue, Jan 18, 2011 at 05:02:46PM -0500, Anish Patel wrote:
> [ ... ]
>>>>> Chip		Register 0xed
>>>>> emc1043		0x0c .. 0x0f, 0x2c
>>>>> emc1053		0x3c .. 0x3f
>>>>> emc1063		0x30 .. 0x33
>>>>>
>>>>> So I wonder if you might really have emc1043 on your board instead of
>>>>> emc1023. Would that be possible ?
>>>> its possible, but i just found a spare CPU carrier card and looked at
>>>> it.  the IC is def a 1023.
>>>> I guess it is possible that i have fake/rebadged 1023.
>>> Interesting. Should be easy to find out, though. emc1043 has register
>>> 0x04 with a default value of 0x09. That register does not exist on
>>> emc1023 and should either return the previously read value or an error.
>>> emc1043 also has registers 0x29 and 0x2a which don't exist on the
>>> emc1023. Maybe you can use i2cdump to see what registers the chip
>>> supports, and send the result to the list.
>>>
>>> Thanks,
>>> Guenter
>>>
>>>
>>>
>> here is the i2cdump for both ic's
>>
>> its pretty strange, i have the dump of what seems to be a 1043, but the part is labeled 1023
>> link to imgshack ->   http://img692.imageshack.us/img692/1006/20110118165728.jpg
>>
> Thought so. On the plus side, we can get support for four chips, not just one...
>
> Guenter
>
i just sent of a req to the board vendor for the MNF PN and datasheet 
for that part, hopefully i get it tonight


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] patch to sensor-detect script to support SMSC
  2011-01-17 16:14 [lm-sensors] patch to sensor-detect script to support SMSC EMC1023 Anish Patel
                   ` (7 preceding siblings ...)
  2011-01-18 22:25 ` Anish Patel
@ 2011-01-18 22:34 ` Guenter Roeck
  2011-01-19  4:04 ` Anish Patel
  9 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2011-01-18 22:34 UTC (permalink / raw)
  To: lm-sensors

On Tue, Jan 18, 2011 at 05:25:23PM -0500, Anish Patel wrote:
> On 01/18/11 17:15, Guenter Roeck wrote:
> > On Tue, Jan 18, 2011 at 05:02:46PM -0500, Anish Patel wrote:
> > [ ... ]
> >>>>> Chip		Register 0xed
> >>>>> emc1043		0x0c .. 0x0f, 0x2c
> >>>>> emc1053		0x3c .. 0x3f
> >>>>> emc1063		0x30 .. 0x33
> >>>>>
> >>>>> So I wonder if you might really have emc1043 on your board instead of
> >>>>> emc1023. Would that be possible ?
> >>>> its possible, but i just found a spare CPU carrier card and looked at
> >>>> it.  the IC is def a 1023.
> >>>> I guess it is possible that i have fake/rebadged 1023.
> >>> Interesting. Should be easy to find out, though. emc1043 has register
> >>> 0x04 with a default value of 0x09. That register does not exist on
> >>> emc1023 and should either return the previously read value or an error.
> >>> emc1043 also has registers 0x29 and 0x2a which don't exist on the
> >>> emc1023. Maybe you can use i2cdump to see what registers the chip
> >>> supports, and send the result to the list.
> >>>
> >>> Thanks,
> >>> Guenter
> >>>
> >>>
> >>>
> >> here is the i2cdump for both ic's
> >>
> >> its pretty strange, i have the dump of what seems to be a 1043, but the part is labeled 1023
> >> link to imgshack ->   http://img692.imageshack.us/img692/1006/20110118165728.jpg
> >>
> > Thought so. On the plus side, we can get support for four chips, not just one...
> >
> > Guenter
> >
> i just sent of a req to the board vendor for the MNF PN and datasheet 
> for that part, hopefully i get it tonight
> 
Is that not SMS ? The SMS datasheets are all public; you can get them from the SMS web site
(http://www.smsc.com/media/Downloads_Public/Data_Sheets/1043.pdf for emc1043).

Guenter


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] patch to sensor-detect script to support SMSC
  2011-01-17 16:14 [lm-sensors] patch to sensor-detect script to support SMSC EMC1023 Anish Patel
                   ` (8 preceding siblings ...)
  2011-01-18 22:34 ` Guenter Roeck
@ 2011-01-19  4:04 ` Anish Patel
  9 siblings, 0 replies; 11+ messages in thread
From: Anish Patel @ 2011-01-19  4:04 UTC (permalink / raw)
  To: lm-sensors

On 01/18/11 17:34, Guenter Roeck wrote:
> On Tue, Jan 18, 2011 at 05:25:23PM -0500, Anish Patel wrote:
>> On 01/18/11 17:15, Guenter Roeck wrote:
>>> On Tue, Jan 18, 2011 at 05:02:46PM -0500, Anish Patel wrote:
>>> [ ... ]
>>>>>>> Chip		Register 0xed
>>>>>>> emc1043		0x0c .. 0x0f, 0x2c
>>>>>>> emc1053		0x3c .. 0x3f
>>>>>>> emc1063		0x30 .. 0x33
>>>>>>>
>>>>>>> So I wonder if you might really have emc1043 on your board instead of
>>>>>>> emc1023. Would that be possible ?
>>>>>> its possible, but i just found a spare CPU carrier card and looked at
>>>>>> it.  the IC is def a 1023.
>>>>>> I guess it is possible that i have fake/rebadged 1023.
>>>>> Interesting. Should be easy to find out, though. emc1043 has register
>>>>> 0x04 with a default value of 0x09. That register does not exist on
>>>>> emc1023 and should either return the previously read value or an error.
>>>>> emc1043 also has registers 0x29 and 0x2a which don't exist on the
>>>>> emc1023. Maybe you can use i2cdump to see what registers the chip
>>>>> supports, and send the result to the list.
>>>>>
>>>>> Thanks,
>>>>> Guenter
>>>>>
>>>>>
>>>>>
>>>> here is the i2cdump for both ic's
>>>>
>>>> its pretty strange, i have the dump of what seems to be a 1043, but the part is labeled 1023
>>>> link to imgshack ->    http://img692.imageshack.us/img692/1006/20110118165728.jpg
>>>>
>>> Thought so. On the plus side, we can get support for four chips, not just one...
>>>
>>> Guenter
>>>
>> i just sent of a req to the board vendor for the MNF PN and datasheet
>> for that part, hopefully i get it tonight
>>
> Is that not SMS ? The SMS datasheets are all public; you can get them from the SMS web site
> (http://www.smsc.com/media/Downloads_Public/Data_Sheets/1043.pdf for emc1043).
>
> Guenter
>
>
yes, we can get the 1043 datasheet from them, i also want to see what 
the board mf says.

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-01-19  4:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-17 16:14 [lm-sensors] patch to sensor-detect script to support SMSC EMC1023 Anish Patel
2011-01-17 18:09 ` [lm-sensors] patch to sensor-detect script to support SMSC Guenter Roeck
2011-01-17 19:04 ` Anish Patel
2011-01-17 19:36 ` Guenter Roeck
2011-01-17 20:29 ` Anish Patel
2011-01-17 21:04 ` Guenter Roeck
2011-01-18 22:02 ` Anish Patel
2011-01-18 22:15 ` Guenter Roeck
2011-01-18 22:25 ` Anish Patel
2011-01-18 22:34 ` Guenter Roeck
2011-01-19  4:04 ` Anish Patel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.