Solaris ACPI power-off driver

(First release, Dec 9th, 2003)
Updated Dec 20th, 2003

I have done a quick hack-job of putting together an ACPI aware driver, for the SOLE PURPOSE of allowing software power-off. eg: to let "init 5" work, and power off your system.

As well as being kinda fun, this is useful if you have a UPS on your system, and you want it to fully shut down, and preserve some amount of run time for the UPS.

Note: This does not support "suspend", "hibernation", or any of the other fancy stuff. It does map all the ACPI registers, so in theory it could be made to handle all the optional extras, but at this point, it does not.

Update, Dec 20th: experimental power-button notification added.

Installing

[Note: you will probably want to make sure 'logging' is set, for your root filesystem. It's always a good idea, but extra good when using acpi_poweroff, due to race conditions in the kernel. ]

Currently, you will need a compiler (any compiler will do: gcc2 is fine)

Extract the tarfile, read the README about how to compile and install it. Once you run "make all", you should ideally just be able to run "./installacpi" as root.

Download the tarfile here

Known compatible chipsets

PCI ID  ACPI register value 
pci8086,1131 0xee00
pci8086,2440 0x800(or 0xe400??)
pci8086,2448 0x800
pci8086,244c 0xee00
pci8086,2480 0x400 (V65x)
pci8086,248c 0x1000
pci8086,24d0 0x800
pci8086,7113 [SPECIAL]

How do you know if you have something compatible? Try this:

/usr/sbin/prtconf -pv|grep ' 0000f800'
If you get a match, you probably have something. The "installacpi" script will try to detect that for you.

If you are REAAALLY adventurous, then look for some kind of 8086,xxxx bridge device, that doesnt have a driver attached to it, and play with that.

Compatability tweaking

Sometimes, you may have something compatible, but you just need to tweak the ACPI register map location. How do you know where it is? Because once you install it the first time, the driver will tell you where it thinks the map should be. Look on your console, or in dmesg output, for something like,
ACPI map is not at acpibase 0x800
If it is something reasonably small and round, like 0x1000, or 0x800, then adjust acpi.conf to match, and try reinstalling the driver.

8086,7113 440BX special directions

Along those lines, the 440BX chipset takes some special tweaking, but can be made to work. The problem is that it is in a different device number/function combination than the newer chipsets, so requires a completely different reg line. That, and it is only ACPI 1. But it seems to work for power-off purposes, at least. Use the following line in acpi.conf:
reg=0x2300,0,0,0,0,0x81002301,0x00000000,0x0000e400,0x00000000,0x00000080;
# or, the following has also been reported:
#reg=0x3b00,0,0,0,0,0x81003b01,0x00000000,0x0000e400,0x00000000,0x00000080;
It also needs the "acpi-version=1;" uncommented.

Overview

If you are curious how it works,then read on.

First, you must install the "acpi" driver. This will 'bind' to an intel chipset, and do a lookup on where the acpi control registers are. If you dont have an intel chipset, or you have one that is unrecognized, it wont work for you out of the box. However, odds are, with a bit of research on your part, you could get it working, since ACPI is suposed to be a standard, an all.

Once the driver is installed, it is then neccessary to install my 'acpi_poweroff' program, to interface to the driver and tell it to flick the switch.

Finally, an adjustment to /etc/inittab is neccessary.

Ideally, running "installacpi" will handle all of this for you, and you dont have to worry about it.

Once that is all set up, then you can now do "init 5" and have the satisfaction of having to reach over to your computer to turn it back on again. Wait, is that a good thing...?


Site: http://www.bolthole.com/solaris/
Author: Philip Brown