Subject: Re: Interrupts and many slot machines
To: Nathan J. Williams <nathanw@wasabisystems.com>
From: Michael <macallan18@earthlink.net>
List: port-macppc
Date: 12/12/2004 23:47:25
Hello,

> That said, Apple laptops have more thermal sensors than the one on the
> CPU, so finding them (probably i2c devices with OFW entries somewhere)
> and adding them to envsys would be a nice little project.
Done :)

I'll post patches later they need cleaning. Especially how my driver talks to ki2c - there's absolutely no abstract interface in ki2c, only a bunch of functions, but it works :) The sensor is an ADT7467 which hangs on another ki2c - not the one in obio - so I had to write another pseudo-driver which doesn't do anything besides attaching to mainbus and attach children.
There are three thermal sensors, the order in OF doesn't seem to have any relation to registers in the environmental controller so the labels might be incorrect, one fan and one wired to CPU core voltage. Does 1.58v for an iBook G4 sound realistic?

cpu0 at mainbus0: 7455 (Revision 3.3), ID 0 (primary)
cpu0: HID0 8450c0bc<EMCP,TBEN,NAP,DPM,ICE,DCE,SGE,BTIC,LRSTK,FOLD,BHT>
cpu0: 614.39 MHz, 256KB L2 cache
uni_n0 at mainbus0 offset f8000000
uni_n0: node ff95b408
hw-clock at uni_n0 not configured
ki2c0 at uni_n0 offset 0xf8001000adt7467c0 at ki2c0 offset 0x15c
adt7467c0: node ff95d178
adt7467c0: found 5 sensors
 1: temperature PWR/MEMORY BOTTOMSIDE
 2: temperature CPU BOTTOMSIDE
 3: temperature GPU ON DIE
 4: voltage CPU CORE
 5: fanspeed REAR MAIN ENCLOSURE
i2c-hwclock at ki2c0 offset 0x1d2 not configured
cereal at ki2c0 offset 0x1c0 not configured
...
ki2c1 at obio0
cereal at ki2c1 offset 0x1c0 not configured
deq at ki2c1 offset 0x6a not configured
i2c-modem at ki2c1 not configured

Glenlivet# envstat
 PWR/MEMORY BOTTOMSIDE        CPU BOTTOMSIDE            GPU ON DIE              CPU CORE   REAR MAIN ENCLOSURE
                  degC                  degC                  degC                     V                   RPM
                 52.00                 60.00                 70.00                  1.58                     0
The temperatures seem a little high and I guess the CPU and GPU sensors are swapped, the fan doesn't spin so the 0 there is ok. Maybe I should start it manually to see if I got the right one - the chip can monitor 4 fans.

have fun
Michael