Ticket #2181 (closed enhancement: fixed)

Opened 8 years ago

Last modified 8 years ago

Support for SMSC LPC47M292

Reported by: srowe@… Owned by: khali
Priority: minor Milestone: 2.10.3
Component: hardware Version:
Keywords: LPC47M292 Cc:

Description

I have a board with an SMSC LPC47M292 Super IO chip on it and would like to access fan speed and temperature sensor readings.

I have the datasheet if that would assist.

If you're unable to tackle this chip at this time then with a little guidance I might be able to do it myself.

Attachments

apollo-sensors.txt Download (9.0 KB) - added by ticket 8 years ago.
Ouput from sensors-detect
lm-sensors-lpc47m292-fan-support.patch Download (15.6 KB) - added by khali 8 years ago.
lm-sensors SVN patch adding support for the SMSC LPC47M292 fan monitoring and control
hwmon-smsc47m1-add-LPC47M292-support.patch Download (14.2 KB) - added by khali 8 years ago.
LPC47M292 fan support for Linux 2.6

Change History

  Changed 8 years ago by khali

  • cc srowe@… removed
  • keywords LPC47M292 added
  • status changed from new to assigned
  • owner changed from somebody to khali
  • reporter changed from ticket to srowe@…

The LPC47M292 is not listed on SMSC's website. Which motherboard brand and model do you have?

Please attach the output of sensors-detect (from lm_sensors 2.10.2 or  SVN).

  Changed 8 years ago by ticket

The motherboard is an i855-based embedded board

 http://www.arcom.com/ebx-pentium-m-apollo.htm

I'll attach the sensors-detect output, it appears the (unmerged) smsc47m192 driver may work.

How much effort would it be to back-port this driver to a 2.4 kernel?

Changed 8 years ago by ticket

Ouput from sensors-detect

  Changed 8 years ago by khali

The temperature/voltage part appears to be similar to the LPC47M192, which is supported under Linux 2.6 by the smsc47m192 driver. As a matter of fact, both have the same device ID register value, so sensors-detect found your chip already and the smsc47m192 driver should work out of the box. However, there is no official driver for Linux 2.4. Someone posted a driver long ago, it's listed on our Devices page, but it was never reviewed. Frankly, no developer is interested in working for Linux 2.4 anymore.

The fan part also appears to be similar to the LPC47M1xx family, except that there are 3 fans supported instead of 2. Also, the device ID is different, so we will have to update the smsc47m1 driver to support this chip. It shouldn't be too difficult though, and it can be done for both Linux 2.6 and Linux 2.4.

  Changed 8 years ago by ticket

Where can I get the 2.6 smsc47m192 driver? It's not in the 2.10.2 tarball or through the web code browser.

I modified the smsc47m1 driver so that it now loads but all I get is:

smsc47m1-isa-0500
Adapter: ISA adapter

when I run sensors. Is more work required to handle the fans?

  Changed 8 years ago by khali

The 2.6 smsc47m192 driver lives in the Linux 2.6 kernel tree. lm-sensors itself contains the user-space code, and the 2.4 kernel drivers. It's not going to be of any help to you if you're running a 2.4 kernel though.

I can't answer your second question until you show me what changes you did to the smsc47m1 driver, which kernel you are using, how you installed lm-sensors on your system and what version of lm-sensors you are using.

It appears that the pin configuration registers of the SMSC LPC47M292 differ from those of the other SMSC LPC47M1xx chips, so just adding a new ID to the driver will not be sufficient.

Changed 8 years ago by khali

lm-sensors SVN patch adding support for the SMSC LPC47M292 fan monitoring and control

  Changed 8 years ago by khali

I attached the lm-sensors patch I have come up with. It is untested as I do not have the hardware. The patch applies on top of lm-sensors SVN, please give it a try and report.

follow-up: ↓ 8   Changed 8 years ago by ticket

I've built 2.6.19.1 and loaded smsc47m192. It seems to give sensible temp readings so that's good.

I tried to patch smsc47m1 to include your changes, the module loads but I don't get any fan readings. Could you give me a patch against 2.6.19.1? Thanks.

in reply to: ↑ 7 ; follow-up: ↓ 9   Changed 8 years ago by khali

Replying to ticket:

I've built 2.6.19.1 and loaded smsc47m192. It seems to give sensible temp readings so that's good. I tried to patch smsc47m1 to include your changes, the module loads but I don't get any fan readings. Could you give me a patch against 2.6.19.1? Thanks.

This is getting confusing. In comment 2 you asked about 2.4 kernel support, and now you mention a 2.6.19.1 kernel. What kernel branch are you interested in exactly? And 2.6.19.1 is pretty old by now, 2.6.19.4 and 2.6.20.1 are already out.

Please keep in mind that fan support will require that you patch and recompile the user space support, as my patch was doing, even with a 2.6 kernel. If "sensors" doesn't display the values, it suggests that you are using an old version of sensors and/or libsensors. You can check which versions you are using with "sensors -v".

I am not going to write a kernel 2.6 patch for the smsc47m1 driver if you already did. Let's not duplicate the work. Instead, please attach your work and I'll comment on it.

in reply to: ↑ 8   Changed 8 years ago by ticket

Replying to khali:

