summaryrefslogtreecommitdiffstats
path: root/sys/alpha/pci/apecs_pci.c
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2001-05-23 19:44:17 +0000
committerdfr <dfr@FreeBSD.org>2001-05-23 19:44:17 +0000
commit2434332d91b4f39ff3786b3aab3122174307715e (patch)
tree61074a40ef2eba99c2d03a6241a1a87ab4851204 /sys/alpha/pci/apecs_pci.c
parent3f4e4d353ca694c8535f3410280128fde8e1cc06 (diff)
downloadFreeBSD-src-2434332d91b4f39ff3786b3aab3122174307715e.zip
FreeBSD-src-2434332d91b4f39ff3786b3aab3122174307715e.tar.gz
Make sure that all resource allocation is handled in the pcib device, not
the chipset. This is already how the multi-hose systems handle resource allocation and it fixes a bug where dense and bwx memory allocations were not handled properly. Reviewed by: gallatin
Diffstat (limited to 'sys/alpha/pci/apecs_pci.c')
-rw-r--r--sys/alpha/pci/apecs_pci.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/sys/alpha/pci/apecs_pci.c b/sys/alpha/pci/apecs_pci.c
index 2190748..e18daa6 100644
--- a/sys/alpha/pci/apecs_pci.c
+++ b/sys/alpha/pci/apecs_pci.c
@@ -36,9 +36,13 @@
#include <pci/pcivar.h>
#include <machine/swiz.h>
#include <machine/md_var.h>
+#include <machine/rpb.h>
+#include <machine/resource.h>
#include <alpha/pci/apecsreg.h>
#include <alpha/pci/apecsvar.h>
+#include <alpha/pci/pcibus.h>
+#include <alpha/isa/isavar.h>
#include "alphapci_if.h"
#include "pcib_if.h"
@@ -52,6 +56,7 @@ apecs_pcib_probe(device_t dev)
{
device_set_desc(dev, "2107x PCI host bus adapter");
+ pci_init_resources();
device_add_child(dev, "pci", 0);
return 0;
@@ -67,6 +72,29 @@ apecs_pcib_read_ivar(device_t dev, device_t child, int which, u_long *result)
return ENOENT;
}
+static struct resource *
+apecs_pcib_alloc_resource(device_t bus, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ if ((hwrpb->rpb_type == ST_DEC_2100_A50) &&
+ (type == SYS_RES_IRQ))
+ return isa_alloc_intr(bus, child, start);
+ else
+ return pci_alloc_resource(bus, child, type, rid,
+ start, end, count, flags);
+}
+
+static int
+apecs_pcib_release_resource(device_t bus, device_t child, int type, int rid,
+ struct resource *r)
+{
+ if ((hwrpb->rpb_type == ST_DEC_2100_A50) &&
+ (type == SYS_RES_IRQ))
+ return isa_release_intr(bus, child, r);
+ else
+ return pci_release_resource(bus, child, type, rid, r);
+}
+
static void *
apecs_pcib_cvt_dense(device_t dev, vm_offset_t addr)
{
@@ -175,10 +203,10 @@ static device_method_t apecs_pcib_methods[] = {
/* Bus interface */
DEVMETHOD(bus_print_child, bus_generic_print_child),
DEVMETHOD(bus_read_ivar, apecs_pcib_read_ivar),
- DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
- DEVMETHOD(bus_release_resource, bus_generic_release_resource),
- DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
- DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_alloc_resource, apecs_pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, apecs_pcib_release_resource),
+ DEVMETHOD(bus_activate_resource, pci_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource),
DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
OpenPOWER on IntegriCloud