new macppc sensors

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

new macppc sensors

Theo de Raadt
Now that ipmi(4) and esm(4) on the i386 and amd64 machines are
providing many i386 machines with loads of sensors, it is time
to catch up and provide them on other machines.

Apple's macppc machines have gobs of sensors in them.  Actually, it is
quite amazing.  Apple was obviously an early adopter of i2c devices.
i2c is nasty in that you don't know what device is at which address.
It is less consistant than the ISA bus.  Some newer chips make this easier
though.

But on the macppc machines, one nice thing is that because of the OF
prom we know which devices are where:

Here is a piece of dmesg from a G4 DP Xserve.

    maciic0 at ki2c0
    lmenv0 at maciic0 addr 0xad: LM87 rev 6
    lmtemp0 at maciic0 addr 0x49: LM75
    i2c-hwclock at maciic0 addr 0x65 not configured
    cereal at maciic0 addr 0xe0 not configured
    pi2c0 at adb0
    maciic1 at pi2c0
    pcagpio0 at maciic1 addr 0xa0: 5 inputs 3 outputs
    gpio0 at pcagpio0: 8 pins
    pcagpio1 at maciic1 addr 0xa1: 5 inputs 3 outputs
    gpio1 at pcagpio1: 8 pins
    pcagpio2 at maciic1 addr 0xa2: 5 inputs 3 outputs
    gpio2 at pcagpio2: 8 pins
    pcagpio3 at maciic1 addr 0xa3: 5 inputs 3 outputs
    gpio3 at pcagpio3: 8 pins
    pcagpio4 at maciic1 addr 0xa4: 8 inputs
    gpio4 at pcagpio4: 8 pins
    ki2c1 at macobio0 offset 0x18000
    maciic2 at ki2c1
    cereal at maciic2 addr 0xe0 not configured

That provides us with these sensors:

    hw.sensors.0=lmenv0, +2.5Vin, volts_dc, 2.50 V
    hw.sensors.1=lmenv0, Vccp1, volts_dc, 1.69 V
    hw.sensors.2=lmenv0, +Vcc, volts_dc, 3.33 V
    hw.sensors.3=lmenv0, +5Vin/Vcc, volts_dc, 5.08 V
    hw.sensors.4=lmenv0, +12Vin, volts_dc, 12.19 V
    hw.sensors.5=lmenv0, Vccp2, volts_dc, 1.60 V
    hw.sensors.7=lmenv0, Int. Temp., temp, 27.00 degC / 80.60 degF
    hw.sensors.8=lmenv0, FAN1, fanrpm, 3183 RPM
    hw.sensors.9=lmenv0, FAN2, fanrpm, 3375 RPM
    hw.sensors.10=lmtemp0, TEMP, temp, 25.50 degC / 77.90 degF

On a G5 DP Xserve we see some different devices:

    maciic0 at ki2c0
    i2c-hwclock at maciic0 addr 0x6a not configured
    maxtmp0 at maciic0 addr 0x4c: MAX6690 rev 0x9
    fcu0 at maciic0 addr 0xaf
    pcagpio0 at maciic0 addr 0x18: 8 outputs
    adc0 at maciic0 addr 0x2c
    cpuid at maciic0 addr 0x50 not configured
    pcagpio1 at maciic0 addr 0x19: 8 outputs
    adc1 at maciic0 addr 0x2d
    cpuid at maciic0 addr 0x51 not configured
    cereal at maciic0 addr 0xe0 not configured
    maciic1 at ki2c1
    lmenv0 at maciic1 addr 0x2d: LM87 rev 6
    lmenv1 at maciic1 addr 0x2e: LM87 rev 6
    lmtemp0 at maciic1 addr 0x48: LM75
    power-supply-monitor at maciic1 addr 0x4a not configured
    cereal at maciic1 addr 0xe0 not configured
    maciic2 at pi2c0
    pcagpio2 at maciic2 addr 0xa0: 4 inputs 4 outputs
    pcagpio3 at maciic2 addr 0xa1: 4 inputs 4 outputs
    pcagpio4 at maciic2 addr 0xa2: 4 inputs 4 outputs
    pcagpio5 at maciic2 addr 0xa4: 8 inputs
    lmtemp1 at maciic2 addr 0xcd: LM75
    lmtemp2 at maciic2 addr 0xce: LM75