This is getting confusing. In comment 2 you asked about 2.4 kernel support, and now you mention a 2.6.19.1 kernel. What kernel branch are you interested in exactly? And 2.6.19.1 is pretty old by now, 2.6.19.4 and 2.6.20.1 are already out.

Apologies for the lack of clarity.

My ultimate goal is a driver on 2.4.20 that gives me fan speeds and temps. I don't expect you to back-port a new driver to 2.4 so I'm trying to get a 2.6 environment working so I can assist you as much as possible. I'll build a more up-to-date kernel, I just happened to have 2.6.19.1 already downloaded.

Please keep in mind that fan support will require that you patch and recompile the user space support, as my patch was doing, even with a 2.6 kernel. If "sensors" doesn't display the values, it suggests that you are using an old version of sensors and/or libsensors. You can check which versions you are using with "sensors -v".

I build a svn snapshot

root@localhost ~]# /usr/local/bin/sensors -v
sensors version 2.10.2-SVN with libsensors version 2.10.2-SVN

I am not going to write a kernel 2.6 patch for the smsc47m1 driver if you already did. Let's not duplicate the work. Instead, please attach your work and I'll comment on it.

I merely tried to hack the vital parts from the patch you posted, it's not worth using as a basis for a real fix.

Changed 8 years ago by khali

LPC47M292 fan support for Linux 2.6

  Changed 8 years ago by khali

Here you go, I attached a patch which should add support for the LPC47M292 to the 2.6 smsc47m1 driver. As before, it is untested as I do not have the hardware. Please give it a try and report.

follow-up: ↓ 12   Changed 8 years ago by ticket

Excellent. I built 2.6.20.1 with your patch, re-built lm_sensors svn and I now get sensible readings for temp and fans.

smsc47m192-i2c-0-2d
Adapter: SMBus I801 adapter at 1100
in0:       +2.49 V  (min =  +3.32 V, max =  +3.32 V)   ALARM
in1:       +0.94 V  (min =  +2.99 V, max =  +2.99 V)   ALARM
in2:       +3.28 V  (min =  +4.38 V, max =  +4.38 V)   ALARM
in3:       +5.03 V  (min =  +6.64 V, max =  +6.64 V)   ALARM
in4:      +11.75 V  (min = +15.94 V, max = +15.94 V)   ALARM
in5:       +3.37 V  (min =  +4.38 V, max =  +4.38 V)   ALARM
in6:       +1.05 V  (min =  +1.99 V, max =  +1.99 V)   ALARM
in7:       +1.36 V  (min =  +2.39 V, max =  +2.39 V)   ALARM
temp1:     +31.0°C  (low  =   -13°C, high =    -1°C)  ALARM
temp2:     +28.0°C  (low  =    -1°C, high =    -1°C)
temp3:     +30.0°C  (low  =    -1°C, high =    -1°C)
vid:      +1.468 V  (VRM Version 1.3)

smsc47m2-isa-0500
Adapter: ISA adapter
fan1:     5851 RPM  (min = 1280 RPM, div = 4)
fan2:     6467 RPM  (min = 1280 RPM, div = 4)

I only have two fans listed, but then I only have two fan headers. Should there be a zero reading for fan3?

How will this be taken forward? Will your patch be integrated into the next release and both drivers need to be loaded? Or will a smsc47m292 driver be created based on smsc47m1 and smsc47m192? Both i2c-isa and i2c-i801 have to be loaded, is that really necessary or is it an artifact of using the separate drivers?

in reply to: ↑ 11   Changed 8 years ago by khali

Replying to ticket:

I only have two fans listed, but then I only have two fan headers. Should there be a zero reading for fan3?

The Linux 2.6 driver only exports the features that are enabled in hardware. If you don't see fan3, it means that the chip was not configured (by the BIOS) to use it. You can compile the smsc47m1 driver with debugging enabled (say Y to "Hardware Monitoring Chip debugging messages") and look at the logs after loading the smsc47m1 driver, it'll tell you which fan inputs and outputs it found to be disabled. If it matches the physical reality, I have no reason to believe there is a problem here.

The Linux 2.4 driver isn't so smart and will forcibly enable the inputs. You'll see a message in the logs when it happens. I think this isn't safe, which is why I opted for a more cautious approach when I ported the driver to Linux 2.6. Maybe I'll change it in the 2.4 driver too for the smsc47m2 type only. Also, all PWM outputs will be presented, whether enabled or not (no reconfiguration for these, though.)

How will this be taken forward? Will your patch be integrated into the next release and both drivers need to be loaded? Or will a smsc47m292 driver be created based on smsc47m1 and smsc47m192? Both i2c-isa and i2c-i801 have to be loaded, is that really necessary or is it an artifact of using the separate drivers?

My plan is to commit exactly the patches I wrote. Writing a brand new driver wouldn't make much sense. We need to have two drivers because the voltage/temperature part is accessed in a completely different way from the fan part (SMBus for the former, LPC/ISA for the latter.) This is how the chip was designed, not our decision. And yes, it explains why you need both i2c-i801 and i2c-isa.

  Changed 8 years ago by ticket

Thanks for your prompt help, now to get a stiff drink and back-port this to 2.4.20 and lm_sensors 2.6.1...

  Changed 8 years ago by khali

  • status changed from assigned to closed
  • resolution set to fixed
  • milestone set to 2.10.3
Note: See TracTickets for help on using tickets.