Skip to contentSkip to conversation

Driver for SMSC SCH5627 needed

lm-sensors Rainer Koenig 4 participants 14 messages Oct 19, 2010 – Mar 13, 2011

lore
Share & tools
lore
#0 lore raw

Hi,

I have a board that has a SMSC SCH5627 chip on it. sensors detect report "unknow chip SMSC 0xc601".
Where can I get a driver for this chip?

Best regards
Rainer

Signature · 21 lines
Dipl.-Inf. (FH) Rainer Koenig
Project Manager Linux Clients
Dept. TSP WPS R&D SW OSE

Fujitsu Technology Solutions
Bürgermeister-Ullrich-Str. 100
86199 Augsburg
Germany

Telephone: +49-821-804-3321
Telefax:   +49-821-804-2131
Mail:      mailto:[email protected] 

Internet         ts.fujtsu.com
Company Details  ts.fujitsu.com/imprint.html


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#1 lore raw

Hi Rainer,

Quoted 5 lines

Hi,

I have a board that has a SMSC SCH5627 chip on it. sensors detect report "unknow chip SMSC 0xc601".
Where can I get a driver for this chip?

First we need a datasheet. Then we can figure out if we already have a driver that supports a similar device and could be easily extended. No datasheet usually means no driver.

What board model/vendor is this? Dell machine?

...Juerg

Quoted 3 lines

Best regards
Rainer

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#2 lore raw
In reply to Rainer Koenig

Hi Juerg,

Quoted 9 lines · Juerg Haefliger
Quoted 4 lines

I have a board that has a SMSC SCH5627 chip on it. sensors detect report "unknow chip SMSC 0xc601".
Where can I get a driver for this chip?

First we need a datasheet. Then we can figure out if we already have a driver that supports a similar device and could be easily extended. No datasheet usually means no driver.

I perfectly understand that. So we used our contacts to SMSC to ask them for a chip documentation that is not under NDA. Didn't get an answer yet, but still hoping.

Quoted 2 lines

What board model/vendor is this? Dell machine?

The board is a D2984 board used in the ESPRIMO E5645 from Fujitsu Technology
Solutions. Data sheet is here:
http://docs.ts.fujitsu.com/dl.aspx?idO300628-7547-44b6-ac82-172ebae232c1

Best regards
Rainer

Signature · 21 lines
Dipl.-Inf. (FH) Rainer Koenig
Project Manager Linux Clients
Dept. TSP WPS R&D SW OSE

Fujitsu Technology Solutions
Bürgermeister-Ullrich-Str. 100
86199 Augsburg
Germany

Telephone: +49-821-804-3321
Telefax:   +49-821-804-2131
Mail:      mailto:[email protected] 

Internet         ts.fujtsu.com
Company Details  ts.fujitsu.com/imprint.html


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#3 lore raw
In reply to Rainer Koenig
Quoted 1 line

Hi Juerg,

Hi Rainer,

Quoted 7 lines
Quoted 4 lines

First we need a datasheet. Then we can figure out if we already have a driver that supports a similar device and could be easily extended. No datasheet usually means no driver.

I perfectly understand that. So we used our contacts to SMSC to ask them for a chip documentation that is not under NDA. Didn't get an answer yet, but still hoping.

I sent an email to my SMSC contact. We'll see what happens.

...Juerg

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#4 lore raw
In reply to Rainer Koenig

Hi Rainer,

Quoted 8 lines
Quoted 1 line

Hi Juerg,

Hi Rainer,

Quoted 4 lines
Quoted 4 lines

First we need a datasheet. Then we can figure out if we already have a driver that supports a similar device and could be easily extended. No datasheet usually means no driver.

Quoted 5 lines
Quoted 3 lines

I perfectly understand that. So we used our contacts to SMSC to ask them for a chip documentation that is not under NDA. Didn't get an answer yet, but still hoping.

I sent an email to my SMSC contact. We'll see what happens.

I received the datasheet from SMSC but under NDA, so I can't share it. I'll check it against the currently supported chips to see if we have something compatible or fairly close. Give me a few days though...

...Juerg

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#5 lore raw
In reply to Rainer Koenig

Hi Rainer,

Quoted 3 lines

I received the datasheet from SMSC but under NDA, so I can't share it. I'll check it against the currently supported chips to see if we have something compatible or fairly close. Give me a few days though...

Took a quick glance at the datasheet. This is a totally different beast that is not even remotely compatible to anything we support thus far AFAIK. It contains an embedded microcontroller (!) which handles all the hwmon related tasks. The datasheet that I received doesn't contain any information about the microcontroller other than a simple block diagram. So at the moment it's absolutely a no go and even with all the technical data we would have to start from scratch with a new driver.

