415fdae37218d945659970d4079da207a86257f3
[coreboot.git] / src / southbridge / nvidia / ck804 / ck804_reset.c
1 /*
2  * Copyright 2004 Tyan Computer
3  *  by yhlu@tyan.com
4  */
5
6 #include <arch/io.h>
7 #include <reset.h>
8
9 #define PCI_DEV(BUS, DEV, FN) ( \
10         (((BUS) & 0xFFF) << 20) | \
11         (((DEV) & 0x1F) << 15) | \
12         (((FN)  & 0x7) << 12))
13
14 typedef unsigned device_t;
15
16 static void pci_write_config32(device_t dev, unsigned where, unsigned value)
17 {
18         unsigned addr;
19         addr = (dev >> 4) | where;
20         outl(0x80000000 | (addr & ~3), 0xCF8);
21         outl(value, 0xCFC);
22 }
23
24 static unsigned pci_read_config32(device_t dev, unsigned where)
25 {
26         unsigned addr;
27         addr = (dev >> 4) | where;
28         outl(0x80000000 | (addr & ~3), 0xCF8);
29         return inl(0xCFC);
30 }
31
32 #include "../../../northbridge/amd/amdk8/reset_test.c"
33
34 void hard_reset(void)
35 {
36         set_bios_reset();
37         /* Try rebooting through port 0xcf9. */
38         outb((0 << 3) | (0 << 2) | (1 << 1), 0xcf9);
39         outb((0 << 3) | (1 << 2) | (1 << 1), 0xcf9);
40 }