Revision: linuxbios@linuxbios.org--devel/freebios--devel--2.0--patch-30
[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
8 #define PCI_DEV(BUS, DEV, FN) ( \
9         (((BUS) & 0xFF) << 16) | \
10         (((DEV) & 0x1f) << 11) | \
11         (((FN)  & 0x7) << 8))
12
13 typedef unsigned device_t;
14
15 static void pci_write_config32(device_t dev, unsigned where, unsigned value)
16 {
17         unsigned addr;
18         addr = dev | where;
19         outl(0x80000000 | (addr & ~3), 0xCF8);
20         outl(value, 0xCFC);
21 }
22
23 static unsigned pci_read_config32(device_t dev, unsigned where)
24 {
25         unsigned addr;
26         addr = dev | where;
27         outl(0x80000000 | (addr & ~3), 0xCF8);
28         return inl(0xCFC);
29 }
30
31 #include "../../../northbridge/amd/amdk8/reset_test.c"
32
33 void hard_reset(void)
34 {
35         set_bios_reset();
36         /* Try rebooting through port 0xcf9 */
37         outb((0 <<3)|(0<<2)|(1<<1), 0xcf9);
38         outb((0 <<3)|(1<<2)|(1<<1), 0xcf9);
39 }
40