...Juerg

Quoted 2 lines

...Juerg

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#6 lore raw
In reply to Rainer Koenig
Quoted 7 lines · Juerg Haefliger

Hi Rainer,

Quoted 3 lines

I received the datasheet from SMSC but under NDA, so I can't share it. I'll check it against the currently supported chips to see if we have something compatible or fairly close. Give me a few days though...

Quoted 8 lines

Took a quick glance at the datasheet. This is a totally different beast that is not even remotely compatible to anything we support thus far AFAIK. It contains an embedded microcontroller (!) which handles all the hwmon related tasks. The datasheet that I received doesn't contain any information about the microcontroller other than a simple block diagram. So at the moment it's absolutely a no go and even with all the technical data we would have to start from scratch with a new driver.

Thanks Juerg for checking this. Can you please update sensors-detect with the device name and features, and also create an entry in wiki/Devices? So that other user with that chip know the current status, even if it's bad.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#7 lore raw
In reply to Rainer Koenig
Quoted 4 lines

Thanks Juerg for checking this. Can you please update sensors-detect with the device name and features, and also create an entry in wiki/Devices? So that other user with that chip know the current status, even if it's bad.

Will do.

...Juerg

Quoted 3 lines

--
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#8 lore raw
In reply to Rainer Koenig

Hi Jean

Quoted 9 lines
Quoted 8 lines

Took a quick glance at the datasheet. This is a totally different beast that is not even remotely compatible to anything we support thus far AFAIK. It contains an embedded microcontroller (!) which handles all the hwmon related tasks. The datasheet that I received doesn't contain any information about the microcontroller other than a simple block diagram. So at the moment it's absolutely a no go and even with all the technical data we would have to start from scratch with a new driver.

Quoted 4 lines

Thanks Juerg for checking this. Can you please update sensors-detect with the device name and features, and also create an entry in wiki/Devices? So that other user with that chip know the current status, even if it's bad.

I added detection to sensors-detect but I'm not too happy with the outcome:
Trying family `SMSC'... Yes
Found `SMSC SCH5627 Desktop Embedded Controller'
(but not activated)

The chip shouldn't be probed at all since it's non-standard. Users might get confused by the 'not activated' message and will ask how to activate it. Is there a way to bypass the probing and just print a message that there is no driver for this chip?

...Juerg

Quoted 3 lines

--
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#9 lore raw
In reply to Rainer Koenig

Hi Jean,

While I have your attention :-)

Quoted 21 lines

Hi Jean

Quoted 9 lines
Quoted 8 lines

Took a quick glance at the datasheet. This is a totally different beast that is not even remotely compatible to anything we support thus far AFAIK. It contains an embedded microcontroller (!) which handles all the hwmon related tasks. The datasheet that I received doesn't contain any information about the microcontroller other than a simple block diagram. So at the moment it's absolutely a no go and even with all the technical data we would have to start from scratch with a new driver.

Quoted 4 lines

Thanks Juerg for checking this. Can you please update sensors-detect with the device name and features, and also create an entry in wiki/Devices? So that other user with that chip know the current status, even if it's bad.

I added detection to sensors-detect but I'm not too happy with the outcome:
Trying family SMSC'...                                     Yes Found SMSC SCH5627 Desktop Embedded Controller'
  (but not activated)

Quoted 4 lines

The chip shouldn't be probed at all since it's non-standard. Users might get confused by the 'not activated' message and will ask how to activate it. Is there a way to bypass the probing and just print a message that there is no driver for this chip?

Any suggestions on how to accomplish this?

Thanks
...Juerg

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#10 lore raw
In reply to Rainer Koenig

Hi Juerg,

Sorry for the late answer.

Quoted 21 lines · Juerg Haefliger

Hi Jean

Quoted 9 lines
Quoted 8 lines

Took a quick glance at the datasheet. This is a totally different beast that is not even remotely compatible to anything we support thus far AFAIK. It contains an embedded microcontroller (!) which handles all the hwmon related tasks. The datasheet that I received doesn't contain any information about the microcontroller other than a simple block diagram. So at the moment it's absolutely a no go and even with all the technical data we would have to start from scratch with a new driver.

Quoted 4 lines

Thanks Juerg for checking this. Can you please update sensors-detect with the device name and features, and also create an entry in wiki/Devices? So that other user with that chip know the current status, even if it's bad.

I added detection to sensors-detect but I'm not too happy with the outcome:
Trying family `SMSC'... Yes
Found `SMSC SCH5627 Desktop Embedded Controller'
(but not activated)

Quoted 4 lines

The chip shouldn't be probed at all since it's non-standard. Users might get confused by the 'not activated' message and will ask how to activate it. Is there a way to bypass the probing and just print a message that there is no driver for this chip?

Hans submitted a candidate driver for this device meanwhile, so it would make sense to add support to sensors-detect too.

I am surprised by your report above. Looking at Hans's driver code, the only non-standard thing about the SCH5627 is that the base I/O register is at 0x66 instead of 0x60, with swapped bytes. The activation bit is still 0x30[0], while your message above suggests that the bit in question wasn't enabled on your system (although it's a little difficult to comment, given that you never shared your sensors-detect patch with us; maybe you selected the wrong logical device?)

Anyway, I agree that the non-standard location of the base I/O register isn't supported by sensors-detect yet. We already have some code to handle non-standard SMSC chips, but the SCH5627 is non-standard in a different way. I'll try to come up with something, stay tuned.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#11 lore raw
In reply to Rainer Koenig
Quoted 4 lines · Jean Delvare

Anyway, I agree that the non-standard location of the base I/O register isn't supported by sensors-detect yet. We already have some code to handle non-standard SMSC chips, but the SCH5627 is non-standard in a different way. I'll try to come up with something, stay tuned.

Can anyone with access to a SCH5627 chip test the sensors-detect patch in attachment? Alternatively a pre-patched sensors-detect can be downloaded at:
http://khali.linux-fr.org/devel/misc/sensors-detect

It should properly detect the SCH5627, but I can't test it as I don't have such a chip.

Thanks,

Signature · 1 line
Jean Delvare

Add detection of the SMSC SCH5627. Some code is needed because the base I/O registers live at non-standard addresses.

---
 prog/detect/sensors-detect |   60 ++++++++++++++++++++++++++++++++++----------
 1 file changed, 47 insertions(+), 13 deletions(-)
prog/detect/sensors-detect +47 -13
@@ -1402,6 +1402,7 @@ use vars qw(@i2c_adapter_names);
 #	 monitoring registers can only be accessed via the SMBus
 #  devid: The device ID we have to match (base device)
 #  devid_mask (optional): Bitmask to apply before checking the device ID
+#  regs (optional): Register definitions, where they differ from the standard.
 #  logdev: The logical device containing the sensors
 #  check (optional): A function to refine the detection. Will be passed
 #      the index and data ports as parameters. Must return 1 for a matching
@@ -1761,6 +1762,16 @@ use constant FEAT_SMBUS	=> (1 << 7);
 		# No datasheet
 		driver => "not-a-sensor",
 		devid => 0x83,
+	}, {
+		name => "SMSC SCH5627 Super IO",
+		driver => "sch5627",
+		devid => 0xc6,
+		regs => {
+			basereg_lsb => 0x66,
+			basereg_msb => 0x67,
+		},
+		logdev => 0x0c,
+		features => FEAT_IN | FEAT_FAN | FEAT_TEMP,
 	}
 );
 
@@ -2236,6 +2247,20 @@ sub any_list_match
 	return 0;
 }
 
+# $_[0]: Reference to base hash
+# $_[1]: Reference to overlay hash
+# Result: Overlayed hash
+sub overlay_hash
+{
+	my ($base, $overlay) = @_;
+	my %result = %{$base};
+
+	foreach my $key (keys %{$overlay}) {
+		$result{$key} = $overlay->{$key};
+	}
+	return %result;
+}
+
 ###################
 # I/O PORT ACCESS #
 ###################
@@ -3544,7 +3569,7 @@ sub scan_isa_bus
 	$| = 0;
 }
 
-use vars qw(%superio);
+use vars qw(%standard_superio);
 
 # The following are taken from the PNP ISA spec (so it's supposed
 # to be common to all Super I/O chips):
@@ -3552,13 +3577,14 @@ use vars qw(%superio);
 #  logdevreg: The logical device register
 #  actreg: The activation register within the logical device
 #  actmask: The activation bit in the activation register
