blob: 5d73e042ed0a15470654a28ad1549cb4a9cbedff [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#include <linux/module.h>
2#include <linux/smp.h>
3#include <linux/delay.h>
4#include <linux/platform.h>
5
6#include <asm/io.h>
7#include "piix4.h"
8
9void (*pm_power_off)(void);
Alexey Dobriyan35e422c2005-07-15 03:56:32 -070010EXPORT_SYMBOL(pm_power_off);
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
Eric W. Biederman36cf4462005-08-06 13:45:10 -060012void machine_shutdown(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070013{
14#ifdef CONFIG_SMP
15 smp_send_stop();
16#endif
Eric W. Biederman36cf4462005-08-06 13:45:10 -060017}
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
Eric W. Biederman36cf4462005-08-06 13:45:10 -060019void machine_emergency_restart(void)
20{
Linus Torvalds1da177e2005-04-16 15:20:36 -070021 /*
22 * Visual Workstations restart after this
23 * register is poked on the PIIX4
24 */
25 outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT);
26}
27
Eric W. Biederman36cf4462005-08-06 13:45:10 -060028void machine_restart(char * __unused)
29{
30 machine_shutdown();
31 machine_emergency_restart();
32}
33
Linus Torvalds1da177e2005-04-16 15:20:36 -070034void machine_power_off(void)
35{
36 unsigned short pm_status;
37 extern unsigned int pci_bus0;
38
39 while ((pm_status = inw(PMSTS_PORT)) & 0x100)
40 outw(pm_status, PMSTS_PORT);
41
42 outw(PM_SUSPEND_ENABLE, PMCNTRL_PORT);
43
44 mdelay(10);
45
46#define PCI_CONF1_ADDRESS(bus, devfn, reg) \
47 (0x80000000 | (bus << 16) | (devfn << 8) | (reg & ~3))
48
49 outl(PCI_CONF1_ADDRESS(pci_bus0, SPECIAL_DEV, SPECIAL_REG), 0xCF8);
50 outl(PIIX_SPECIAL_STOP, 0xCFC);
51}
52
Linus Torvalds1da177e2005-04-16 15:20:36 -070053void machine_halt(void)
54{
55}
56