summaryrefslogtreecommitdiff
path: root/sys/arch/hppa64
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-12-04 17:06:33 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-12-04 17:06:33 +0000
commit4b7076ea351a93ed49ec893da421f6291344206e (patch)
tree8e5937b390074e65576adaef9e87dde05d917958 /sys/arch/hppa64
parenta0570286cbc603d45d495c2ab02e4654ae5c8a90 (diff)
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@
Diffstat (limited to 'sys/arch/hppa64')
-rw-r--r--sys/arch/hppa64/dev/elroy.c11
-rw-r--r--sys/arch/hppa64/include/pci_machdep.h5
2 files changed, 13 insertions, 3 deletions
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) \