-#  basereg: The I/O base register within the logical device
-%superio = (
+#  basereg_*: The I/O base registers within the logical device
+%standard_superio = (
 	devidreg => 0x20,
 	logdevreg => 0x07,
 	actreg => 0x30,
 	actmask => 0x01,
-	basereg => 0x60,
+	basereg_msb => 0x60,
+	basereg_lsb => 0x61,
 );
 
 sub exit_superio
@@ -3580,18 +3606,18 @@ sub guess_superio_ld
 	my ($oldldn, $ldn, $addr);
 
 	# Save logical device number
-	outb($addrreg, $superio{logdevreg});
+	outb($addrreg, $standard_superio{logdevreg});
 	$oldldn = inb($datareg);
 
 	for ($ldn = 0; $ldn < 16; $ldn++) {
 		# Select logical device
-		outb($addrreg, $superio{logdevreg});
+		outb($addrreg, $standard_superio{logdevreg});
 		outb($datareg, $ldn);
 
 		# Read base I/O address
-		outb($addrreg, $superio{basereg});
+		outb($addrreg, $standard_superio{basereg_msb});
 		$addr = inb($datareg) << 8;
-		outb($addrreg, $superio{basereg} + 1);
+		outb($addrreg, $standard_superio{basereg_lsb});
 		$addr |= inb($datareg);
 		next unless ($addr & 0xfff8) == $typical_addr;
 
@@ -3601,7 +3627,7 @@ sub guess_superio_ld
 	}
 
 	# Be nice, restore original logical device
-	outb($addrreg, $superio{logdevreg});
+	outb($addrreg, $standard_superio{logdevreg});
 	outb($datareg, $oldldn);
 }
 
@@ -3610,6 +3636,14 @@ sub probe_superio
 {
 	my ($addrreg, $datareg, $chip) = @_;
 	my ($val, $addr);
+	my %superio;
+
+	# Use chip-specific registers if provided
+	if (exists $chip->{regs}) {
+		%superio = overlay_hash(\%standard_superio, $chip->{regs});
+	} else {
+		%superio = %standard_superio;
+	}
 
 	if (exists $chip->{check}) {
 		return 0 unless $chip->{check}($addrreg, $datareg);
@@ -3636,9 +3670,9 @@ sub probe_superio
 	outb($datareg, $chip->{logdev});
 
 	# Get the IO base address
-	outb($addrreg, $superio{basereg});
+	outb($addrreg, $superio{basereg_msb});
 	$addr = inb($datareg);
-	outb($addrreg, $superio{basereg} + 1);
+	outb($addrreg, $superio{basereg_lsb});
 	$addr = ($addr << 8) | inb($datareg);
 
 	# Check the activation register and base address
@@ -3721,9 +3755,9 @@ sub scan_superio
 		}
 
 		# did it work?
-		outb($addrreg, $superio{devidreg});
+		outb($addrreg, $standard_superio{devidreg});
 		$val = inb($datareg);
-		outb($addrreg, $superio{devidreg} + 1);
+		outb($addrreg, $standard_superio{devidreg} + 1);
 		$val = ($val << 8) | inb($datareg);
 		if ($val == 0x0000 || $val == 0xffff) {
 			print "No\n";

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#12 lore raw
In reply to Rainer Koenig

Hi,

Quoted 8 lines · Jean Delvare
Quoted 4 lines · Jean Delvare

Anyway, I agree that the non-standard location of the base I/O register isn't supported by sensors-detect yet. We already have some code to handle non-standard SMSC chips, but the SCH5627 is non-standard in a different way. I'll try to come up with something, stay tuned.

Can anyone with access to a SCH5627 chip test the sensors-detect patch in attachment?

Thanks for doing this! I had this on my todo. Likewise I've extending sensors detect for the new Fintek models supported by the f71882fg driver, as well as updating the devices wiki page on my todo.

Works like a charm:

Trying family `SMSC'... Yes
Found `SMSC SCH5627 Super IO' Success!

     (address 0x580, driver `sch5627')

(and yes that is the correct io address).

Regards,

Hans

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#13 lore raw
In reply to Rainer Koenig
Quoted 7 lines · Hans de Goede
Quoted 6 lines · Jean Delvare
Quoted 4 lines · Jean Delvare

Anyway, I agree that the non-standard location of the base I/O register isn't supported by sensors-detect yet. We already have some code to handle non-standard SMSC chips, but the SCH5627 is non-standard in a different way. I'll try to come up with something, stay tuned.

Quoted 6 lines
Quoted 2 lines

Can anyone with access to a SCH5627 chip test the sensors-detect patch in attachment?

Thanks for doing this! I had this on my todo. Likewise I've extending sensors detect for the new Fintek models supported by the f71882fg driver, as well as updating the devices wiki page on my todo.

I didn't mean to step on your toes, simply I was under the impression that nobody but me was willing to touch sensors-detect's core code.

Thanks for keeping sensors-detect and wiki/Devices up-to-date, this is very appreciated.

Quoted 7 lines

Works like a charm:

Trying family `SMSC'... Yes
Found `SMSC SCH5627 Super IO' Success!

     (address 0x580, driver `sch5627')

(and yes that is the correct io address).

Thanks for testing! I've just committed the patch to SVN.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors