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 ...@@ -78,6 +78,8 @@ void
nautilus_kill_arch(int mode) nautilus_kill_arch(int mode)
{ {
struct pci_bus *bus = pci_isa_hose->bus; struct pci_bus *bus = pci_isa_hose->bus;
u32 pmuport;
int off;
switch (mode) { switch (mode) {
case LINUX_REBOOT_CMD_RESTART: case LINUX_REBOOT_CMD_RESTART:
...@@ -92,14 +94,18 @@ nautilus_kill_arch(int mode) ...@@ -92,14 +94,18 @@ nautilus_kill_arch(int mode)
break; break;
case LINUX_REBOOT_CMD_POWER_OFF: case LINUX_REBOOT_CMD_POWER_OFF:
{ /* Assume M1543C */
u32 pmuport; off = 0x2000; /* SLP_TYPE = 0, SLP_EN = 1 */
pci_bus_read_config_dword(bus, 0x88, 0x10, &pmuport); pci_bus_read_config_dword(bus, 0x88, 0x10, &pmuport);
pmuport &= 0xfffe; if (!pmuport) {
outl(0xffff, pmuport); /* clear pending events */ /* M1535D/D+ */
outw(0x2000, pmuport+4); /* power off */ off = 0x3400; /* SLP_TYPE = 5, SLP_EN = 1 */
/* NOTREACHED */ pci_bus_read_config_dword(bus, 0x88, 0xe0, &pmuport);
} }
pmuport &= 0xfffe;
outw(0xffff, pmuport); /* Clear pending events. */
outw(off, pmuport + 4);
/* NOTREACHED */
break; 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