Author Topic: Hardware Monitoring  (Read 4967 times)

Nick Lee

  • Newbie
  • *
  • Posts: 2
    • View Profile
Hardware Monitoring
« on: August 02, 2010, 05:19:59 am »
I'm trying to include the driver for National Semiconductor's LM63 chip in our build and am having trouble getting it to work.  I've selected the following in the kernel configuration:

(*) I2C Support
  (*) I2C Device Interface
  (*) Autoselect Pertinent Helper Modules
(M) Hardware Monitoring Support
  (M) National Semiconductor LM63
(M) Generic Thermal sysfs driver
  (*) Hardware Monitoring Support

In bitbake, I've added kernel-modules and lmsensors-apps.  The latter seems to exclude all the required libraries from the final image, even though they get built - but when I copy them manually to the board, I can run i2cdump, etc.  Running i2cdump on the correct address for the sensor I'm trying to read gives me the temperature, as expected.  However, when I link a program to libsensors (which also has to be copied across manually, which is probably a clue to what the problem is), and attempt to read from the sensor using the interface provided by lmsensors, it fails with an error code which I've traced to the part of the source code that reads from sysfs.  Looking in sysfs, there appears to be no entry for the temperature sensor, though I'm not entirely sure where it should be!  I've done modprobe lm63 and modprobe thermal_sys.

Should there be an entry somewhere in /dev or /sys/fs for the various sensors supported by the LM63 module?
How do I correctly add support for this module in bitbake / kernel config, as I'm convinced there are bits missing?

Hope I've provided enough information - if there is anything missing, please ask!

Ta,

Nick

Nick Lee

  • Newbie
  • *
  • Posts: 2
    • View Profile
Hardware Monitoring
« Reply #1 on: August 03, 2010, 10:11:13 am »
Ok, I've made some progress.  I've added kernel-modules, lmsensors-apps, lmsensors-scripts, libsensors, sysfsutils and various perl modules required by sensors-detect to the bitbake recipe for my image.  I've commented out the PCI detection in sensors-detect, since I don't have /sys/bus/pci on my system.  When I run it it claims I have no sensors.  This is after I've modprobed lm63 (to add a driver for lm96163 chip).  When I run my software against the lmsensors library, I'm managing to get a list of features out of the chip, but can't read a particular feature:

(my debug)
Feature 51: temp1
Feature 52: temp1_high
Feature 57: temp2
Feature 58: temp2_high
Feature 59: temp2_low
Feature 60: temp2_crit
Feature 80: temp2_crit_hyst
Feature 81: alarms
Feature 84: fan1
Feature 87: pwm1
Feature 88: pwm1_enable
Could not get feature: returned -4 (Can't access procfs/sysfs file)

dmesg also comes up with the following on modprobe lm63:

i2c-core: driver [lm63] registered
i2c-adapter i2c-0: found normal entry for adapter 0, addr 0x4c
i2c-adapter i2c-0: master_xfer[0] W, addr=0x4c, len=0
i2c-adapter i2c-0: master_xfer[0] W, addr=0x4c, len=1
i2c-adapter i2c-0: master_xfer[1] R, addr=0x4c, len=1
i2c-adapter i2c-0: master_xfer[0] W, addr=0x4c, len=1
i2c-adapter i2c-0: master_xfer[1] R, addr=0x4c, len=1
i2c-adapter i2c-0: master_xfer[0] W, addr=0x4c, len=1
i2c-adapter i2c-0: master_xfer[1] R, addr=0x4c, len=1
i2c-adapter i2c-0: master_xfer[0] W, addr=0x4c, len=1
i2c-adapter i2c-0: master_xfer[1] R, addr=0x4c, len=1
i2c-adapter i2c-0: master_xfer[0] W, addr=0x4c, len=1
i2c-adapter i2c-0: master_xfer[1] R, addr=0x4c, len=1
i2c-adapter i2c-0: master_xfer[0] W, addr=0x4c, len=1
i2c-adapter i2c-0: master_xfer[1] R, addr=0x4c, len=1
i2c-adapter i2c-0: Unsupported chip (man_id=0x01, chip_id=0x49).

The lmsensors library documentation suggests inserting kernel module i2c-sensors, but as far as I can work out, this hasn't been in the kernel since version 2.6.14.

Hope this means something to somebody and that they can help!

Nick