Subject: Re: MP, SP, extintr, mc, ofb
To: Dan LaBell <dan4l-nospam@verizon.net>
From: Michael <macallan18@earthlink.net>
List: port-macppc
Date: 12/24/2004 22:14:23
Hello,

> This works!  I was able to see and set the fan related values via 
> sysctl, and force
> the fan on , and off.  I would have tried this much earlier, but I 
> haven't read any
> list email since the 18th, between testing new hardware and holiday 
> shopping. Actually I caught up with email late last night, and thought 
> I was testing a new kernel, but I think I actually just tested the G4 
> again.
Cool :)

> Here's the kernels I've tested:
> netbsd_iBook_G4        ### fan no
should be adt7467 only.

> netbsd_GENERIC_sensors ### fan yes !!!
This one should have support for both, adm1030 and adt7467

> netbsd_GENERIC_12_18_a ### fan no
Umm, none I guess

> netbsd_GENERIC_12_18_b #### fan yes
Should have both.

> All boot OK.
:)

> sysctl -A | grep machdep looks like
> sysctl: machdep.cacheinfo: this type is unknown to this program
> machdep.altivec = 0
> machdep.model = 750FX (Revision 2.2)
> machdep.powersave = 1
> machdep.adm1030c0.temp0 = 76
> machdep.adm1030c0.temp1 = 60
Ok, the threshold values look sort of realistic :)

> Also I get envstat output like:
> CPU temp    CPU temperature   case temperature          fan speed
>      degC               degC               degC                RPM
>      4.00              48.00              50.00            5737500
the first one should be the CPU-internal sensor - has nothing to do with my driver. The RPM value is obviously bogus, so I'll have a look again.

> instead of:
> CPU temp
>      degC
>      4.00
Yup, NetBSD already supports the G3's built-in sensor.

> Fan speed rpm values don't seem real, but I'm  not complaining.
Hmm, I guess I found it - a dumb typo... can't make a new kernel right now because the box is busy but I'll do so in the next few days.
I'm rather surprised that the rest seems to work, given that I had absolutely no way to test it.

> My machine is an ibook g3 12"  2 usb ports 1 firewire.  OF shows  my 
> fan as
> /uni-n/@f8001000/ic2@f8001000/fan@158 , thats pwd after dev 
> /uni-n/ic2/fan (If you need, I noticed fan address was mentioned in 
> thread -- also, it's very nice to learn I could "dev /uni-n/ic2"  I had 
> been trying to type in the addresses and it just would never take them, 
> to my constant frustation. )
The worst part is that the I2C bus address isn't 158 but 58, no idea what the 1 is supposed to do.

> Anyway, its all pretty cool, though I'm not completely understanding 
> temp0 and temp1,
The chip has two temperature sensors, one internal, one external. The first value is the external one - may be attached to the CPU, GPU or whatever, the 2nd one is the internal sensor - should be read as case temperature. You can set separate thresholds for both, the fan will spin up when at least one is reached, spin faster when the temperature raises and stop when it drops to threshold-5C . The CPU-internal sensor counts as the first one, so the second temperature value reported by envstat corresponds to temp0 in sysctl, and is the adm1030's external sensor, the 3rd value is the adm1030's internal sensor and corresponds to temp1. 

> I plan to read the pdf you posted as, right now I'm thinking of them 
> kinda of like as potentiometer inputs, which I know is wrong, but 
> seemed to work intuitively for setting values to temp0 and temp1 and 
> getting the fan to come on, at various speeds.
Both threshold values in degree Celsius - not because I'm still a european but because that's what the chip uses internally. 

have fun
Michael