With an entirely out-of-contro list of sensors:

    hw.sensors.0=maxtmp0, Internal, temp, 20.88 degC / 69.58 degF
    hw.sensors.1=maxtmp0, External, temp, 31.12 degC / 88.03 degF
    hw.sensors.2=fcu0, FAN0, fanrpm, 6500 RPM
    hw.sensors.3=fcu0, FAN1, fanrpm, 6469 RPM
    hw.sensors.4=fcu0, FAN2, fanrpm, 6487 RPM
    hw.sensors.5=fcu0, FAN3, fanrpm, 6494 RPM
    hw.sensors.6=fcu0, FAN4, fanrpm, 6537 RPM
    hw.sensors.7=fcu0, FAN5, fanrpm, 6530 RPM
    hw.sensors.8=fcu0, PWM0, fanrpm, 27 RPM
    hw.sensors.9=fcu0, PWM1, fanrpm, 27 RPM
    hw.sensors.10=adc0, Internal, temp, 18.50 degC / 65.30 degF
    hw.sensors.11=adc0, adc0, raw, 1023
    hw.sensors.12=adc0, adc1, raw, 1023
    hw.sensors.13=adc0, adc2, raw, 1023
    hw.sensors.14=adc0, adc3, raw, 1023
    hw.sensors.15=adc1, Internal, temp, 16.75 degC / 62.15 degF
    hw.sensors.16=adc1, adc0, raw, 1023
    hw.sensors.17=adc1, adc1, raw, 1023
    hw.sensors.18=adc1, adc2, raw, 1023
    hw.sensors.19=adc1, adc3, raw, 1023
    hw.sensors.20=lmenv0, +2.5Vin, volts_dc, 2.62 V
    hw.sensors.21=lmenv0, Vccp1, volts_dc, 1.49 V
    hw.sensors.22=lmenv0, +Vcc, volts_dc, 3.28 V
    hw.sensors.23=lmenv0, +5Vin/Vcc, volts_dc, 5.03 V
    hw.sensors.24=lmenv0, +12Vin, volts_dc, 12.00 V
    hw.sensors.25=lmenv0, Vccp2, volts_dc, 1.20 V
    hw.sensors.27=lmenv0, Int. Temp., temp, 25.00 degC / 77.00 degF
    hw.sensors.28=lmenv0, AIN1, volts_dc, 1.80 V
    hw.sensors.29=lmenv0, AIN2, volts_dc, 1.45 V
    hw.sensors.30=lmenv1, +2.5Vin, volts_dc, 2.60 V
    hw.sensors.31=lmenv1, Vccp1, volts_dc, 3.26 V
    hw.sensors.32=lmenv1, +Vcc, volts_dc, 3.25 V
    hw.sensors.33=lmenv1, +5Vin/Vcc, volts_dc, 5.05 V
    hw.sensors.34=lmenv1, +12Vin, volts_dc, 11.94 V
    hw.sensors.35=lmenv1, Vccp2, volts_dc, 1.18 V
    hw.sensors.37=lmenv1, Int. Temp., temp, 16.00 degC / 60.80 degF
    hw.sensors.38=lmenv1, AIN1, volts_dc, 1.69 V
    hw.sensors.39=lmenv1, AIN2, volts_dc, 1.50 V
    hw.sensors.40=lmtemp0, TEMP, temp, 17.00 degC / 62.60 degF
    hw.sensors.41=lmtemp1, TEMP, temp, 13.50 degC / 56.30 degF
    hw.sensors.42=lmtemp2, TEMP, temp, 12.50 degC / 54.50 degF

The OF tables will actually tell us where each of these devices is
(ie. on a processor, before a processor, after the fan of a processor,
sitting in the drive bay, in the power supply, etc, etc) and what it
maps to, so that we can later on write code to control the speed of
the processors and fans based on the temperature feedback we see.

We also must one day overhaul the way that sensor information is
exported from the kernel, and make sensorsd way more useful.

One day we also want to do sensors on machines where there is no
OF-supplied mapping for where the sensors live (in physical reality,
but also on the rather nasty i2c bus).  But there are some solutions
to these problems.

Some laptops also contain sensors that we support now.  In any case,
try it out.