Boot on Power Restore with a Mac Mini When Using Linux

<img src="http://ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B007477COO&Format=SL250&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=xen02-20" style="all: initial; margin-left: 5px; margin-right: 5px; float: right;" ><img src="http://ir-na.amazon-adsystem.com/e/ir?t=xen02-20&l=as2&o=1&a=B007477COO" alt="" style="all: initial;border: none !important; margin: 0px !important;" border="0" height="1" width="1" >I didn't find this particularly well documented, so for my own reference and others I'm putting together the various pieces I've found regarding having your Mac turn back on and boot when power is restored to the system. Sometime refereed to as "server mode."

First you'll need to identify which chipset your Mac Mini is running:

# lspci
00:00.0 Host bridge: NVIDIA Corporation MCP79 Host Bridge (rev b1)
00:00.1 RAM memory: NVIDIA Corporation MCP79 Memory Controller (rev b1)
00:03.0 ISA bridge: NVIDIA Corporation MCP79 LPC Bridge (rev b2)
00:03.1 RAM memory: NVIDIA Corporation MCP79 Memory Controller (rev b1)
00:03.2 SMBus: NVIDIA Corporation MCP79 SMBus (rev b1)
00:03.3 RAM memory: NVIDIA Corporation MCP79 Memory Controller (rev b1)
00:03.4 RAM memory: NVIDIA Corporation MCP79 Memory Controller (rev b1)
00:03.5 Co-processor: NVIDIA Corporation MCP79 Co-processor (rev b1)
00:04.0 USB controller: NVIDIA Corporation MCP79 OHCI USB 1.1 Controller (rev b1)
00:04.1 USB controller: NVIDIA Corporation MCP79 EHCI USB 2.0 Controller (rev b1)
00:06.0 USB controller: NVIDIA Corporation MCP79 OHCI USB 1.1 Controller (rev b1)
00:06.1 USB controller: NVIDIA Corporation MCP79 EHCI USB 2.0 Controller (rev b1)
00:08.0 Audio device: NVIDIA Corporation MCP79 High Definition Audio (rev b1)
00:09.0 PCI bridge: NVIDIA Corporation MCP79 PCI Bridge (rev b1)
00:0a.0 Ethernet controller: NVIDIA Corporation MCP79 Ethernet (rev b1)
00:0b.0 IDE interface: NVIDIA Corporation MCP79 SATA Controller (rev b1)
00:10.0 PCI bridge: NVIDIA Corporation MCP79 PCI Express Bridge (rev b1)
00:15.0 PCI bridge: NVIDIA Corporation MCP79 PCI Express Bridge (rev b1)
00:16.0 PCI bridge: NVIDIA Corporation MCP79 PCI Express Bridge (rev b1)
02:00.0 VGA compatible controller: NVIDIA Corporation C79 [GeForce 9400] (rev b1)
04:00.0 FireWire (IEEE 1394): LSI Corporation FW643 [TrueFire] PCIe 1394b Controller (rev 07)

You're looking for the PCI address of the ISA Bridge, in this case mine is at 00:03.0 (ISA bridge: NVIDIA Corpotaion MCP79 LPC Bridge (rev b1)). Unfortunately the MCP79 chipset doesn't appear to have much in the way of publicly available documentation. Doing a hex dump of the devices registers yields:

# lspci -s 00:03.0 -vvvxxxx
00:03.0 ISA bridge: NVIDIA Corporation MCP79 LPC Bridge (rev b2)
    Subsystem: NVIDIA Corporation Apple iMac 9,1
    Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap- 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0
    Region 0: I/O ports at 2000 [size=256]
00: de 10 ae 0a 0f 00 a0 00 b2 00 01 06 00 00 80 00
10: 01 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 de 10 79 cb
30: 00 00 00 00 00 00 00 00 00 00 00 00 ff 00 00 00
40: de 10 79 cb 00 00 d0 fe 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 5a 62 02 00 00 00 05 2f 00 3c 02
60: 00 00 00 00 00 00 00 00 00 00 00 00 08 01 01 00
70: 10 00 ff ff cd 00 17 00 00 00 44 59 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 40 03 ff 00 00 00
90: 00 7c 00 00 ff ff 0f 00 00 00 00 00 00 00 00 00
a0: 03 00 00 31 00 00 01 00 00 03 1f 03 00 07 ff 07
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: fd 00 00 00 00 00 00 00 f8 0c 00 fc 00 73 00 30
e0: 83 24 00 2d ac 39 d5 5e 0a 60 da 40 00 00 00 00
f0: 80 00 00 fc fd 00 00 00 10 00 80 80 00 00 00 00

The register we want is at 0x7b and is set to 0x59 by default, which is to remain powered off on power restore. Changing this register to 0x19 will cause the Mac Mini to power on when power is applied:

setpci -s 00:03.0 0x7b.b=19

Unfortunately the value isn't persistent, next time your Mac Mini boots it will revert to the old behavior of remaining off. I put a copy of the setpci command in my rc.local startup script so that it runs on every boot.

If you don't have an NVIDIA based Mac Mini here are the equivalent commands I've found to accomplish the same thing. I haven't tested them, so YMMV.

## PPC Mac Mini
echo server_mode=1 > /proc/pmu/options

## Intel Mac Mini
setpci -s 0:1f.0 0xa4.b=0

## nVidia Mac Mini
setpci -s 00:03.0 0x7b.b=0x19

## Unibody Mac Mini
setpci -s 0:3.0 -0x7b=20

May be not a complete list. I'll add to it if I find more. These commands should work with any system with a matching chipset, in the case of the MCP79 it should also work on a Asus Eee PC 1201NL.

For the Intel Mac Mini I found the documentation of the chipset. Poke around and you can verify the settings for the ISA Bridge at 00:1F