5c5f07c81a7bc5756037a8a9977dd88c9f256c7f
[coreboot.git] / src / southbridge / nvidia / mcp55 / early_ctrl.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2007 AMD
5  * Written by Yinghai Lu <yinghai.lu@amd.com> for AMD.
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
20  */
21
22 #include <reset.h>
23 #include "mcp55.h"
24
25 static unsigned get_sbdn(unsigned bus)
26 {
27         device_t dev;
28
29         /* Find the device.
30          */
31         dev = pci_locate_device_on_bus(
32                 PCI_ID(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_MCP55_HT),
33                 bus);
34
35         return (dev>>15) & 0x1f;
36
37 }
38
39 void soft_reset(void)
40 {
41         set_bios_reset();
42         /* link reset */
43         outb(0x02, 0x0cf9);
44         outb(0x06, 0x0cf9);
45 }
46
47 void hard_reset(void)
48 {
49         set_bios_reset();
50
51         /* full reset */
52         outb(0x0a, 0x0cf9);
53         outb(0x0e, 0x0cf9);
54 }
55
56 void enable_fid_change_on_sb(unsigned sbbusn, unsigned sbdn)
57 {
58         /* default value for mcp55 is good */
59         /* set VFSMAF ( VID/FID System Management Action Field) to 2 */
60 }
61