summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-12-04 16:46:36 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-12-04 16:46:36 +0000
commita0570286cbc603d45d495c2ab02e4654ae5c8a90 (patch)
tree32d1a4a160a1c1d841e284b23360e2fde2b4f661 /sys/arch
parentc3f72c348cc45783669a840eaae1af6cae062a15 (diff)
Remove pci configuration space acces hook infrastructure, which got copied
from loongson but isn't necessary on octeon. ok syuu@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/octeon/dev/octeon_pcibus.c57
-rw-r--r--sys/arch/octeon/dev/octeon_pcibusvar.h14
2 files changed, 3 insertions, 68 deletions
diff --git a/sys/arch/octeon/dev/octeon_pcibus.c b/sys/arch/octeon/dev/octeon_pcibus.c
index 73fe805a9d3..91c9b2bf5ea 100644
--- a/sys/arch/octeon/dev/octeon_pcibus.c
+++ b/sys/arch/octeon/dev/octeon_pcibus.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: octeon_pcibus.c,v 1.2 2010/11/23 18:46:29 syuu Exp $ */
-/* $OpenBSD: octeon_pcibus.c,v 1.2 2010/11/23 18:46:29 syuu Exp $ */
+/* $OpenBSD: octeon_pcibus.c,v 1.3 2010/12/04 16:46:35 miod Exp $ */
+/* $OpenBSD: octeon_pcibus.c,v 1.3 2010/12/04 16:46:35 miod Exp $ */
/* $NetBSD: bonito_mainbus.c,v 1.11 2008/04/28 20:23:10 martin Exp $ */
/* $NetBSD: bonito_pci.c,v 1.5 2008/04/28 20:23:28 martin Exp $ */
@@ -84,7 +84,6 @@
int octeon_pcibus_match(struct device *, void *, void *);
void octeon_pcibus_attach(struct device *, struct device *, void *);
int octeon_pcibus_intr_map(int dev, int fn, int pin);
-void octeon_pcibus_pci_attach_hook(pci_chipset_tag_t pc);
const struct cfattach pcibus_ca = {
sizeof(struct octeon_pcibus_softc),
@@ -103,7 +102,6 @@ int octeon_pcibus_bus_maxdevs(void *, int);
pcitag_t octeon_pcibus_make_tag(void *, int, int, int);
void octeon_pcibus_decompose_tag(void *, pcitag_t, int *, int *, int *);
pcireg_t octeon_pcibus_pci_conf_read(void *, pcitag_t, int);
-pcireg_t octeon_pcibus_pci_conf_read_internal(pcitag_t, int);
void octeon_pcibus_pci_conf_write(void *, pcitag_t, int, pcireg_t);
int octeon_pcibus_pci_intr_map(struct pci_attach_args *,
pci_intr_handle_t *);
@@ -211,8 +209,6 @@ octeon_pcibus_attach(struct device *parent, struct device *self, void *aux)
oba = aux;
sc->sc_oba = oba;
- SLIST_INIT(&sc->sc_hook);
-
/*
* Attach PCI bus.
*/
@@ -309,54 +305,9 @@ octeon_pcibus_decompose_tag(void *unused, pcitag_t tag, int *bp, int *dp, int *f
*fp = (tag >> 8) & 0x7;
}
-/* PCI Configuration Space access hook structure */
-struct octeon_pcibus_cfg_hook {
- SLIST_ENTRY(octeon_pcibus_cfg_hook) next;
- int (*read)(void *, pci_chipset_tag_t, pcitag_t, int, pcireg_t *);
- int (*write)(void *, pci_chipset_tag_t, pcitag_t, int, pcireg_t);
- void *cookie;
-};
-
-int
-octeon_pcibus_pci_hook(pci_chipset_tag_t pc, void *cookie,
- int (*r)(void *, pci_chipset_tag_t, pcitag_t, int, pcireg_t *),
- int (*w)(void *, pci_chipset_tag_t, pcitag_t, int, pcireg_t))
-{
- struct octeon_pcibus_softc *sc = pc->pc_conf_v;
- struct octeon_pcibus_cfg_hook *och;
-
- DEBUG_PRINT(("%s:%s:%d:\n", __FILE__, __FUNCTION__, __LINE__));
- och = malloc(sizeof *och, M_DEVBUF, M_NOWAIT);
- if (och == NULL)
- return ENOMEM;
-
- och->read = r;
- och->write = w;
- och->cookie = cookie;
- SLIST_INSERT_HEAD(&sc->sc_hook, och, next);
- return 0;
-}
-
pcireg_t
octeon_pcibus_pci_conf_read(void *v, pcitag_t tag, int offset)
{
- struct octeon_pcibus_softc *sc = v;
- struct octeon_pcibus_cfg_hook *hook;
- pcireg_t data;
-
- SLIST_FOREACH(hook, &sc->sc_hook, next) {
- if (hook->read != NULL &&
- (*hook->read)(hook->cookie, &sc->sc_pc, tag, offset,
- &data) != 0)
- return data;
- }
-
- return octeon_pcibus_pci_conf_read_internal(tag, offset);
-}
-
-pcireg_t
-octeon_pcibus_pci_conf_read_internal(pcitag_t tag, int offset)
-{
pcireg_t data;
uint64_t cfgoff;
@@ -552,10 +503,6 @@ out:
/*
* PCI model specific routines
*/
-void
-octeon_pcibus_pci_attach_hook(pci_chipset_tag_t pc)
-{
-}
int
octeon_pcibus_intr_map(int dev, int fn, int pin)
diff --git a/sys/arch/octeon/dev/octeon_pcibusvar.h b/sys/arch/octeon/dev/octeon_pcibusvar.h
index c66a3959bee..85d5fc1865a 100644
--- a/sys/arch/octeon/dev/octeon_pcibusvar.h
+++ b/sys/arch/octeon/dev/octeon_pcibusvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: octeon_pcibusvar.h,v 1.1 2010/10/28 22:52:10 syuu Exp $ */
+/* $OpenBSD: octeon_pcibusvar.h,v 1.2 2010/12/04 16:46:35 miod Exp $ */
/* $NetBSD: octeon_pcibusvar.h,v 1.4 2008/04/28 20:23:28 martin Exp $ */
/*-
@@ -33,30 +33,18 @@
#ifndef _OCTEON_PCIBUSVAR_H_
#define _OCTEON_PCIBUSVAR_H_
-struct octeon_pcibus_cfg_hook;
struct extent;
-struct octeon_pcibus_config {
- int oc_adbase; /* AD line base for config access */
-};
-
struct octeon_pcibus_softc {
struct device sc_dev;
- const struct octeon_pcibus_config *sc_octeon_pcibus;
struct mips_pci_chipset sc_pc;
struct obio_attach_args *sc_oba;
-
- /* PCI Configuration Space access hooks */
- SLIST_HEAD(, octeon_pcibus_cfg_hook) sc_hook;
};
#ifdef _KERNEL
void octeon_pcibus_intr_disestablish(void *);
void *octeon_pcibus_intr_establish(int, int, int, int (*)(void *), void *,
const char *);
-int octeon_pcibus_pci_hook(pci_chipset_tag_t, void *,
- int (*)(void *, pci_chipset_tag_t, pcitag_t, int, pcireg_t *),
- int (*)(void *, pci_chipset_tag_t, pcitag_t, int, pcireg_t));
int octeon_pcibus_print(void *, const char *);
struct extent
*octeon_pcibus_get_resource_extent(pci_chipset_tag_t, int);