2 * SNI64 specific PCI support for SNI IO.
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
8 * Copyright (c) 1997, 1998, 2000-2003 Silicon Graphics, Inc. All rights reserved.
10 #include <asm/sn/hcl.h>
11 #include <asm/sn/pci/pcibr_private.h>
14 * These routines are only used during sn_pci_init for probing each bus, and
15 * can probably be removed with a little more cleanup now that the SAL routines
19 extern vertex_hdl_t devfn_to_vertex(unsigned char bus, unsigned char devfn);
21 int sn_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
23 unsigned long res = 0;
24 vertex_hdl_t device_vertex;
26 device_vertex = devfn_to_vertex(bus->number, devfn);
29 return PCIBIOS_DEVICE_NOT_FOUND;
31 res = pciio_config_get(device_vertex, (unsigned)where, size);
33 return PCIBIOS_SUCCESSFUL;
36 int sn_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val)
38 vertex_hdl_t device_vertex;
40 device_vertex = devfn_to_vertex(bus->number, devfn);
43 return PCIBIOS_DEVICE_NOT_FOUND;
45 pciio_config_set(device_vertex, (unsigned)where, size, (uint64_t)val);
46 return PCIBIOS_SUCCESSFUL;
49 struct pci_ops sn_pci_ops = {
50 .read = sn_read_config,
51 .write = sn_write_config,