blob: fc311ae7677157f7c3a478dc7e75db00e259e587 [file] [log] [blame]
Morgan Tsai1602dd52007-10-29 21:00:14 +00001/*
Stefan Reinauer7e61e452008-01-18 10:35:56 +00002 * This file is part of the coreboot project.
Morgan Tsai1602dd52007-10-29 21:00:14 +00003 *
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.
Morgan Tsai1602dd52007-10-29 21:00:14 +000016 */
17
Stefan Reinauereea66b72010-04-07 15:32:52 +000018#include <reset.h>
19
Morgan Tsai1602dd52007-10-29 21:00:14 +000020static unsigned get_sbdn(unsigned bus)
21{
22 device_t dev;
23
Carl-Daniel Hailfingera3588922007-11-05 22:21:27 +000024 /* Find the device. */
Morgan Tsai1602dd52007-10-29 21:00:14 +000025 dev = pci_locate_device_on_bus(
Morgan Tsai31e805d2007-11-14 01:34:02 +000026 PCI_ID(PCI_VENDOR_ID_SIS, PCI_DEVICE_ID_SIS_SIS761),
Morgan Tsai1602dd52007-10-29 21:00:14 +000027 bus);
28
29 return (dev>>15) & 0x1f;
Morgan Tsai1602dd52007-10-29 21:00:14 +000030}
31
Stefan Reinauereea66b72010-04-07 15:32:52 +000032void hard_reset(void)
Morgan Tsai1602dd52007-10-29 21:00:14 +000033{
34 set_bios_reset();
35
36 /* full reset */
37 outb(0x0a, 0x0cf9);
38 outb(0x0e, 0x0cf9);
39}
Carl-Daniel Hailfingera3588922007-11-05 22:21:27 +000040
Morgan Tsai1602dd52007-10-29 21:00:14 +000041static void enable_fid_change_on_sb(unsigned sbbusn, unsigned sbdn)
42{
Stefan Reinauereea66b72010-04-07 15:32:52 +000043 /* default value for sis966 is good */
Morgan Tsai1602dd52007-10-29 21:00:14 +000044 /* set VFSMAF ( VID/FID System Management Action Field) to 2 */
Morgan Tsai1602dd52007-10-29 21:00:14 +000045}
46
Stefan Reinauereea66b72010-04-07 15:32:52 +000047void soft_reset(void)
Morgan Tsai1602dd52007-10-29 21:00:14 +000048{
49 set_bios_reset();
Morgan Tsai218c2652007-11-02 16:09:58 +000050
Morgan Tsai1602dd52007-10-29 21:00:14 +000051 /* link reset */
52 outb(0x02, 0x0cf9);
53 outb(0x06, 0x0cf9);
Morgan Tsai218c2652007-11-02 16:09:58 +000054
Morgan Tsai1602dd52007-10-29 21:00:14 +000055}