Commit 6922bac4 authored by Ivan Kokshaysky's avatar Ivan Kokshaysky Committed by Richard Henderson

[PATCH] nautilus poweroff

The power management unit on newer 1535D/D+ ALI bridges
(UP1100/UP1500) is quite different to 1543C one on UP1000.
Even though it has the same PCI id and revision number...

This makes poweroff(8) work on UP1100 and UP1500.

Ivan.
parent 63ac2a63
......@@ -78,6 +78,8 @@ void
nautilus_kill_arch(int mode)
{
struct pci_bus *bus = pci_isa_hose->bus;
u32 pmuport;
int off;
switch (mode) {
case LINUX_REBOOT_CMD_RESTART:
......@@ -92,14 +94,18 @@ nautilus_kill_arch(int mode)
break;
case LINUX_REBOOT_CMD_POWER_OFF:
{
u32 pmuport;
pci_bus_read_config_dword(bus, 0x88, 0x10, &pmuport);
pmuport &= 0xfffe;
outl(0xffff, pmuport); /* clear pending events */
outw(0x2000, pmuport+4); /* power off */
/* NOTREACHED */
/* Assume M1543C */
off = 0x2000; /* SLP_TYPE = 0, SLP_EN = 1 */
pci_bus_read_config_dword(bus, 0x88, 0x10, &pmuport);
if (!pmuport) {
/* M1535D/D+ */
off = 0x3400; /* SLP_TYPE = 5, SLP_EN = 1 */
pci_bus_read_config_dword(bus, 0x88, 0xe0, &pmuport);
}
pmuport &= 0xfffe;
outw(0xffff, pmuport); /* Clear pending events. */
outw(off, pmuport + 4);
/* NOTREACHED */
break;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment