From 4b7076ea351a93ed49ec893da421f6291344206e Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sat, 4 Dec 2010 17:06:33 +0000 Subject: Introduce a new pci routine, pci_conf_size(), which returns the size of a given pcitag_t configuration address space. Currently, all pci controllers will return the usual 0x100 bytes of PCI configuration space, but this will eventually change on PCIe-capable controlers. ok kettenis@ --- sys/arch/alpha/pci/apecs_pci.c | 10 +++++++- sys/arch/alpha/pci/cia_pci.c | 10 +++++++- sys/arch/alpha/pci/irongate_pci.c | 10 +++++++- sys/arch/alpha/pci/lca_pci.c | 10 +++++++- sys/arch/alpha/pci/mcpcia_pci.c | 41 ++++++++++++++++++--------------- sys/arch/alpha/pci/pci_machdep.h | 5 +++- sys/arch/alpha/pci/tsp_pci.c | 11 ++++++++- sys/arch/amd64/include/pci_machdep.h | 3 ++- sys/arch/amd64/pci/pci_machdep.c | 8 ++++++- sys/arch/arm/include/pci_machdep.h | 5 +++- sys/arch/arm/xscale/i80321_pci.c | 10 +++++++- sys/arch/hppa/dev/dino.c | 11 +++++++-- sys/arch/hppa/dev/elroy.c | 11 +++++++-- sys/arch/hppa/include/pci_machdep.h | 5 +++- sys/arch/hppa64/dev/elroy.c | 11 +++++++-- sys/arch/hppa64/include/pci_machdep.h | 5 +++- sys/arch/i386/pci/pci_machdep.c | 8 ++++++- sys/arch/i386/pci/pci_machdep.h | 3 ++- sys/arch/landisk/include/pci_machdep.h | 4 +++- sys/arch/loongson/dev/bonito.c | 10 +++++++- sys/arch/loongson/include/pci_machdep.h | 5 +++- sys/arch/macppc/pci/ht.c | 10 +++++++- sys/arch/macppc/pci/mpcpcibus.c | 13 +++++++++-- sys/arch/mvmeppc/pci/mpcpcibr.c | 13 +++++++++-- sys/arch/octeon/dev/octeon_pcibus.c | 16 +++++++++---- sys/arch/octeon/include/pci_machdep.h | 5 +++- sys/arch/powerpc/pci/pci_machdep.h | 5 +++- sys/arch/sgi/pci/macepcibridge.c | 10 +++++++- sys/arch/sgi/pci/pci_machdep.h | 5 +++- sys/arch/sgi/xbow/xbridge.c | 28 +++++++++++++++++++++- sys/arch/sh/dev/shpcic.c | 8 ++++++- sys/arch/sh/dev/shpcicvar.h | 3 ++- sys/arch/socppc/dev/socpcic.c | 10 +++++++- sys/arch/sparc64/dev/pci_machdep.c | 13 ++++++++++- sys/arch/sparc64/dev/psycho.c | 9 +++++++- sys/arch/sparc64/dev/pyro.c | 10 +++++++- sys/arch/sparc64/dev/schizo.c | 10 +++++++- sys/arch/sparc64/dev/vpci.c | 10 +++++++- sys/arch/sparc64/include/pci_machdep.h | 4 +++- sys/dev/pci/pcireg.h | 4 +++- 40 files changed, 316 insertions(+), 66 deletions(-) diff --git a/sys/arch/alpha/pci/apecs_pci.c b/sys/arch/alpha/pci/apecs_pci.c index 9ef26cbf121..a0b5bd1d139 100644 --- a/sys/arch/alpha/pci/apecs_pci.c +++ b/sys/arch/alpha/pci/apecs_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apecs_pci.c,v 1.10 2006/03/26 20:23:08 brad Exp $ */ +/* $OpenBSD: apecs_pci.c,v 1.11 2010/12/04 17:06:31 miod Exp $ */ /* $NetBSD: apecs_pci.c,v 1.10 1996/11/13 21:13:25 cgd Exp $ */ /* @@ -48,6 +48,7 @@ int apecs_bus_maxdevs(void *, int); pcitag_t apecs_make_tag(void *, int, int, int); void apecs_decompose_tag(void *, pcitag_t, int *, int *, int *); +int apecs_conf_size(void *, pcitag_t); pcireg_t apecs_conf_read(void *, pcitag_t, int); void apecs_conf_write(void *, pcitag_t, int, pcireg_t); @@ -62,6 +63,7 @@ apecs_pci_init(pc, v) pc->pc_bus_maxdevs = apecs_bus_maxdevs; pc->pc_make_tag = apecs_make_tag; pc->pc_decompose_tag = apecs_decompose_tag; + pc->pc_conf_size = apecs_conf_size; pc->pc_conf_read = apecs_conf_read; pc->pc_conf_write = apecs_conf_write; } @@ -106,6 +108,12 @@ apecs_decompose_tag(cpv, tag, bp, dp, fp) *fp = (tag >> 8) & 0x7; } +int +apecs_conf_size(void *cpv, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t apecs_conf_read(cpv, tag, offset) void *cpv; diff --git a/sys/arch/alpha/pci/cia_pci.c b/sys/arch/alpha/pci/cia_pci.c index 540d45ff0b0..597d9b9bae3 100644 --- a/sys/arch/alpha/pci/cia_pci.c +++ b/sys/arch/alpha/pci/cia_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cia_pci.c,v 1.11 2006/03/26 20:23:08 brad Exp $ */ +/* $OpenBSD: cia_pci.c,v 1.12 2010/12/04 17:06:31 miod Exp $ */ /* $NetBSD: cia_pci.c,v 1.25 2000/06/29 08:58:46 mrg Exp $ */ /* @@ -46,6 +46,7 @@ int cia_bus_maxdevs(void *, int); pcitag_t cia_make_tag(void *, int, int, int); void cia_decompose_tag(void *, pcitag_t, int *, int *, int *); +int cia_conf_size(void *, pcitag_t); pcireg_t cia_conf_read(void *, pcitag_t, int); void cia_conf_write(void *, pcitag_t, int, pcireg_t); @@ -60,6 +61,7 @@ cia_pci_init(pc, v) pc->pc_bus_maxdevs = cia_bus_maxdevs; pc->pc_make_tag = cia_make_tag; pc->pc_decompose_tag = cia_decompose_tag; + pc->pc_conf_size = cia_conf_size; pc->pc_conf_read = cia_conf_read; pc->pc_conf_write = cia_conf_write; } @@ -104,6 +106,12 @@ cia_decompose_tag(cpv, tag, bp, dp, fp) *fp = (tag >> 8) & 0x7; } +int +cia_conf_size(void *cpv, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t cia_conf_read(cpv, tag, offset) void *cpv; diff --git a/sys/arch/alpha/pci/irongate_pci.c b/sys/arch/alpha/pci/irongate_pci.c index 4fbde0a0474..fb7cf035167 100644 --- a/sys/arch/alpha/pci/irongate_pci.c +++ b/sys/arch/alpha/pci/irongate_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: irongate_pci.c,v 1.5 2008/06/26 05:42:08 ray Exp $ */ +/* $OpenBSD: irongate_pci.c,v 1.6 2010/12/04 17:06:31 miod Exp $ */ /* $NetBSD: irongate_pci.c,v 1.2 2000/06/29 08:58:47 mrg Exp $ */ /*- @@ -53,6 +53,7 @@ int irongate_bus_maxdevs(void *, int); pcitag_t irongate_make_tag(void *, int, int, int); void irongate_decompose_tag(void *, pcitag_t, int *, int *, int *); +int irongate_conf_size(void *, pcitag_t); pcireg_t irongate_conf_read(void *, pcitag_t, int); void irongate_conf_write(void *, pcitag_t, int, pcireg_t); @@ -74,6 +75,7 @@ irongate_pci_init(pci_chipset_tag_t pc, void *v) pc->pc_bus_maxdevs = irongate_bus_maxdevs; pc->pc_make_tag = irongate_make_tag; pc->pc_decompose_tag = irongate_decompose_tag; + pc->pc_conf_size = irongate_conf_size; pc->pc_conf_read = irongate_conf_read; pc->pc_conf_write = irongate_conf_write; } @@ -110,6 +112,12 @@ irongate_decompose_tag(void *ipv, pcitag_t tag, int *bp, int *dp, int *fp) *fp = (tag >> 8) & 0x7; } +int +irongate_conf_size(void *ipv, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t irongate_conf_read(void *ipv, pcitag_t tag, int offset) { diff --git a/sys/arch/alpha/pci/lca_pci.c b/sys/arch/alpha/pci/lca_pci.c index 0aef2d52572..20725619bf8 100644 --- a/sys/arch/alpha/pci/lca_pci.c +++ b/sys/arch/alpha/pci/lca_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lca_pci.c,v 1.9 2006/03/26 20:23:08 brad Exp $ */ +/* $OpenBSD: lca_pci.c,v 1.10 2010/12/04 17:06:31 miod Exp $ */ /* $NetBSD: lca_pci.c,v 1.13 1997/09/02 13:19:35 thorpej Exp $ */ /* @@ -48,6 +48,7 @@ int lca_bus_maxdevs(void *, int); pcitag_t lca_make_tag(void *, int, int, int); void lca_decompose_tag(void *, pcitag_t, int *, int *, int *); +int lca_conf_size(void *, pcitag_t); pcireg_t lca_conf_read(void *, pcitag_t, int); void lca_conf_write(void *, pcitag_t, int, pcireg_t); @@ -62,6 +63,7 @@ lca_pci_init(pc, v) pc->pc_bus_maxdevs = lca_bus_maxdevs; pc->pc_make_tag = lca_make_tag; pc->pc_decompose_tag = lca_decompose_tag; + pc->pc_conf_size = lca_conf_size; pc->pc_conf_read = lca_conf_read; pc->pc_conf_write = lca_conf_write; } @@ -109,6 +111,12 @@ lca_decompose_tag(cpv, tag, bp, dp, fp) *fp = (tag >> 8) & 0x7; } +int +lca_conf_size(void *cpv, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t lca_conf_read(cpv, tag, offset) void *cpv; diff --git a/sys/arch/alpha/pci/mcpcia_pci.c b/sys/arch/alpha/pci/mcpcia_pci.c index ccc0b7b978a..ddc9e00b76c 100644 --- a/sys/arch/alpha/pci/mcpcia_pci.c +++ b/sys/arch/alpha/pci/mcpcia_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mcpcia_pci.c,v 1.1 2007/03/16 21:22:27 robert Exp $ */ +/* $OpenBSD: mcpcia_pci.c,v 1.2 2010/12/04 17:06:31 miod Exp $ */ /* $NetBSD: mcpcia_pci.c,v 1.5 2007/03/04 05:59:11 christos Exp $ */ /* @@ -46,18 +46,14 @@ #define KV(_addr) ((void *)ALPHA_PHYS_TO_K0SEG((_addr))) -static void mcpcia_attach_hook (struct device *, struct device *, - struct pcibus_attach_args *); -static int -mcpcia_bus_maxdevs (void *, int); -static pcitag_t -mcpcia_make_tag (void *, int, int, int); -static void -mcpcia_decompose_tag (void *, pcitag_t, int *, int *, int *); -static pcireg_t -mcpcia_conf_read (void *, pcitag_t, int); -static void -mcpcia_conf_write (void *, pcitag_t, int, pcireg_t); +void mcpcia_attach_hook(struct device *, struct device *, + struct pcibus_attach_args *); +int mcpcia_bus_maxdevs(void *, int); +pcitag_t mcpcia_make_tag(void *, int, int, int); +void mcpcia_decompose_tag(void *, pcitag_t, int *, int *, int *); +int mcpcia_conf_size(void *, pcitag_t); +pcireg_t mcpcia_conf_read(void *, pcitag_t, int); +void mcpcia_conf_write(void *, pcitag_t, int, pcireg_t); void mcpcia_pci_init(pc, v) @@ -69,18 +65,19 @@ mcpcia_pci_init(pc, v) pc->pc_bus_maxdevs = mcpcia_bus_maxdevs; pc->pc_make_tag = mcpcia_make_tag; pc->pc_decompose_tag = mcpcia_decompose_tag; + pc->pc_conf_size = mcpcia_conf_size; pc->pc_conf_read = mcpcia_conf_read; pc->pc_conf_write = mcpcia_conf_write; } -static void +void mcpcia_attach_hook(parent, self, pba) struct device *parent, *self; struct pcibus_attach_args *pba; { } -static int +int mcpcia_bus_maxdevs(cpv, busno) void *cpv; int busno; @@ -88,7 +85,7 @@ mcpcia_bus_maxdevs(cpv, busno) return (MCPCIA_MAXDEV); } -static pcitag_t +pcitag_t mcpcia_make_tag(cpv, b, d, f) void *cpv; int b, d, f; @@ -98,7 +95,7 @@ mcpcia_make_tag(cpv, b, d, f) return (tag); } -static void +void mcpcia_decompose_tag(cpv, tag, bp, dp, fp) void *cpv; pcitag_t tag; @@ -112,7 +109,13 @@ mcpcia_decompose_tag(cpv, tag, bp, dp, fp) *fp = (tag >> 13) & 0x7; } -static pcireg_t +int +mcpcia_conf_size(void *cpv, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + +pcireg_t mcpcia_conf_read(cpv, tag, offset) void *cpv; pcitag_t tag; @@ -143,7 +146,7 @@ mcpcia_conf_read(cpv, tag, offset) return (data); } -static void +void mcpcia_conf_write(cpv, tag, offset, data) void *cpv; pcitag_t tag; diff --git a/sys/arch/alpha/pci/pci_machdep.h b/sys/arch/alpha/pci/pci_machdep.h index 6e20951e387..cbcd10a8fb7 100644 --- a/sys/arch/alpha/pci/pci_machdep.h +++ b/sys/arch/alpha/pci/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.23 2010/06/29 22:08:28 jordan Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.24 2010/12/04 17:06:31 miod Exp $ */ /* $NetBSD: pci_machdep.h,v 1.6 1996/11/19 04:49:21 cgd Exp $ */ /* @@ -56,6 +56,7 @@ struct alpha_pci_chipset { pcitag_t (*pc_make_tag)(void *, int, int, int); void (*pc_decompose_tag)(void *, pcitag_t, int *, int *, int *); + int (*pc_conf_size)(void *, pcitag_t); pcireg_t (*pc_conf_read)(void *, pcitag_t, int); void (*pc_conf_write)(void *, pcitag_t, int, pcireg_t); @@ -96,6 +97,8 @@ int alpha_sysctl_chipset(int *, u_int, char *, size_t *); (*(c)->pc_make_tag)((c)->pc_conf_v, (b), (d), (f)) #define pci_decompose_tag(c, t, bp, dp, fp) \ (*(c)->pc_decompose_tag)((c)->pc_conf_v, (t), (bp), (dp), (fp)) +#define pci_conf_size(c, t) \ + (*(c)->pc_conf_size)((c)->pc_conf_v, (t)) #define pci_conf_read(c, t, r) \ (*(c)->pc_conf_read)((c)->pc_conf_v, (t), (r)) #define pci_conf_write(c, t, r, v) \ diff --git a/sys/arch/alpha/pci/tsp_pci.c b/sys/arch/alpha/pci/tsp_pci.c index 6abcbc7936f..cf06cc49d47 100644 --- a/sys/arch/alpha/pci/tsp_pci.c +++ b/sys/arch/alpha/pci/tsp_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tsp_pci.c,v 1.3 2002/03/14 01:26:27 millert Exp $ */ +/* $OpenBSD: tsp_pci.c,v 1.4 2010/12/04 17:06:31 miod Exp $ */ /* $NetBSD: tsp_pci.c,v 1.1 1999/06/29 06:46:47 ross Exp $ */ /*- @@ -56,6 +56,7 @@ int tsp_bus_maxdevs(void *, int); pcitag_t tsp_make_tag(void *, int, int, int); void tsp_decompose_tag(void *, pcitag_t, int *, int *, int *); +int tsp_conf_size(void *, pcitag_t); pcireg_t tsp_conf_read(void *, pcitag_t, int); void tsp_conf_write(void *, pcitag_t, int, pcireg_t); @@ -69,6 +70,7 @@ tsp_pci_init(pc, v) pc->pc_bus_maxdevs = tsp_bus_maxdevs; pc->pc_make_tag = tsp_make_tag; pc->pc_decompose_tag = tsp_decompose_tag; + pc->pc_conf_size = tsp_conf_size; pc->pc_conf_read = tsp_conf_read; pc->pc_conf_write = tsp_conf_write; } @@ -109,6 +111,13 @@ tsp_decompose_tag(cpv, tag, bp, dp, fp) if (fp != NULL) *fp = (tag >> 8) & 0x7; } + +int +tsp_conf_size(void *cpv, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + /* * Tsunami makes this a lot easier than it used to be, automatically * generating type 0 or type 1 cycles, and quietly returning -1 with diff --git a/sys/arch/amd64/include/pci_machdep.h b/sys/arch/amd64/include/pci_machdep.h index 439a4265213..dc4522b387e 100644 --- a/sys/arch/amd64/include/pci_machdep.h +++ b/sys/arch/amd64/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.15 2010/06/29 22:08:28 jordan Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.16 2010/12/04 17:06:31 miod Exp $ */ /* $NetBSD: pci_machdep.h,v 1.1 2003/02/26 21:26:11 fvdl Exp $ */ /* @@ -74,6 +74,7 @@ int pci_bus_maxdevs(pci_chipset_tag_t, int); pcitag_t pci_make_tag(pci_chipset_tag_t, int, int, int); void pci_decompose_tag(pci_chipset_tag_t, pcitag_t, int *, int *, int *); +int pci_conf_size(pci_chipset_tag_t, pcitag_t); pcireg_t pci_conf_read(pci_chipset_tag_t, pcitag_t, int); void pci_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t); diff --git a/sys/arch/amd64/pci/pci_machdep.c b/sys/arch/amd64/pci/pci_machdep.c index 7c05d359182..db78807429d 100644 --- a/sys/arch/amd64/pci/pci_machdep.c +++ b/sys/arch/amd64/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.36 2010/09/06 19:05:48 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.37 2010/12/04 17:06:31 miod Exp $ */ /* $NetBSD: pci_machdep.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */ /*- @@ -172,6 +172,12 @@ pci_decompose_tag(pci_chipset_tag_t pc, pcitag_t tag, int *bp, int *dp, int *fp) *fp = (tag >> 8) & 0x7; } +int +pci_conf_size(pci_chipset_tag_t pc, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t pci_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg) { diff --git a/sys/arch/arm/include/pci_machdep.h b/sys/arch/arm/include/pci_machdep.h index 9f075e4b56c..0acb4c5de92 100644 --- a/sys/arch/arm/include/pci_machdep.h +++ b/sys/arch/arm/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.8 2010/06/29 22:08:28 jordan Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.9 2010/12/04 17:06:31 miod Exp $ */ /* $NetBSD: pci_machdep.h,v 1.2 2002/05/15 19:23:52 thorpej Exp $ */ /* @@ -60,6 +60,7 @@ struct arm32_pci_chipset { pcitag_t (*pc_make_tag)(void *, int, int, int); void (*pc_decompose_tag)(void *, pcitag_t, int *, int *, int *); + int (*pc_conf_size)(void *, pcitag_t); pcireg_t (*pc_conf_read)(void *, pcitag_t, int); void (*pc_conf_write)(void *, pcitag_t, int, pcireg_t); @@ -83,6 +84,8 @@ struct arm32_pci_chipset { (*(c)->pc_make_tag)((c)->pc_conf_v, (b), (d), (f)) #define pci_decompose_tag(c, t, bp, dp, fp) \ (*(c)->pc_decompose_tag)((c)->pc_conf_v, (t), (bp), (dp), (fp)) +#define pci_conf_size(c, t) \ + (*(c)->pc_conf_size)((c)->pc_conf_v, (t)) #define pci_conf_read(c, t, r) \ (*(c)->pc_conf_read)((c)->pc_conf_v, (t), (r)) #define pci_conf_write(c, t, r, v) \ diff --git a/sys/arch/arm/xscale/i80321_pci.c b/sys/arch/arm/xscale/i80321_pci.c index 94c2ede305a..a1c33ecf8bf 100644 --- a/sys/arch/arm/xscale/i80321_pci.c +++ b/sys/arch/arm/xscale/i80321_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i80321_pci.c,v 1.3 2007/08/06 08:28:09 tom Exp $ */ +/* $OpenBSD: i80321_pci.c,v 1.4 2010/12/04 17:06:31 miod Exp $ */ /* $NetBSD: i80321_pci.c,v 1.7 2005/12/15 01:44:00 briggs Exp $ */ /* @@ -63,6 +63,7 @@ int i80321_pci_bus_maxdevs(void *, int); pcitag_t i80321_pci_make_tag(void *, int, int, int); void i80321_pci_decompose_tag(void *, pcitag_t, int *, int *, int *); +int i80321_pci_conf_size(void *, pcitag_t); pcireg_t i80321_pci_conf_read(void *, pcitag_t, int); void i80321_pci_conf_write(void *, pcitag_t, int, pcireg_t); @@ -83,6 +84,7 @@ i80321_pci_init(pci_chipset_tag_t pc, void *cookie) pc->pc_bus_maxdevs = i80321_pci_bus_maxdevs; pc->pc_make_tag = i80321_pci_make_tag; pc->pc_decompose_tag = i80321_pci_decompose_tag; + pc->pc_conf_size = i80321_pci_conf_size; pc->pc_conf_read = i80321_pci_conf_read; pc->pc_conf_write = i80321_pci_conf_write; @@ -200,6 +202,12 @@ i80321_pci_conf_setup(struct i80321_softc *sc, pcitag_t tag, int offset, return (0); } +int +i80321_pci_conf_size(void *v, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t i80321_pci_conf_read(void *v, pcitag_t tag, int offset) { diff --git a/sys/arch/hppa/dev/dino.c b/sys/arch/hppa/dev/dino.c index 780c39c45e9..8a460806f8e 100644 --- a/sys/arch/hppa/dev/dino.c +++ b/sys/arch/hppa/dev/dino.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dino.c,v 1.28 2010/09/22 02:28:37 jsg Exp $ */ +/* $OpenBSD: dino.c,v 1.29 2010/12/04 17:06:31 miod Exp $ */ /* * Copyright (c) 2003-2005 Michael Shalayeff @@ -160,6 +160,7 @@ void dino_attach_hook(struct device *, struct device *, int dino_maxdevs(void *, int); pcitag_t dino_make_tag(void *, int, int, int); void dino_decompose_tag(void *, pcitag_t, int *, int *, int *); +int dino_conf_size(void *, pcitag_t); pcireg_t dino_conf_read(void *, pcitag_t, int); void dino_conf_write(void *, pcitag_t, int, pcireg_t); int dino_intr_map(struct pci_attach_args *, pci_intr_handle_t *); @@ -317,6 +318,12 @@ dino_decompose_tag(void *v, pcitag_t tag, int *bus, int *dev, int *func) *func= (tag >> 8) & 0x07; } +int +dino_conf_size(void *v, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t dino_conf_read(void *v, pcitag_t tag, int reg) { @@ -1639,7 +1646,7 @@ const struct hppa_bus_dma_tag dino_dmat = { const struct hppa_pci_chipset_tag dino_pc = { NULL, dino_attach_hook, dino_maxdevs, dino_make_tag, dino_decompose_tag, - dino_conf_read, dino_conf_write, + dino_conf_size, dino_conf_read, dino_conf_write, dino_intr_map, dino_intr_string, dino_intr_establish, dino_intr_disestablish, #if NCARDBUS > 0 diff --git a/sys/arch/hppa/dev/elroy.c b/sys/arch/hppa/dev/elroy.c index 62cac84df4f..21631ad4632 100644 --- a/sys/arch/hppa/dev/elroy.c +++ b/sys/arch/hppa/dev/elroy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elroy.c,v 1.7 2010/09/22 02:28:37 jsg Exp $ */ +/* $OpenBSD: elroy.c,v 1.8 2010/12/04 17:06:31 miod Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -63,6 +63,7 @@ int elroy_maxdevs(void *v, int bus); pcitag_t elroy_make_tag(void *v, int bus, int dev, int func); void elroy_decompose_tag(void *v, pcitag_t tag, int *bus, int *dev, int *func); +int elroy_conf_size(void *v, pcitag_t tag); pcireg_t elroy_conf_read(void *v, pcitag_t tag, int reg); void elroy_conf_write(void *v, pcitag_t tag, int reg, pcireg_t data); @@ -237,6 +238,12 @@ elroy_decompose_tag(void *v, pcitag_t tag, int *bus, int *dev, int *func) *func= (tag >> 8) & 0x07; } +int +elroy_conf_size(void *v, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t elroy_conf_read(void *v, pcitag_t tag, int reg) { @@ -1209,7 +1216,7 @@ const struct hppa_bus_dma_tag elroy_dmat = { const struct hppa_pci_chipset_tag elroy_pc = { NULL, elroy_attach_hook, elroy_maxdevs, elroy_make_tag, elroy_decompose_tag, - elroy_conf_read, elroy_conf_write, + elroy_conf_size, elroy_conf_read, elroy_conf_write, apic_intr_map, apic_intr_string, apic_intr_establish, apic_intr_disestablish, #if NCARDBUS > 0 diff --git a/sys/arch/hppa/include/pci_machdep.h b/sys/arch/hppa/include/pci_machdep.h index c04ee8fc628..73362683c44 100644 --- a/sys/arch/hppa/include/pci_machdep.h +++ b/sys/arch/hppa/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.6 2010/06/29 22:08:28 jordan Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.7 2010/12/04 17:06:31 miod Exp $ */ /* * Copyright (c) 2003 Michael Shalayeff @@ -46,6 +46,7 @@ struct hppa_pci_chipset_tag { pcitag_t (*pc_make_tag)(void *, int, int, int); void (*pc_decompose_tag)(void *, pcitag_t, int *, int *, int *); + int (*pc_conf_size)(void *, pcitag_t); pcireg_t (*pc_conf_read)(void *, pcitag_t, int); void (*pc_conf_write)(void *, pcitag_t, int, pcireg_t); @@ -71,6 +72,8 @@ struct hppa_pci_chipset_tag { (*(c)->pc_make_tag)((c)->_cookie, (b), (d), (f)) #define pci_decompose_tag(c, t, bp, dp, fp) \ (*(c)->pc_decompose_tag)((c)->_cookie, (t), (bp), (dp), (fp)) +#define pci_conf_size(c, t) \ + (*(c)->pc_conf_size)((c)->_cookie, (t)) #define pci_conf_read(c, t, r) \ (*(c)->pc_conf_read)((c)->_cookie, (t), (r)) #define pci_conf_write(c, t, r, v) \ diff --git a/sys/arch/hppa64/dev/elroy.c b/sys/arch/hppa64/dev/elroy.c index 1f134ebdddb..3c2c267267c 100644 --- a/sys/arch/hppa64/dev/elroy.c +++ b/sys/arch/hppa64/dev/elroy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elroy.c,v 1.9 2010/09/22 02:28:37 jsg Exp $ */ +/* $OpenBSD: elroy.c,v 1.10 2010/12/04 17:06:31 miod Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -63,6 +63,7 @@ int elroy_maxdevs(void *v, int bus); pcitag_t elroy_make_tag(void *v, int bus, int dev, int func); void elroy_decompose_tag(void *v, pcitag_t tag, int *bus, int *dev, int *func); +int elroy_conf_size(void *v, pcitag_t tag); pcireg_t elroy_conf_read(void *v, pcitag_t tag, int reg); void elroy_conf_write(void *v, pcitag_t tag, int reg, pcireg_t data); @@ -237,6 +238,12 @@ elroy_decompose_tag(void *v, pcitag_t tag, int *bus, int *dev, int *func) *func= (tag >> 8) & 0x07; } +int +elroy_conf_size(void *v, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t elroy_conf_read(void *v, pcitag_t tag, int reg) { @@ -1215,7 +1222,7 @@ const struct hppa64_bus_dma_tag elroy_dmat = { const struct hppa64_pci_chipset_tag elroy_pc = { NULL, elroy_attach_hook, elroy_maxdevs, elroy_make_tag, elroy_decompose_tag, - elroy_conf_read, elroy_conf_write, + elroy_conf_size, elroy_conf_read, elroy_conf_write, apic_intr_map, apic_intr_string, apic_intr_establish, apic_intr_disestablish, #if NCARDBUS > 0 diff --git a/sys/arch/hppa64/include/pci_machdep.h b/sys/arch/hppa64/include/pci_machdep.h index 75727c4b20b..c7936ee9db8 100644 --- a/sys/arch/hppa64/include/pci_machdep.h +++ b/sys/arch/hppa64/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.6 2010/06/29 22:08:28 jordan Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.7 2010/12/04 17:06:31 miod Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -37,6 +37,7 @@ struct hppa64_pci_chipset_tag { pcitag_t (*pc_make_tag)(void *, int, int, int); void (*pc_decompose_tag)(void *, pcitag_t, int *, int *, int *); + int (*pc_conf_size)(void *, pcitag_t); pcireg_t (*pc_conf_read)(void *, pcitag_t, int); void (*pc_conf_write)(void *, pcitag_t, int, pcireg_t); @@ -62,6 +63,8 @@ struct hppa64_pci_chipset_tag { (*(c)->pc_make_tag)((c)->_cookie, (b), (d), (f)) #define pci_decompose_tag(c, t, bp, dp, fp) \ (*(c)->pc_decompose_tag)((c)->_cookie, (t), (bp), (dp), (fp)) +#define pci_conf_size(c, t) \ + (*(c)->pc_conf_size)((c)->_cookie, (t)) #define pci_conf_read(c, t, r) \ (*(c)->pc_conf_read)((c)->_cookie, (t), (r)) #define pci_conf_write(c, t, r, v) \ diff --git a/sys/arch/i386/pci/pci_machdep.c b/sys/arch/i386/pci/pci_machdep.c index d47c18b6e53..15a4e0cbfcd 100644 --- a/sys/arch/i386/pci/pci_machdep.c +++ b/sys/arch/i386/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.54 2010/09/06 19:05:48 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.55 2010/12/04 17:06:31 miod Exp $ */ /* $NetBSD: pci_machdep.c,v 1.28 1997/06/06 23:29:17 thorpej Exp $ */ /*- @@ -260,6 +260,12 @@ pci_decompose_tag(pci_chipset_tag_t pc, pcitag_t tag, int *bp, int *dp, int *fp) } } +int +pci_conf_size(pci_chipset_tag_t pc, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t pci_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg) { diff --git a/sys/arch/i386/pci/pci_machdep.h b/sys/arch/i386/pci/pci_machdep.h index 853792de17d..dcc0f1fa42d 100644 --- a/sys/arch/i386/pci/pci_machdep.h +++ b/sys/arch/i386/pci/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.19 2010/06/29 22:08:28 jordan Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.20 2010/12/04 17:06:31 miod Exp $ */ /* $NetBSD: pci_machdep.h,v 1.7 1997/06/06 23:29:18 thorpej Exp $ */ /* @@ -88,6 +88,7 @@ void pci_attach_hook(struct device *, struct device *, struct pcibus_attach_args *); int pci_bus_maxdevs(pci_chipset_tag_t, int); pcitag_t pci_make_tag(pci_chipset_tag_t, int, int, int); +int pci_conf_size(pci_chipset_tag_t, pcitag_t); pcireg_t pci_conf_read(pci_chipset_tag_t, pcitag_t, int); void pci_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t); diff --git a/sys/arch/landisk/include/pci_machdep.h b/sys/arch/landisk/include/pci_machdep.h index cc24efb610d..589fadae742 100644 --- a/sys/arch/landisk/include/pci_machdep.h +++ b/sys/arch/landisk/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.4 2010/06/29 22:08:28 jordan Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.5 2010/12/04 17:06:31 miod Exp $ */ /* $NetBSD: pci_machdep.h,v 1.1 2006/09/01 21:26:18 uwe Exp $ */ /* @@ -64,6 +64,8 @@ void landisk_pci_conf_interrupt(void *v, int bus, int dev, int pin, shpcic_make_tag(v, bus, dev, func) #define pci_decompose_tag(v, tag, bp, dp, fp) \ shpcic_decompose_tag(v, tag, bp, dp, fp) +#define pci_conf_size(v, tag) \ + shpcic_conf_size(v, tag) #define pci_conf_read(v, tag, reg) \ shpcic_conf_read(v, tag, reg) #define pci_conf_write(v, tag, reg, data) \ diff --git a/sys/arch/loongson/dev/bonito.c b/sys/arch/loongson/dev/bonito.c index 57eac9d0e9e..f09d5acb741 100644 --- a/sys/arch/loongson/dev/bonito.c +++ b/sys/arch/loongson/dev/bonito.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bonito.c,v 1.17 2010/09/20 06:33:48 matthew Exp $ */ +/* $OpenBSD: bonito.c,v 1.18 2010/12/04 17:06:31 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 $ */ @@ -103,6 +103,7 @@ void bonito_attach_hook(struct device *, struct device *, int bonito_bus_maxdevs(void *, int); pcitag_t bonito_make_tag(void *, int, int, int); void bonito_decompose_tag(void *, pcitag_t, int *, int *, int *); +int bonito_conf_size(void *, pcitag_t); pcireg_t bonito_conf_read(void *, pcitag_t, int); pcireg_t bonito_conf_read_internal(const struct bonito_config *, pcitag_t, int); void bonito_conf_write(void *, pcitag_t, int, pcireg_t); @@ -326,6 +327,7 @@ bonito_attach(struct device *parent, struct device *self, void *aux) pc->pc_bus_maxdevs = bonito_bus_maxdevs; pc->pc_make_tag = bonito_make_tag; pc->pc_decompose_tag = bonito_decompose_tag; + pc->pc_conf_size = bonito_conf_size; pc->pc_conf_read = bonito_conf_read; pc->pc_conf_write = bonito_conf_write; @@ -814,6 +816,12 @@ bonito_pci_hook(pci_chipset_tag_t pc, void *cookie, return 0; } +int +bonito_conf_size(void *v, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t bonito_conf_read(void *v, pcitag_t tag, int offset) { diff --git a/sys/arch/loongson/include/pci_machdep.h b/sys/arch/loongson/include/pci_machdep.h index f4af5f559fb..679ad54dcb9 100644 --- a/sys/arch/loongson/include/pci_machdep.h +++ b/sys/arch/loongson/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.3 2010/06/29 22:08:28 jordan Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.4 2010/12/04 17:06:31 miod Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -44,6 +44,7 @@ struct mips_pci_chipset { pcitag_t (*pc_make_tag)(void *, int, int, int); void (*pc_decompose_tag)(void *, pcitag_t, int *, int *, int *); + int (*pc_conf_size)(void *, pcitag_t); pcireg_t (*pc_conf_read)(void *, pcitag_t, int); void (*pc_conf_write)(void *, pcitag_t, int, pcireg_t); @@ -66,6 +67,8 @@ struct mips_pci_chipset { (*(c)->pc_make_tag)((c)->pc_conf_v, (b), (d), (f)) #define pci_decompose_tag(c, t, bp, dp, fp) \ (*(c)->pc_decompose_tag)((c)->pc_conf_v, (t), (bp), (dp), (fp)) +#define pci_conf_size(c, t) \ + (*(c)->pc_conf_size)((c)->pc_conf_v, (t)) #define pci_conf_read(c, t, r) \ (*(c)->pc_conf_read)((c)->pc_conf_v, (t), (r)) #define pci_conf_write(c, t, r, v) \ diff --git a/sys/arch/macppc/pci/ht.c b/sys/arch/macppc/pci/ht.c index 5dfbc851b54..5e258fee95d 100644 --- a/sys/arch/macppc/pci/ht.c +++ b/sys/arch/macppc/pci/ht.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ht.c,v 1.13 2009/08/22 02:54:50 mk Exp $ */ +/* $OpenBSD: ht.c,v 1.14 2010/12/04 17:06:31 miod Exp $ */ /* * Copyright (c) 2005 Mark Kettenis @@ -39,6 +39,7 @@ void ht_attach_hook(struct device *, struct device *, int ht_bus_maxdevs(void *, int); pcitag_t ht_make_tag(void *, int, int, int); void ht_decompose_tag(void *, pcitag_t, int *, int *, int *); +int ht_conf_size(void *, pcitag_t); pcireg_t ht_conf_read(void *, pcitag_t, int); void ht_conf_write(void *, pcitag_t, int, pcireg_t); int ht_intr_map(void *, pcitag_t, int, int, pci_intr_handle_t *); @@ -173,6 +174,7 @@ ht_attach(struct device *parent, struct device *self, void *aux) sc->sc_pc.pc_bus_maxdevs = ht_bus_maxdevs; sc->sc_pc.pc_make_tag = ht_make_tag; sc->sc_pc.pc_decompose_tag = ht_decompose_tag; + sc->sc_pc.pc_conf_size = ht_conf_size; sc->sc_pc.pc_conf_read = ht_conf_read; sc->sc_pc.pc_conf_write = ht_conf_write; @@ -249,6 +251,12 @@ ht_decompose_tag(void *cpv, pcitag_t tag, int *busp, int *devp, int *fncp) *fncp = (tag >> FNC_SHIFT) & 0x7; } +int +ht_conf_size(void *cpv, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t ht_conf_read(void *cpv, pcitag_t tag, int offset) { diff --git a/sys/arch/macppc/pci/mpcpcibus.c b/sys/arch/macppc/pci/mpcpcibus.c index 2b89fabe80e..b6b8a94a43f 100644 --- a/sys/arch/macppc/pci/mpcpcibus.c +++ b/sys/arch/macppc/pci/mpcpcibus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpcpcibus.c,v 1.40 2009/08/22 02:54:50 mk Exp $ */ +/* $OpenBSD: mpcpcibus.c,v 1.41 2010/12/04 17:06:31 miod Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom @@ -61,6 +61,7 @@ void mpc_attach_hook(struct device *, struct device *, int mpc_bus_maxdevs(void *, int); pcitag_t mpc_make_tag(void *, int, int, int); void mpc_decompose_tag(void *, pcitag_t, int *, int *, int *); +int mpc_conf_size(void *, pcitag_t); pcireg_t mpc_conf_read(void *, pcitag_t, int); void mpc_conf_write(void *, pcitag_t, int, pcireg_t); @@ -437,6 +438,7 @@ mpcpcibrattach(struct device *parent, struct device *self, void *aux) lcp->lc_pc.pc_bus_maxdevs = mpc_bus_maxdevs; lcp->lc_pc.pc_make_tag = mpc_make_tag; lcp->lc_pc.pc_decompose_tag = mpc_decompose_tag; + lcp->lc_pc.pc_conf_size = mpc_conf_size; lcp->lc_pc.pc_conf_read = mpc_conf_read; lcp->lc_pc.pc_conf_write = mpc_conf_write; lcp->lc_pc.pc_ether_hw_addr = of_ether_hw_addr; @@ -768,6 +770,12 @@ mpc_gen_config_reg(void *cpv, pcitag_t tag, int offset) return reg; } +int +mpc_conf_size(void *cpv, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + /* #define DEBUG_CONFIG */ pcireg_t mpc_conf_read(void *cpv, pcitag_t tag, int offset) @@ -780,7 +788,8 @@ mpc_conf_read(void *cpv, pcitag_t tag, int offset) faultbuf env; void *oldh; - if (offset & 3 || offset < 0 || offset >= 0x100) { + if (offset & 3 || + offset < 0 || offset >= PCI_CONFIG_SPACE_SIZE) { #ifdef DEBUG_CONFIG printf ("pci_conf_read: bad reg %x\n", offset); #endif /* DEBUG_CONFIG */ diff --git a/sys/arch/mvmeppc/pci/mpcpcibr.c b/sys/arch/mvmeppc/pci/mpcpcibr.c index a2056593b8f..8461a5390f3 100644 --- a/sys/arch/mvmeppc/pci/mpcpcibr.c +++ b/sys/arch/mvmeppc/pci/mpcpcibr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpcpcibr.c,v 1.20 2009/08/22 02:54:50 mk Exp $ */ +/* $OpenBSD: mpcpcibr.c,v 1.21 2010/12/04 17:06:31 miod Exp $ */ /* * Copyright (c) 2001 Steve Murphree, Jr. @@ -65,6 +65,7 @@ void mpc_attach_hook(struct device *, struct device *, int mpc_bus_maxdevs(void *, int); pcitag_t mpc_make_tag(void *, int, int, int); void mpc_decompose_tag(void *, pcitag_t, int *, int *, int *); +int mpc_conf_size(void *, pcitag_t); pcireg_t mpc_conf_read(void *, pcitag_t, int); void mpc_conf_write(void *, pcitag_t, int, pcireg_t); @@ -210,6 +211,7 @@ mpcpcibrattach(parent, self, aux) lcp->lc_pc.pc_bus_maxdevs = mpc_bus_maxdevs; lcp->lc_pc.pc_make_tag = mpc_make_tag; lcp->lc_pc.pc_decompose_tag = mpc_decompose_tag; + lcp->lc_pc.pc_conf_size = mpc_conf_size; lcp->lc_pc.pc_conf_read = mpc_conf_read; lcp->lc_pc.pc_conf_write = mpc_conf_write; lcp->lc_pc.pc_ether_hw_addr = mpc_ether_hw_addr; @@ -381,6 +383,12 @@ mpc_gen_config_reg(cpv, tag, offset) return reg; } +int +mpc_conf_size(void *cpv, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + /*#define DEBUG_CONFIG */ pcireg_t mpc_conf_read(cpv, tag, offset) @@ -396,7 +404,8 @@ mpc_conf_read(cpv, tag, offset) faultbuf env; void *oldh; - if (offset & 3 || offset < 0 || offset >= 0x100) { + if (offset & 3 || + offset < 0 || offset >= PCI_CONFIG_SPACE_SIZE) { #ifdef DEBUG_CONFIG printf ("pci_conf_read: bad reg %x\n", offset); #endif diff --git a/sys/arch/octeon/dev/octeon_pcibus.c b/sys/arch/octeon/dev/octeon_pcibus.c index 91c9b2bf5ea..b5b8bb5ba6e 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.3 2010/12/04 16:46:35 miod Exp $ */ -/* $OpenBSD: octeon_pcibus.c,v 1.3 2010/12/04 16:46:35 miod Exp $ */ +/* $OpenBSD: octeon_pcibus.c,v 1.4 2010/12/04 17:06:31 miod Exp $ */ +/* $OpenBSD: octeon_pcibus.c,v 1.4 2010/12/04 17:06:31 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 $ */ @@ -101,6 +101,7 @@ void octeon_pcibus_attach_hook(struct device *, struct device *, 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 *); +int octeon_pcibus_pci_conf_size(void *, pcitag_t); pcireg_t octeon_pcibus_pci_conf_read(void *, 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 *, @@ -141,7 +142,7 @@ int octeon_pcibus_mem_map(bus_space_tag_t, bus_addr_t, bus_size_t, int, #define _OCTEON_PCIBUS_PCIMEM_BASE 0x80000000 #define _OCTEON_PCIBUS_PCIMEM_SIZE 0x40000000 -bus_space_t octeon_pcibus_pci_io_space_tag = { +struct mips_bus_space octeon_pcibus_pci_io_space_tag = { .bus_base = PHYS_TO_XKPHYS(_OCTEON_PCIBUS_PCIIO_BASE, CCA_NC), .bus_private = NULL, ._space_read_1 = generic_space_read_1, @@ -164,7 +165,7 @@ bus_space_t octeon_pcibus_pci_io_space_tag = { ._space_vaddr = generic_space_vaddr }; -bus_space_t octeon_pcibus_pci_mem_space_tag = { +struct mips_bus_space octeon_pcibus_pci_mem_space_tag = { .bus_base = PHYS_TO_XKPHYS(_OCTEON_PCIBUS_PCIMEM_BASE, CCA_NC), .bus_private = NULL, ._space_read_1 = generic_space_read_1, @@ -218,6 +219,7 @@ octeon_pcibus_attach(struct device *parent, struct device *self, void *aux) sc->sc_pc.pc_decompose_tag = octeon_pcibus_decompose_tag; sc->sc_pc.pc_conf_v = sc; + sc->sc_pc.pc_conf_size = octeon_pcibus_pci_conf_size; sc->sc_pc.pc_conf_read = octeon_pcibus_pci_conf_read; sc->sc_pc.pc_conf_write = octeon_pcibus_pci_conf_write; @@ -305,6 +307,12 @@ octeon_pcibus_decompose_tag(void *unused, pcitag_t tag, int *bp, int *dp, int *f *fp = (tag >> 8) & 0x7; } +int +octeon_pcibus_pci_conf_size(void *v, pcitag_t tag) +{ + return PCI_CONFIGURATION_SPACE_SIZE; +} + pcireg_t octeon_pcibus_pci_conf_read(void *v, pcitag_t tag, int offset) { diff --git a/sys/arch/octeon/include/pci_machdep.h b/sys/arch/octeon/include/pci_machdep.h index 5d506f6e3fc..4964c66a418 100644 --- a/sys/arch/octeon/include/pci_machdep.h +++ b/sys/arch/octeon/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.1 2010/10/28 22:52:10 syuu Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.2 2010/12/04 17:06:31 miod Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -45,6 +45,7 @@ struct mips_pci_chipset { pcitag_t (*pc_make_tag)(void *, int, int, int); void (*pc_decompose_tag)(void *, pcitag_t, int *, int *, int *); + int (*pc_conf_size)(void *, pcitag_t); pcireg_t (*pc_conf_read)(void *, pcitag_t, int); void (*pc_conf_write)(void *, pcitag_t, int, pcireg_t); @@ -70,6 +71,8 @@ struct mips_pci_chipset { #define pci_decompose_tag(c, t, bp, dp, fp) \ (*(c)->pc_decompose_tag)((c)->pc_conf_v, (t), (bp), (dp), (fp)) +#define pci_conf_size(c, t) \ + (*(c)->pc_conf_size)((c)->pc_conf_v, (t)) #ifdef DEBUG_PCI_CONF static inline pcireg_t pci_conf_read_db(void * c, pcitag_t t, int r, char* f,char* func,int l) diff --git a/sys/arch/powerpc/pci/pci_machdep.h b/sys/arch/powerpc/pci/pci_machdep.h index 3868c325c67..79b5080d07c 100644 --- a/sys/arch/powerpc/pci/pci_machdep.h +++ b/sys/arch/powerpc/pci/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.18 2010/06/29 22:08:28 jordan Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.19 2010/12/04 17:06:31 miod Exp $ */ /* * Copyright (c) 1996 Carnegie-Mellon University. @@ -50,6 +50,7 @@ struct ppc_pci_chipset { pcitag_t (*pc_make_tag)(void *, int, int, int); void (*pc_decompose_tag)(void *, pcitag_t, int *, int *, int *); + int (*pc_conf_size)(void *, pcitag_t); pcireg_t (*pc_conf_read)(void *, pcitag_t, int); void (*pc_conf_write)(void *, pcitag_t, int, pcireg_t); @@ -75,6 +76,8 @@ struct ppc_pci_chipset { (*(c)->pc_make_tag)((c)->pc_conf_v, (b), (d), (f)) #define pci_decompose_tag(c, t, bp, dp, fp) \ (*(c)->pc_decompose_tag)((c)->pc_conf_v, (t), (bp), (dp), (fp)) +#define pci_conf_size(c, t) \ + (*(c)->pc_conf_size)((c)->pc_conf_v, (t)) #define pci_conf_read(c, t, r) \ (*(c)->pc_conf_read)((c)->pc_conf_v, (t), (r)) #define pci_conf_write(c, t, r, v) \ diff --git a/sys/arch/sgi/pci/macepcibridge.c b/sys/arch/sgi/pci/macepcibridge.c index 1929f2e1149..0dde121fd35 100644 --- a/sys/arch/sgi/pci/macepcibridge.c +++ b/sys/arch/sgi/pci/macepcibridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: macepcibridge.c,v 1.40 2010/09/22 02:28:37 jsg Exp $ */ +/* $OpenBSD: macepcibridge.c,v 1.41 2010/12/04 17:06:31 miod Exp $ */ /* * Copyright (c) 2009 Miodrag Vallat. @@ -82,6 +82,7 @@ void mace_pcibr_attach_hook(struct device *, struct device *, int mace_pcibr_bus_maxdevs(void *, int); pcitag_t mace_pcibr_make_tag(void *, int, int, int); void mace_pcibr_decompose_tag(void *, pcitag_t, int *, int *, int *); +int mace_pcibr_conf_size(void *, pcitag_t); pcireg_t mace_pcibr_conf_read(void *, pcitag_t, int); void mace_pcibr_conf_write(void *, pcitag_t, int, pcireg_t); int mace_pcibr_get_widget(void *); @@ -239,6 +240,7 @@ mace_pcibrattach(struct device *parent, struct device *self, void *aux) sc->sc_pc.pc_make_tag = mace_pcibr_make_tag; sc->sc_pc.pc_decompose_tag = mace_pcibr_decompose_tag; sc->sc_pc.pc_bus_maxdevs = mace_pcibr_bus_maxdevs; + sc->sc_pc.pc_conf_size = mace_pcibr_conf_size; sc->sc_pc.pc_conf_read = mace_pcibr_conf_read; sc->sc_pc.pc_conf_write = mace_pcibr_conf_write; sc->sc_pc.pc_get_widget = mace_pcibr_get_widget; @@ -365,6 +367,12 @@ mace_pcibr_bus_maxdevs(void *cpv, int busno) return busno == 0 ? 6 : 32; } +int +mace_pcibr_conf_size(void *cpv, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t mace_pcibr_conf_read(void *cpv, pcitag_t tag, int offset) { diff --git a/sys/arch/sgi/pci/pci_machdep.h b/sys/arch/sgi/pci/pci_machdep.h index 51190bca23d..c2a6c8f1093 100644 --- a/sys/arch/sgi/pci/pci_machdep.h +++ b/sys/arch/sgi/pci/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.11 2010/06/29 22:08:29 jordan Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.12 2010/12/04 17:06:31 miod Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -44,6 +44,7 @@ struct mips_pci_chipset { pcitag_t (*pc_make_tag)(void *, int, int, int); void (*pc_decompose_tag)(void *, pcitag_t, int *, int *, int *); + int (*pc_conf_size)(void *, pcitag_t); pcireg_t (*pc_conf_read)(void *, pcitag_t, int); void (*pc_conf_write)(void *, pcitag_t, int, pcireg_t); int (*pc_get_widget)(void *); @@ -75,6 +76,8 @@ struct mips_pci_chipset { (*(c)->pc_make_tag)((c)->pc_conf_v, (b), (d), (f)) #define pci_decompose_tag(c, t, bp, dp, fp) \ (*(c)->pc_decompose_tag)((c)->pc_conf_v, (t), (bp), (dp), (fp)) +#define pci_conf_size(c, t) \ + (*(c)->pc_conf_size)((c)->pc_conf_v, (t)) #define pci_conf_read(c, t, r) \ (*(c)->pc_conf_read)((c)->pc_conf_v, (t), (r)) #define pci_conf_write(c, t, r, v) \ diff --git a/sys/arch/sgi/xbow/xbridge.c b/sys/arch/sgi/xbow/xbridge.c index 1cd92168b9e..88d60a9f9d9 100644 --- a/sys/arch/sgi/xbow/xbridge.c +++ b/sys/arch/sgi/xbow/xbridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xbridge.c,v 1.77 2010/11/27 18:21:05 miod Exp $ */ +/* $OpenBSD: xbridge.c,v 1.78 2010/12/04 17:06:32 miod Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -204,6 +204,7 @@ void xbridge_attach_hook(struct device *, struct device *, int xbridge_bus_maxdevs(void *, int); pcitag_t xbridge_make_tag(void *, int, int, int); void xbridge_decompose_tag(void *, pcitag_t, int *, int *, int *); +int xbridge_conf_size(void *, pcitag_t); pcireg_t xbridge_conf_read(void *, pcitag_t, int); void xbridge_conf_write(void *, pcitag_t, int, pcireg_t); int xbridge_intr_map(struct pci_attach_args *, pci_intr_handle_t *); @@ -580,6 +581,7 @@ xbpci_attach(struct device *parent, struct device *self, void *aux) xb->xb_pc.pc_make_tag = xbridge_make_tag; xb->xb_pc.pc_decompose_tag = xbridge_decompose_tag; xb->xb_pc.pc_bus_maxdevs = xbridge_bus_maxdevs; + xb->xb_pc.pc_conf_size = xbridge_conf_size; xb->xb_pc.pc_conf_read = xbridge_conf_read; xb->xb_pc.pc_conf_write = xbridge_conf_write; xb->xb_pc.pc_get_widget = xbridge_get_widget; @@ -691,6 +693,30 @@ xbridge_bus_maxdevs(void *cookie, int busno) return busno == 0 ? xb->xb_nslots : 32; } +int +xbridge_conf_size(void *cookie, pcitag_t tag) +{ +#if 0 + struct xbpci_softc *xb = cookie; + int bus, dev, fn; + + xbridge_decompose_tag(cookie, tag, &bus, &dev, &fn); + + /* + * IOC3 devices only implement a subset of the PCI configuration + * registers. Although xbridge_conf_{read,write} correctly + * handle the unimplemented registers, better provide a limited + * configuration space to userland. + */ + + if (bus == 0 && xb->xb_devices[dev].id == + PCI_ID_CODE(PCI_VENDOR_SGI, PCI_PRODUCT_SGI_IOC3)) + return PCI_INTERRUPT_REG + 4; +#endif + + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t xbridge_conf_read(void *cookie, pcitag_t tag, int offset) { diff --git a/sys/arch/sh/dev/shpcic.c b/sys/arch/sh/dev/shpcic.c index 6bb9f8487ce..f5b19897d5e 100644 --- a/sys/arch/sh/dev/shpcic.c +++ b/sys/arch/sh/dev/shpcic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shpcic.c,v 1.11 2010/04/04 12:49:30 miod Exp $ */ +/* $OpenBSD: shpcic.c,v 1.12 2010/12/04 17:06:32 miod Exp $ */ /* $NetBSD: shpcic.c,v 1.10 2005/12/24 20:07:32 perry Exp $ */ /* @@ -311,6 +311,12 @@ shpcic_decompose_tag(void *v, pcitag_t tag, int *bp, int *dp, int *fp) *fp = (tag >> 8) & 0x7; } +int +shpcic_conf_size(void *v, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t shpcic_conf_read(void *v, pcitag_t tag, int reg) { diff --git a/sys/arch/sh/dev/shpcicvar.h b/sys/arch/sh/dev/shpcicvar.h index 90c85702d21..16fe1df1779 100644 --- a/sys/arch/sh/dev/shpcicvar.h +++ b/sys/arch/sh/dev/shpcicvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: shpcicvar.h,v 1.5 2010/04/04 12:49:30 miod Exp $ */ +/* $OpenBSD: shpcicvar.h,v 1.6 2010/12/04 17:06:32 miod Exp $ */ /* $NetBSD: shpcicvar.h,v 1.6 2005/12/11 12:18:58 christos Exp $ */ /*- @@ -39,6 +39,7 @@ bus_dma_tag_t shpcic_get_bus_dma_tag(void); int shpcic_bus_maxdevs(void *v, int busno); pcitag_t shpcic_make_tag(void *v, int bus, int device, int function); void shpcic_decompose_tag(void *v, pcitag_t tag, int *bp, int *dp, int *fp); +int shpcic_conf_size(void *, pcitag_t); pcireg_t shpcic_conf_read(void *v, pcitag_t tag, int reg); void shpcic_conf_write(void *v, pcitag_t tag, int reg, pcireg_t data); diff --git a/sys/arch/socppc/dev/socpcic.c b/sys/arch/socppc/dev/socpcic.c index 69836d3b9d4..b01ad2facc3 100644 --- a/sys/arch/socppc/dev/socpcic.c +++ b/sys/arch/socppc/dev/socpcic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: socpcic.c,v 1.8 2009/09/09 20:42:41 kettenis Exp $ */ +/* $OpenBSD: socpcic.c,v 1.9 2010/12/04 17:06:32 miod Exp $ */ /* * Copyright (c) 2008 Mark Kettenis @@ -77,6 +77,7 @@ void socpcic_attach_hook(struct device *, struct device *, int socpcic_bus_maxdevs(void *, int); pcitag_t socpcic_make_tag(void *, int, int, int); void socpcic_decompose_tag(void *, pcitag_t, int *, int *, int *); +int socpcic_conf_size(void *, pcitag_t); pcireg_t socpcic_conf_read(void *, pcitag_t, int); void socpcic_conf_write(void *, pcitag_t, int, pcireg_t); int socpcic_intr_map(void *, pcitag_t, int, int, pci_intr_handle_t *); @@ -239,6 +240,7 @@ socpcic_attach(struct socpcic_softc *sc) sc->sc_pc.pc_bus_maxdevs = socpcic_bus_maxdevs; sc->sc_pc.pc_make_tag = socpcic_make_tag; sc->sc_pc.pc_decompose_tag = socpcic_decompose_tag; + sc->sc_pc.pc_conf_size = socpcic_conf_size; sc->sc_pc.pc_conf_read = socpcic_conf_read; sc->sc_pc.pc_conf_write = socpcic_conf_write; @@ -304,6 +306,12 @@ socpcic_decompose_tag(void *cpv, pcitag_t tag, int *busp, int *devp, int *funp) *funp = (tag >> 8) & 0x7; } +int +socpcic_conf_size(void *cpv, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t socpcic_conf_read(void *cpv, pcitag_t tag, int offset) { diff --git a/sys/arch/sparc64/dev/pci_machdep.c b/sys/arch/sparc64/dev/pci_machdep.c index 1b3200bafc4..964063c2ef5 100644 --- a/sys/arch/sparc64/dev/pci_machdep.c +++ b/sys/arch/sparc64/dev/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.39 2009/08/22 02:54:51 mk Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.40 2010/12/04 17:06:32 miod Exp $ */ /* $NetBSD: pci_machdep.c,v 1.22 2001/07/20 00:07:13 eeh Exp $ */ /* @@ -316,6 +316,17 @@ sparc64_pci_enumerate_bus(struct pci_softc *sc, return (0); } +int +pci_conf_size(pci_chipset_tag_t pc, pcitag_t tag) +{ + int val = 0; + + if (PCITAG_NODE(tag) != -1) + val = pc->conf_size(pc, tag); + + return (val); +} + pcireg_t pci_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg) { diff --git a/sys/arch/sparc64/dev/psycho.c b/sys/arch/sparc64/dev/psycho.c index 82ac64a57c5..6f2d3232cf1 100644 --- a/sys/arch/sparc64/dev/psycho.c +++ b/sys/arch/sparc64/dev/psycho.c @@ -1,4 +1,4 @@ -/* $OpenBSD: psycho.c,v 1.66 2009/03/29 22:52:11 kettenis Exp $ */ +/* $OpenBSD: psycho.c,v 1.67 2010/12/04 17:06:32 miod Exp $ */ /* $NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp $ */ /* @@ -118,6 +118,7 @@ int psycho_intr_map(struct pci_attach_args *, pci_intr_handle_t *); void psycho_identify_pbm(struct psycho_softc *sc, struct psycho_pbm *pp, struct pcibus_attach_args *pa); +int psycho_conf_size(pci_chipset_tag_t, pcitag_t); pcireg_t psycho_conf_read(pci_chipset_tag_t, pcitag_t, int); void psycho_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t); @@ -590,6 +591,7 @@ psycho_attach(struct device *parent, struct device *self, void *aux) pba.pba_memt = sc->sc_psycho_this->pp_memt; pba.pba_pc->bustag = sc->sc_configtag; pba.pba_pc->bushandle = sc->sc_configaddr; + pba.pba_pc->conf_size = psycho_conf_size; pba.pba_pc->conf_read = psycho_conf_read; pba.pba_pc->conf_write = psycho_conf_write; pba.pba_pc->intr_map = psycho_intr_map; @@ -1105,6 +1107,11 @@ psycho_bus_addr(bus_space_tag_t t, bus_space_tag_t t0, bus_space_handle_t h) return (-1); } +int +psycho_conf_size(pci_chipset_tag_t pc, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} pcireg_t psycho_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg) diff --git a/sys/arch/sparc64/dev/pyro.c b/sys/arch/sparc64/dev/pyro.c index 0e9fd571899..2e58939deba 100644 --- a/sys/arch/sparc64/dev/pyro.c +++ b/sys/arch/sparc64/dev/pyro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pyro.c,v 1.18 2009/03/29 22:52:11 kettenis Exp $ */ +/* $OpenBSD: pyro.c,v 1.19 2010/12/04 17:06:32 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -92,6 +92,7 @@ bus_space_tag_t _pyro_alloc_bus_tag(struct pyro_pbm *, const char *, int, int, int); bus_dma_tag_t pyro_alloc_dma_tag(struct pyro_pbm *); +int pyro_conf_size(pci_chipset_tag_t, pcitag_t); pcireg_t pyro_conf_read(pci_chipset_tag_t, pcitag_t, int); void pyro_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t); @@ -220,6 +221,7 @@ pyro_init(struct pyro_softc *sc, int busa) pba.pba_dmat = pbm->pp_dmat; pba.pba_memt = pbm->pp_memt; pba.pba_iot = pbm->pp_iot; + pba.pba_pc->conf_size = pyro_conf_size; pba.pba_pc->conf_read = pyro_conf_read; pba.pba_pc->conf_write = pyro_conf_write; pba.pba_pc->intr_map = pyro_intr_map; @@ -271,6 +273,12 @@ pyro_print(void *aux, const char *p) return (QUIET); } +int +pyro_conf_size(pci_chipset_tag_t pc, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t pyro_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg) { diff --git a/sys/arch/sparc64/dev/schizo.c b/sys/arch/sparc64/dev/schizo.c index 89867b2bd2a..5d6e6ef89c3 100644 --- a/sys/arch/sparc64/dev/schizo.c +++ b/sys/arch/sparc64/dev/schizo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: schizo.c,v 1.60 2009/03/29 22:52:11 kettenis Exp $ */ +/* $OpenBSD: schizo.c,v 1.61 2010/12/04 17:06:32 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -89,6 +89,7 @@ bus_space_tag_t schizo_alloc_bus_tag(struct schizo_pbm *, const char *, int, int, int); bus_dma_tag_t schizo_alloc_dma_tag(struct schizo_pbm *); +int schizo_conf_size(pci_chipset_tag_t, pcitag_t); pcireg_t schizo_conf_read(pci_chipset_tag_t, pcitag_t, int); void schizo_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t); @@ -238,6 +239,7 @@ schizo_init(struct schizo_softc *sc, int busa) pba.pba_dmat = pbm->sp_dmat; pba.pba_memt = pbm->sp_memt; pba.pba_iot = pbm->sp_iot; + pba.pba_pc->conf_size = schizo_conf_size; pba.pba_pc->conf_read = schizo_conf_read; pba.pba_pc->conf_write = schizo_conf_write; pba.pba_pc->intr_map = schizo_intr_map; @@ -460,6 +462,12 @@ schizo_print(void *aux, const char *p) return (QUIET); } +int +schizo_conf_size(pci_chipset_tag_t pc, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t schizo_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg) { diff --git a/sys/arch/sparc64/dev/vpci.c b/sys/arch/sparc64/dev/vpci.c index 327f586c850..ebe37225694 100644 --- a/sys/arch/sparc64/dev/vpci.c +++ b/sys/arch/sparc64/dev/vpci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vpci.c,v 1.4 2009/03/29 22:52:11 kettenis Exp $ */ +/* $OpenBSD: vpci.c,v 1.5 2010/12/04 17:06:32 miod Exp $ */ /* * Copyright (c) 2008 Mark Kettenis * @@ -79,6 +79,7 @@ bus_space_tag_t vpci_alloc_bus_tag(struct vpci_pbm *, const char *, int, int, int); bus_dma_tag_t vpci_alloc_dma_tag(struct vpci_pbm *); +int vpci_conf_size(pci_chipset_tag_t, pcitag_t); pcireg_t vpci_conf_read(pci_chipset_tag_t, pcitag_t, int); void vpci_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t); @@ -167,6 +168,7 @@ vpci_attach(struct device *parent, struct device *self, void *aux) pba.pba_dmat = pbm->vp_dmat; pba.pba_memt = pbm->vp_memt; pba.pba_iot = pbm->vp_iot; + pba.pba_pc->conf_size = vpci_conf_size; pba.pba_pc->conf_read = vpci_conf_read; pba.pba_pc->conf_write = vpci_conf_write; pba.pba_pc->intr_map = vpci_intr_map; @@ -201,6 +203,12 @@ vpci_print(void *aux, const char *p) return (QUIET); } +int +vpci_conf_size(pci_chipset_tag_t pc, pcitag_t tag) +{ + return PCI_CONFIG_SPACE_SIZE; +} + pcireg_t vpci_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg) { diff --git a/sys/arch/sparc64/include/pci_machdep.h b/sys/arch/sparc64/include/pci_machdep.h index 1e6f29e144c..2669493abde 100644 --- a/sys/arch/sparc64/include/pci_machdep.h +++ b/sys/arch/sparc64/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.24 2010/06/29 22:08:29 jordan Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.25 2010/12/04 17:06:32 miod Exp $ */ /* $NetBSD: pci_machdep.h,v 1.7 2001/07/20 00:07:14 eeh Exp $ */ /* @@ -68,6 +68,7 @@ struct sparc_pci_chipset { bus_space_handle_t bushandle; int rootnode; /* PCI controller */ int busnode[256]; + int (*conf_size)(pci_chipset_tag_t, pcitag_t); pcireg_t (*conf_read)(pci_chipset_tag_t, pcitag_t, int); void (*conf_write)(pci_chipset_tag_t, pcitag_t, int, pcireg_t); int (*intr_map)(struct pci_attach_args *, pci_intr_handle_t *); @@ -79,6 +80,7 @@ int pci_bus_maxdevs(pci_chipset_tag_t, int); pcitag_t pci_make_tag(pci_chipset_tag_t, int, int, int); void pci_decompose_tag(pci_chipset_tag_t, pcitag_t, int *, int *, int *); +int pci_conf_size(pci_chipset_tag_t, pcitag_t); pcireg_t pci_conf_read(pci_chipset_tag_t, pcitag_t, int); void pci_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t); diff --git a/sys/dev/pci/pcireg.h b/sys/dev/pci/pcireg.h index 3198a5a2f2c..97eeebdc927 100644 --- a/sys/dev/pci/pcireg.h +++ b/sys/dev/pci/pcireg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcireg.h,v 1.37 2010/12/01 18:47:51 damien Exp $ */ +/* $OpenBSD: pcireg.h,v 1.38 2010/12/04 17:06:29 miod Exp $ */ /* $NetBSD: pcireg.h,v 1.26 2000/05/10 16:58:42 thorpej Exp $ */ /* @@ -40,6 +40,8 @@ * XXX This is not complete. */ +#define PCI_CONFIG_SPACE_SIZE 0x100 + /* * Device identification register; contains a vendor ID and a device ID. */ -- cgit v1.2.3