2 * This file is part of the coreboot project.
4 * Copyright (C) 2009 One Laptop per Child, Association, Inc.
5 * Copyright (C) 2010 coresystems GmbH
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; version 2 of the License.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef NORTHBRIDGE_VIA_VX800_PCI_RAWOPS_H
22 #define NORTHBRIDGE_VIA_VX800_PCI_RAWOPS_H
25 #include <arch/romcc_io.h>
27 struct VIA_PCI_REG_INIT_TABLE {
38 static void pci_modify_config8(device_t dev, unsigned where, u8 orval, u8 mask)
40 u8 data = pci_read_config8(dev, where);
43 pci_write_config8(dev, where, data);
46 static void via_pci_inittable(u8 chipversion,
47 const struct VIA_PCI_REG_INIT_TABLE *initdata)
52 if ((initdata[i].Mask == 0) && (initdata[i].Value == 0)
53 && (initdata[i].Bus == 0)
54 && (initdata[i].ChipRevisionEnd == 0xff)
55 && (initdata[i].ChipRevisionStart == 0)
56 && (initdata[i].Device == 0)
57 && (initdata[i].Function == 0)
58 && (initdata[i].Register == 0))
60 if ((chipversion >= initdata[i].ChipRevisionStart)
61 && (chipversion <= initdata[i].ChipRevisionEnd)) {
63 PCI_DEV(initdata[i].Bus, initdata[i].Device,
64 initdata[i].Function);
65 pci_modify_config8(devbxdxfx,