2 * This file is part of the coreboot project.
4 * Copyright (C) 2007 Rudolf Marek <r.marek@assembler.cz>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #include <console/console.h>
21 #include <device/device.h>
22 #include <device/pci.h>
23 #include <device/pci_ids.h>
27 * Datasheet: http://www.via.com.tw/en/downloads/datasheets/chipsets/
28 * VT8237R_SouthBridge_Revision2.06_Lead-Free.zip
33 printk_err("NO HARD RESET ON VT8237R! FIX ME!\n");
36 #if CONFIG_DEFAULT_CONSOLE_LOGLEVEL > 7
37 void writeback(struct device *dev, u16 where, u8 what)
41 pci_write_config8(dev, where, what);
42 regval = pci_read_config8(dev, where);
45 print_debug("Writeback to ");
46 print_debug_hex8(where);
47 print_debug("failed ");
48 print_debug_hex8(regval);
49 print_debug("\n "); /* TODO: Drop the space? */
53 void writeback(struct device *dev, u16 where, u8 what)
55 pci_write_config8(dev, where, what);
59 void dump_south(device_t dev)
63 for (i = 0; i < 256; i += 16) {
64 printk_debug("%02x: ", i);
65 for (j = 0; j < 16; j++)
66 printk_debug("%02x ", pci_read_config8(dev, i + j));
71 static void vt8237r_enable(struct device *dev)
73 struct southbridge_via_vt8237r_config *sb =
74 (struct southbridge_via_vt8237r_config *)dev->chip_info;
76 pci_write_config8(dev, 0x50, sb->fn_ctrl_lo);
77 pci_write_config8(dev, 0x51, sb->fn_ctrl_hi);
79 /* TODO: If SATA is disabled, move IDE to fn0 to conform PCI specs. */
82 struct chip_operations southbridge_via_vt8237r_ops = {
83 CHIP_NAME("VIA VT8237R Southbridge")
84 .enable_dev = vt8237r_enable,