Subject: recent commits
To: netbsd-macppc <port-macppc@NetBSD.ORG>
From: Michael <macallan18@earthlink.net>
List: port-macppc
Date: 08/10/2005 12:01:37
--Signature_Wed__10_Aug_2005_12_01_37_-0400_SjTr0ST2uB+jsDky
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hello,

I finally committed the hardware monitoring stuff that's been around for
a while. Here's the dmesg output of my iBook G4:

 NetBSD 3.99.7 (GLENLIVET) #190: Wed Aug 10 11:17:10 EDT 2005
        root@Glenlivet:/data/src/sys/arch/macppc/compile/GLENLIVET
total memory =3D 640 MB
avail memory =3D 611 MB
mainbus0 (root)
cpu0 at mainbus0: 7455 (Revision 3.3), ID 0 (primary)
cpu0: HID0 8450c0bc<EMCP,TBEN,NAP,DPM,ICE,DCE,SGE,BTIC,LRSTK,FOLD,BHT>,
PS=3D1=20
cpu0: 614.39 MHz, 256KB L2 cache
uni_n0 at mainbus0 address 0xf8000000
hw-clock at uni_n0 not configured
ki2c0 at uni_n0 address 0xf8001000
iic0 at ki2c0: I2C bus
adt7467c0 at ki2c0 ADT7467 thermal monitor and fan controller
i2c-hwclock at ki2c0 address 0x1d2 not configured
cereal at ki2c0 address 0x1c0 not configured
uninorth0 at mainbus0
pci0 at uninorth0 bus 0
pci0: i/o space, memory space enabled
pchb0 at pci0 dev 11 function 0
pchb0: Apple Computer UniNorth AGP Bridge (rev. 0x00)
ofb0 at pci0 dev 16 function 0: ATI Technologies product 0x5c63
ofb0: 1024 x 768, 8bpp
wsdisplay0 at ofb0 kbdmux 1: console (std, vt100 emulation)
wsmux1: connecting to wsdisplay0
uninorth1 at mainbus0
pci1 at uninorth1 bus 0
pci1: i/o space, memory space enabled
pchb1 at pci1 dev 11 function 0
pchb1: Apple Computer UniNorth Host-PCI Bridge (rev. 0x00)
Broadcom product 0x4320 (miscellaneous network, revision 0x03) at pci1
dev 18 function 0 not configured obio0 at pci1 dev 23 function 0: addr
0x80000000 zsc0 at obio0 offset 0x13000: irq 22,23
zstty0 at zsc0 channel 0
zstty1 at zsc0 channel 1
snapper0 at obio0 offset 0x10000: irq 30,1,2
adb0 at obio0 offset 0x16000 irq 47: 3 targets
aed0 at adb0 addr 0: ADB Event device
akbd0 at adb0 addr 2: mapped device (196)
wskbd0 at akbd0: console keyboard, using wsdisplay0
ams0 at adb0 addr 3: EMP trackpad <tpad> 4-button, 400 dpi
wsmouse0 at ams0 mux 0
abtn0 at adb0 addr 7: buttons
apm0 at adb0: battery flags 0x5, 97% charged
battery at obio0 offset 0x0 not configured
backlight at obio0 offset 0xf300 not configured
ki2c1 at obio0
iic1 at ki2c1: I2C bus
cereal at ki2c1 address 0x1c0 not configured
deq0 at ki2c1 Apple Digital Equalizer, addr 6a
wdc0 at obio0 offset 0x20000 irq 24: DMA transfer
atabus0 at wdc0 channel 0
ohci0 at pci1 dev 24 function 0: Apple Computer Intrepid USB Controller
(rev. 0x00) ohci0: can't map mem space
ohci1 at pci1 dev 25 function 0: Apple Computer Intrepid USB Controller
(rev. 0x00) ohci1: can't map mem space
ohci2 at pci1 dev 26 function 0: Apple Computer Intrepid USB Controller
(rev. 0x00) ohci2: interrupting at irq 29
ohci2: OHCI version 1.0, legacy support
usb0 at ohci2: USB revision 1.0
uhub0 at usb0
uhub0: Apple Computer OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
ohci3 at pci1 dev 27 function 0: NEC USB Host Controller (rev. 0x43)
ohci3: interrupting at irq 63
ohci3: OHCI version 1.0
usb1 at ohci3: USB revision 1.0
uhub1 at usb1
uhub1: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 3 ports with 3 removable, self powered
ohci4 at pci1 dev 27 function 1: NEC USB Host Controller (rev. 0x43)
ohci4: interrupting at irq 63
ohci4: OHCI version 1.0
usb2 at ohci4: USB revision 1.0
uhub2 at usb2
uhub2: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
ehci0 at pci1 dev 27 function 2: NEC USB Host Controller (rev. 0x04)
ehci0: interrupting at irq 63
ehci0: EHCI version 1.0
ehci0: companion controllers, 3 ports each: ohci3 ohci4
usb3 at ehci0: USB revision 2.0
uhub3 at usb3
uhub3: NEC EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub3: 5 ports with 5 removable, self powered
uninorth2 at mainbus0
pci2 at uninorth2 bus 0
pci2: i/o space, memory space enabled
pchb2 at pci2 dev 11 function 0
pchb2: Apple Computer UniNorth Host-PCI Bridge (rev. 0x00)
wdc1 at pci2 dev 13 function 0: interrupting at irq 39
atabus1 at wdc1 channel 0
fwohci0 at pci2 dev 14 function 0: Apple Computer UniNorth Firewire
(rev. 0x81) fwohci0: interrupting at irq 40
fwohci0: OHCI version 1.10 (ROM=3D0)
fwohci0: No. of Isochronous channels is 8.
fwohci0: EUI64 00:0a:95:ff:fe:e9:5c:ce
fwohci0: Phy 1394a available S400, 1 ports.
fwohci0: Link S400, max_rec 2048 bytes.
ieee1394if0 at fwohci0: IEEE1394 bus
fwip0 at ieee1394if0: IP over IEEE1394
fwohci0: Initiate bus reset
gem0 at pci2 dev 15 function 0: Apple Computer GMAC Ethernet (rev. 0x80)
gem0: interrupting at irq 41
gem0: Ethernet address 00:0a:95:e9:5c:ce, 10KB RX fifo, 4KB TX fifo
bmtphy0 at gem0 phy 0: BCM5221 10/100 media interface, rev. 4
bmtphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fwohci0: node_id=3D0xc800ffc0, gen=3D2, CYCLEMASTER mode
ieee1394if0: 1 nodes, maxhop <=3D 0, cable IRM =3D 0 (me)
ieee1394if0: bus manager 0 (me)
audio0 at snapper0: full duplex
atapibus0 at atabus0: 2 targets
cd0 at atapibus0 drive 0: <MATSHITACD-RW  CW-8123, , CA0T> cdrom
removable cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2
(Ultra/33) cd0(wdc0:0:0): using PIO mode 4, DMA mode 2 (using DMA)
ehci0: handing over low speed device on port 1 to ohci3
uhub3: port 1, device disappeared after reset
uhidev0 at uhub1 port 1 configuration 1 interface 0
uhidev0: Logitech Trackball, rev 1.10/2.20, addr 2, iclass 3/1
ums0 at uhidev0: 3 buttons and Z dir.
wsmouse1 at ums0 mux 0
wd0 at atabus1 drive 0: <FUJITSU MHT2040AT>
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 38154 MB, 77520 cyl, 16 head, 63 sec, 512 bytes/sect x 78140160
sectors wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5
(Ultra/100)=20
wd0(wdc1:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 5
(Ultra/100) (using DMA) boot device: wd0
root on wd0g dumps on wd0b

So, what these changes bring is this:
 ~> envstat -r
         temp0:     49.000 degC
         temp1:     47.000 degC
         temp2:     61.000 degC
      voltage0:      1.589 V
          fan0:          0 RPM

temp0 is the sensor chip's internal thermometer, the others are
external, temp2 apparently monitors the CPU. Voltage0 is core voltage,
fan0 the case fan. The adm1030c driver produces similar output although
it has only one external sensor.

Besides that you'll get:
~> sysctl machdep.adt7467c0
machdep.adt7467c0.temp0 =3D 76
machdep.adt7467c0.temp1 =3D 56
machdep.adt7467c0.temp2 =3D 65

these are temperature thresholds in degree Celsius for each sensor (
that's what the chips use internally ) - when the temperature reaches
the threshold the fan will spin up. It won't allow you to set values >
85C for the CPU sensor ( that's the default ).

And finally:
~> mixerctl -a
monitor.output=3Dspeaker
monitor.master=3D80,80
monitor.dac=3D80,80
monitor.Digi2=3D80,80
monitor.Analog=3D0,0
record.source=3D
record.record=3D0,0
monitor.treble=3D128,0
monitor.bass=3D128,0

The audio chip supports bass and treble controls ( MacOS X
apparently doesn't use them ) - now you can change them
using the monitor.bass and monitor.treble controls. 128 means no change,
0 is -16dB, 255 is +16dB.

So far the following sensor chips are supported:
adt7647c - Analog Devices ADT7467, found in the iBook G4
adm1030c - Analog Devices ADM1030, found in some iBook G3 models
These chips may be found in other Apple machines as well, like some
PowerBooks.

have fun
Michael

--Signature_Wed__10_Aug_2005_12_01_37_-0400_SjTr0ST2uB+jsDky
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (NetBSD)

iQEVAwUBQvok4spnzkX8Yg2nAQJxAgf/QjGB+Di+q76jAjLCQ5uY4yfbEvKEfhd7
mie+LEJeCe3zyd+fGA1P4o2zkk+E+AlLvSfjxXBo0xcpHXKAReeG1D0Np/UGPyY5
qkEYD1rr/tInV0NC9fAhS/DWRHNfy6L17r+YMwXlyfC4ccbkA8mZFb7jdEF7YreY
W2EK5/mAijmgl/OxiLyZZNfUa1hnaQtW1jXbpBKekqW6CP4FxzojBq7Ge018yBP7
BonE6TAWtI2gwV8JuG1YKVp9gWaxXkaBCu9NB4HXc4Bj5sfWqUQj/lMR8JGnLzfa
p5RpN981snNUtR58wZ2nigYQyi9QvTkVgCRUgFB1+6VnmESX2SYIrQ==
=7ko2
-----END PGP SIGNATURE-----

--Signature_Wed__10_Aug_2005_12_01_37_-0400_SjTr0ST2uB+jsDky--