The AMD dbm690t mainboard uses the it8712f SIO with the
[coreboot.git] / src / mainboard / supermicro / x6dhe_g2 / reset.c
1 #include <arch/io.h>
2 #include <device/pci_def.h>
3 #include <device/pci_ids.h>
4 #ifndef __ROMCC__
5 #include <device/device.h>
6 #define PCI_ID(VENDOR_ID, DEVICE_ID) \
7         ((((DEVICE_ID) & 0xFFFF) << 16) | ((VENDOR_ID) & 0xFFFF))
8 #define PCI_DEV_INVALID 0
9
10 static inline device_t pci_locate_device(unsigned pci_id, device_t from)
11 {
12         return dev_find_device(pci_id >> 16, pci_id & 0xffff, from);
13 }
14 #endif
15
16 void soft_reset(void)
17 {
18         outb(0x04, 0xcf9);
19 }
20 void hard_reset(void)
21 {
22         outb(0x02, 0xcf9);
23         outb(0x06, 0xcf9);
24 }
25 void full_reset(void)
26 {
27         device_t dev;
28         /* Enable power on after power fail... */
29         dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801ER_LPC), 0);
30         if (dev != PCI_DEV_INVALID) {
31                 unsigned byte;
32                 byte = pci_read_config8(dev, 0xa4);
33                 byte &= 0xfe;
34                 pci_write_config8(dev, 0xa4, byte);
35                 
36         }
37         outb(0x0e, 0xcf9);
38 }
39
40