summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2001-11-18 08:16:15 +0000
committerthorpej <thorpej@NetBSD.org>2001-11-18 08:16:15 +0000
commitbe010c72efb6ee82e89e210d3b104f6a002ab395 (patch)
treec393694e1a9e2445479c0958cf1959f4d7262f48 /sys
parenteeaa44ea8e38a99fcca150628f6f84af266dfacd (diff)
* Clean up HPC autoconfiguration a little. Pass device register and
DMA register offsets, as well as IRQ, to children. Use direct config. Use machine type/subtype to determine which devices are present. * Add support for the second SCSI controller on the Indigo2.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sgimips/dev/zs.c17
-rw-r--r--sys/arch/sgimips/hpc/ds1286.c20
-rw-r--r--sys/arch/sgimips/hpc/hpc.c156
-rw-r--r--sys/arch/sgimips/hpc/hpcdma.c40
-rw-r--r--sys/arch/sgimips/hpc/hpcreg.h18
-rw-r--r--sys/arch/sgimips/hpc/hpcvar.h15
-rw-r--r--sys/arch/sgimips/hpc/if_sq.c29
-rw-r--r--sys/arch/sgimips/hpc/wdsc.c21
8 files changed, 188 insertions, 128 deletions
diff --git a/sys/arch/sgimips/dev/zs.c b/sys/arch/sgimips/dev/zs.c
index cb7601f4e33..db23d02a363 100644
--- a/sys/arch/sgimips/dev/zs.c
+++ b/sys/arch/sgimips/dev/zs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.5 2001/07/08 21:04:50 thorpej Exp $ */
+/* $NetBSD: zs.c,v 1.6 2001/11/18 08:16:15 thorpej Exp $ */
/*-
* Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
@@ -190,7 +190,12 @@ zs_hpc_match(parent, cf, aux)
struct cfdata *cf;
void *aux;
{
- return 1;
+ struct hpc_attach_args *ha = aux;
+
+ if (strcmp(ha->ha_name, cf->cf_driver->cd_name) == 0)
+ return (1);
+
+ return (0);
}
/*
@@ -215,9 +220,9 @@ zs_hpc_attach(parent, self, aux)
promconsdev = ARCBIOS->GetEnvironmentVariable("ConsoleOut");
- zsc->zsc_bustag = haa->ha_iot;
- if ((err = bus_space_subregion(haa->ha_iot, haa->ha_ioh,
- HPC_PBUS_CH6_DEVREGS + 0x30, 0x10,
+ zsc->zsc_bustag = haa->ha_st;
+ if ((err = bus_space_subregion(haa->ha_st, haa->ha_sh,
+ haa->ha_devoff, 0x10,
&zsc->zsc_base)) != 0) {
printf(": unable to map 85c30 registers, error = %d\n", err);
return;
@@ -324,7 +329,7 @@ zs_hpc_attach(parent, self, aux)
zsc->sc_si = softintr_establish(IPL_SOFTSERIAL, zssoft, zsc);
- cpu_intr_establish(29, IPL_TTY, zshard, NULL);
+ cpu_intr_establish(haa->ha_irq, IPL_TTY, zshard, NULL);
/*
* Set the master interrupt enable and interrupt vector.
diff --git a/sys/arch/sgimips/hpc/ds1286.c b/sys/arch/sgimips/hpc/ds1286.c
index a6d20ba4827..c638f2740cb 100644
--- a/sys/arch/sgimips/hpc/ds1286.c
+++ b/sys/arch/sgimips/hpc/ds1286.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ds1286.c,v 1.1 2001/05/11 03:16:59 thorpej Exp $ */
+/* $NetBSD: ds1286.c,v 1.2 2001/11/18 08:16:16 thorpej Exp $ */
/*
* Copyright (c) 2001 Rafal K. Boni
@@ -85,12 +85,14 @@ struct cfattach dsclock_ca = {
static int
-dsclock_match(struct device *parent, struct cfdata *match, void *aux)
+dsclock_match(struct device *parent, struct cfdata *cf, void *aux)
{
- if (mach_type == MACH_SGI_IP22)
- return 1;
- else
- return 0;
+ struct hpc_attach_args *ha = aux;
+
+ if (strcmp(ha->ha_name, cf->cf_driver->cd_name) == 0)
+ return (1);
+
+ return (0);
}
static void
@@ -102,9 +104,9 @@ dsclock_attach(struct device *parent, struct device *self, void *aux)
printf("\n");
- sc->sc_rtct = haa->ha_iot;
- if ((err = bus_space_subregion(haa->ha_iot, haa->ha_ioh,
- 0x60000, 0x1ffff,
+ sc->sc_rtct = haa->ha_st;
+ if ((err = bus_space_subregion(haa->ha_st, haa->ha_sh,
+ haa->ha_devoff, 0x1ffff,
&sc->sc_rtch)) != 0) {
printf(": unable to map RTC registers, error = %d\n", err);
return;
diff --git a/sys/arch/sgimips/hpc/hpc.c b/sys/arch/sgimips/hpc/hpc.c
index 2dee71c26d9..e14b63235e3 100644
--- a/sys/arch/sgimips/hpc/hpc.c
+++ b/sys/arch/sgimips/hpc/hpc.c
@@ -1,8 +1,9 @@
-/* $NetBSD: hpc.c,v 1.2 2001/08/19 03:16:21 wdk Exp $ */
+/* $NetBSD: hpc.c,v 1.3 2001/11/18 08:16:16 thorpej Exp $ */
/*
* Copyright (c) 2000 Soren S. Jorvang
* Copyright (c) 2001 Rafal K. Boni
+ * Copyright (c) 2001 Jason R. Thorpe
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -49,6 +50,48 @@
#include "locators.h"
+const struct hpc_device {
+ const char *hd_name;
+ bus_addr_t hd_devoff;
+ bus_addr_t hd_dmaoff;
+ int hd_irq;
+ int hd_sysmask;
+#define HPCDEV_IP22 (1U << 0) /* Indigo2 */
+#define HPCDEV_IP24 (1U << 1) /* Indy */
+} hpc_devices[] = {
+ { "zsc",
+ /* XXX Magic numbers */
+ HPC_PBUS_CH6_DEVREGS + 0x30, 0,
+ 29,
+ HPCDEV_IP22 | HPCDEV_IP24 },
+
+ { "sq",
+ HPC_ENET_DEVREGS, HPC_ENET_REGS,
+ 3,
+ HPCDEV_IP22 | HPCDEV_IP24 },
+
+ { "wdsc",
+ HPC_SCSI0_DEVREGS, HPC_SCSI0_REGS,
+ 1, /* XXX 1 = IRQ_LOCAL0 + 1 */
+ HPCDEV_IP22 | HPCDEV_IP24 },
+
+ { "wdsc",
+ HPC_SCSI1_DEVREGS, HPC_SCSI1_REGS,
+ 2, /* XXX 2 = IRQ_LOCAL0 + 2 */
+ HPCDEV_IP22 },
+
+ { "dsclock",
+ HPC_PBUS_BBRAM, 0,
+ -1,
+ HPCDEV_IP22 | HPCDEV_IP24 },
+
+ { NULL,
+ 0, 0,
+ 0,
+ 0
+ }
+};
+
struct hpc_softc {
struct device sc_dev;
@@ -64,22 +107,20 @@ extern int mach_boardrev; /* machine board revision, in case it matters */
extern struct sgimips_bus_dma_tag sgimips_default_bus_dma_tag;
-static int hpc_match(struct device *, struct cfdata *, void *);
-static void hpc_attach(struct device *, struct device *, void *);
-static int hpc_print(void *, const char *);
-static int hpc_search(struct device *, struct cfdata *, void *);
+int hpc_match(struct device *, struct cfdata *, void *);
+void hpc_attach(struct device *, struct device *, void *);
+int hpc_print(void *, const char *);
-static int hpc_power_intr(void *);
+int hpc_submatch(struct device *, struct cfdata *, void *);
+
+int hpc_power_intr(void *);
struct cfattach hpc_ca = {
sizeof(struct hpc_softc), hpc_match, hpc_attach
};
-static int
-hpc_match(parent, match, aux)
- struct device *parent;
- struct cfdata *match;
- void *aux;
+int
+hpc_match(struct device *parent, struct cfdata *cf, void *aux)
{
struct gio_attach_args* ga = aux;
@@ -90,26 +131,49 @@ hpc_match(parent, match, aux)
return 1;
}
-static void
-hpc_attach(parent, self, aux)
- struct device *parent;
- struct device *self;
- void *aux;
+void
+hpc_attach(struct device *parent, struct device *self, void *aux)
{
struct hpc_softc *sc = (struct hpc_softc *)self;
struct gio_attach_args* ga = aux;
struct hpc_attach_args ha;
+ const struct hpc_device *hd;
+ int sysmask, hpctype;
- /*
- * XXX
- */
- printf("\n");
+ switch (mach_type) {
+ case MACH_SGI_IP22:
+ hpctype = 3;
+ if (mach_subtype == MACH_SGI_IP22_FULLHOUSE)
+ sysmask = HPCDEV_IP22;
+ else
+ sysmask = HPCDEV_IP24;
+ break;
+
+ default:
+ panic("hpc_attach: can't handle HPC on an IP%d\n",
+ mach_type);
+ };
+
+ printf(": SGI HPC%d\n", hpctype);
sc->sc_ct = 1;
sc->sc_ch = ga->ga_ioh;
sc->sc_base = ga->ga_addr;
- config_search(hpc_search, self, &ha);
+
+ for (hd = hpc_devices; hd->hd_name != NULL; hd++) {
+ ha.ha_name = hd->hd_name;
+ ha.ha_devoff = hd->hd_devoff;
+ ha.ha_dmaoff = hd->hd_dmaoff;
+ ha.ha_irq = hd->hd_irq;
+
+ /* XXX This is disgusting. */
+ ha.ha_st = 1;
+ ha.ha_sh = MIPS_PHYS_TO_KSEG1(sc->sc_base);
+ ha.ha_dmat = &sgimips_default_bus_dma_tag;
+
+ (void) config_found_sm(self, &ha, hpc_print, hpc_submatch);
+ }
/*
* XXXrkb: only true for first HPC, but didn't know where else to
@@ -119,48 +183,33 @@ hpc_attach(parent, self, aux)
cpu_intr_establish(9, IPL_NONE, hpc_power_intr, sc);
}
-static int
-hpc_print(aux, name)
- void *aux;
- const char *name;
+int
+hpc_submatch(struct device *parent, struct cfdata *cf, void *aux)
{
struct hpc_attach_args *ha = aux;
- if (name != 0)
- return QUIET;
+ if (cf->cf_loc[HPCCF_OFFSET] != HPCCF_OFFSET_DEFAULT &&
+ cf->cf_loc[HPCCF_OFFSET] != ha->ha_devoff)
+ return (0);
- if (ha->ha_offset != HPCCF_OFFSET_DEFAULT)
- printf(" offset 0x%lx", ha->ha_offset);
-
- return UNCONF;
+ return ((*cf->cf_attach->ca_match)(parent, cf, aux));
}
-static int
-hpc_search(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct hpc_attach_args *haa = aux;
- struct hpc_softc *sc = (struct hpc_softc *)parent;
-
- do {
- haa->ha_name = cf->cf_driver->cd_name;
- haa->ha_offset = cf->cf_loc[HPCCF_OFFSET];
+int
+hpc_print(void *aux, const char *pnp)
+{
+ struct hpc_attach_args *ha = aux;
- haa->ha_iot = 1; /* XXX */
- haa->ha_ioh = MIPS_PHYS_TO_KSEG1(sc->sc_base);
- haa->ha_dmat = &sgimips_default_bus_dma_tag;
+ if (pnp)
+ printf("%s at %s", ha->ha_name, pnp);
- if ((*cf->cf_attach->ca_match)(parent, cf, haa) > 0)
- config_attach(parent, cf, haa, hpc_print);
- } while (cf->cf_fstate == FSTATE_STAR);
+ printf(" offset 0x%lx", ha->ha_devoff);
- return 0;
+ return (UNCONF);
}
-static int
-hpc_power_intr(void * arg)
+int
+hpc_power_intr(void *arg)
{
u_int32_t pwr_reg;
@@ -170,8 +219,7 @@ hpc_power_intr(void * arg)
printf("hpc_power_intr: panel reg = %08x\n", pwr_reg);
if (pwr_reg & 2)
- cpu_reboot(RB_HALT, NULL);
+ cpu_reboot(RB_HALT, NULL);
return 1;
}
-
diff --git a/sys/arch/sgimips/hpc/hpcdma.c b/sys/arch/sgimips/hpc/hpcdma.c
index 386f68caf01..5014fe853bd 100644
--- a/sys/arch/sgimips/hpc/hpcdma.c
+++ b/sys/arch/sgimips/hpc/hpcdma.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hpcdma.c,v 1.2 2001/11/18 05:14:38 thorpej Exp $ */
+/* $NetBSD: hpcdma.c,v 1.3 2001/11/18 08:16:16 thorpej Exp $ */
/*
* Copyright (c) 2001 Wayne Knowles
@@ -36,6 +36,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+/*
+ * Support for SCSI DMA provided by the HPC.
+ *
+ * Note: We use SCSI0 offsets, etc. here. Since the layout of SCSI0
+ * and SCSI1 are the same, this is no problem.
+ */
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
@@ -49,25 +56,25 @@
/*
* Allocate DMA Chain descriptor list
- *
- * XXX: Need to place in device tree
*/
void
-hpcdma_init(haa, sc, ndesc)
- struct hpc_attach_args *haa;
- struct hpc_dma_softc *sc;
- int ndesc;
+hpcdma_init(struct hpc_attach_args *haa, struct hpc_dma_softc *sc, int ndesc)
{
bus_dma_segment_t seg;
struct hpc_dma_desc *hdd;
int rseg, allocsz;
- sc->sc_bst = haa->ha_iot;
- sc->sc_bsh = haa->ha_ioh;
+ sc->sc_bst = haa->ha_st;
sc->sc_dmat = haa->ha_dmat;
sc->sc_ndesc = ndesc;
sc->sc_flags = 0;
+ if (bus_space_subregion(haa->ha_st, haa->ha_sh, haa->ha_dmaoff,
+ HPC_SCSI0_REGS_SIZE, &sc->sc_bsh) != 0) {
+ printf(": can't map DMA registers\n");
+ return;
+ }
+
/* Alloc 1 additional descriptor - needed for DMA bug fix */
allocsz = sizeof(struct hpc_dma_desc) * (ndesc + 1);
KASSERT(allocsz <= NBPG);
@@ -107,9 +114,7 @@ hpcdma_init(haa, sc, ndesc)
void
-hpcdma_sglist_create(sc, dmamap)
- struct hpc_dma_softc *sc;
- bus_dmamap_t dmamap;
+hpcdma_sglist_create(struct hpc_dma_softc *sc, bus_dmamap_t dmamap)
{
struct hpc_dma_desc *hva, *hpa;
bus_dma_segment_t *segp;
@@ -151,16 +156,14 @@ hpcdma_sglist_create(sc, dmamap)
}
void
-hpcdma_cntl(sc, mode)
- struct hpc_dma_softc *sc;
- u_int32_t mode;
+hpcdma_cntl(struct hpc_dma_softc *sc, uint32_t mode)
{
+
bus_space_write_4(sc->sc_bst, sc->sc_bsh, HPC_SCSI0_CTL, mode);
}
void
-hpcdma_reset(sc)
- struct hpc_dma_softc *sc;
+hpcdma_reset(struct hpc_dma_softc *sc)
{
bus_space_write_4(sc->sc_bst, sc->sc_bsh, HPC_SCSI0_CTL,
@@ -171,8 +174,7 @@ hpcdma_reset(sc)
}
void
-hpcdma_flush(sc)
- struct hpc_dma_softc *sc;
+hpcdma_flush(struct hpc_dma_softc *sc)
{
u_int32_t mode;
diff --git a/sys/arch/sgimips/hpc/hpcreg.h b/sys/arch/sgimips/hpc/hpcreg.h
index e0c89d0873e..d1d6b92d9f5 100644
--- a/sys/arch/sgimips/hpc/hpcreg.h
+++ b/sys/arch/sgimips/hpc/hpcreg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: hpcreg.h,v 1.3 2001/08/19 03:16:22 wdk Exp $ */
+/* $NetBSD: hpcreg.h,v 1.4 2001/11/18 08:16:16 thorpej Exp $ */
/*
* Copyright (c) 2001 Rafal K. Boni
@@ -98,15 +98,15 @@ struct hpc_dma_desc {
#define HPC_SCSI0_REGS 0x00010000 /* SCSI channel 0 registers */
#define HPC_SCSI0_REGS_SIZE 0x00001fff
-#define HPC_SCSI0_CBP 0x00010000 /* Current buffer ptr */
-#define HPC_SCSI0_NDBP 0x00010004 /* Next descriptor ptr */
+#define HPC_SCSI0_CBP 0x00000000 /* Current buffer ptr */
+#define HPC_SCSI0_NDBP 0x00000004 /* Next descriptor ptr */
-#define HPC_SCSI0_BC 0x00011000 /* DMA byte count & flags */
-#define HPC_SCSI0_CTL 0x00011004 /* DMA control flags */
-#define HPC_SCSI0_GIO 0x00011008 /* GIO DMA FIFO pointer */
-#define HPC_SCSI0_DEV 0x0001100c /* Device DMA FIFO pointer */
-#define HPC_SCSI0_DMACFG 0x00011010 /* DMA configururation */
-#define HPC_SCSI0_PIOCFG 0x00011014 /* PIO configururation */
+#define HPC_SCSI0_BC 0x00001000 /* DMA byte count & flags */
+#define HPC_SCSI0_CTL 0x00001004 /* DMA control flags */
+#define HPC_SCSI0_GIO 0x00001008 /* GIO DMA FIFO pointer */
+#define HPC_SCSI0_DEV 0x0000100c /* Device DMA FIFO pointer */
+#define HPC_SCSI0_DMACFG 0x00001010 /* DMA configururation */
+#define HPC_SCSI0_PIOCFG 0x00001014 /* PIO configururation */
#define HPC_SCSI1_REGS 0x00012000 /* SCSI channel 1 registers */
#define HPC_SCSI1_REGS_SIZE 0x00001fff
diff --git a/sys/arch/sgimips/hpc/hpcvar.h b/sys/arch/sgimips/hpc/hpcvar.h
index c318ec1d872..6049e39b6e7 100644
--- a/sys/arch/sgimips/hpc/hpcvar.h
+++ b/sys/arch/sgimips/hpc/hpcvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: hpcvar.h,v 1.2 2001/08/19 03:16:22 wdk Exp $ */
+/* $NetBSD: hpcvar.h,v 1.3 2001/11/18 08:16:16 thorpej Exp $ */
/*
* Copyright (c) 2001 Rafal K. Boni
@@ -31,13 +31,14 @@
#define _ARCH_SGIMIPS_HPC_HPCVAR_H_
struct hpc_attach_args {
- char *ha_name;
+ const char *ha_name; /* name of device */
+ bus_addr_t ha_devoff; /* offset of device */
+ bus_addr_t ha_dmaoff; /* offset of DMA regs */
+ int ha_irq; /* interrupt line */
- bus_space_tag_t ha_iot;
- bus_space_handle_t ha_ioh;
- bus_dma_tag_t ha_dmat;
-
- bus_addr_t ha_offset;
+ bus_space_tag_t ha_st; /* HPC space tag */
+ bus_space_handle_t ha_sh; /* HPC space handle XXX */
+ bus_dma_tag_t ha_dmat; /* HPC DMA tag */
};
#endif /* _ARCH_SGIMIPS_HPC_HPCVAR_H_ */
diff --git a/sys/arch/sgimips/hpc/if_sq.c b/sys/arch/sgimips/hpc/if_sq.c
index 038a0b67ee6..8c005fd4fcc 100644
--- a/sys/arch/sgimips/hpc/if_sq.c
+++ b/sys/arch/sgimips/hpc/if_sq.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_sq.c,v 1.7 2001/07/08 21:04:51 thorpej Exp $ */
+/* $NetBSD: if_sq.c,v 1.8 2001/11/18 08:16:16 thorpej Exp $ */
/*
* Copyright (c) 2001 Rafal K. Boni
@@ -154,10 +154,14 @@ struct cfattach sq_ca = {
};
static int
-sq_match(struct device *parent, struct cfdata *match, void *aux)
+sq_match(struct device *parent, struct cfdata *cf, void *aux)
{
- /* XXX! */
- return 1;
+ struct hpc_attach_args *ha = aux;
+
+ if (strcmp(ha->ha_name, cf->cf_driver->cd_name) == 0)
+ return (1);
+
+ return (0);
}
static void
@@ -169,26 +173,25 @@ sq_attach(struct device *parent, struct device *self, void *aux)
struct hpc_attach_args *haa = aux;
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
- sc->sc_hpct = haa->ha_iot;
- if ((err = bus_space_subregion(haa->ha_iot, haa->ha_ioh,
- HPC_ENET_REGS,
+ sc->sc_hpct = haa->ha_st;
+ if ((err = bus_space_subregion(haa->ha_st, haa->ha_sh,
+ haa->ha_dmaoff,
HPC_ENET_REGS_SIZE,
&sc->sc_hpch)) != 0) {
printf(": unable to map HPC DMA registers, error = %d\n", err);
goto fail_0;
}
- sc->sc_regt = haa->ha_iot;
- if ((err = bus_space_subregion(haa->ha_iot, haa->ha_ioh,
- HPC_ENET_DEVREGS,
+ sc->sc_regt = haa->ha_st;
+ if ((err = bus_space_subregion(haa->ha_st, haa->ha_sh,
+ haa->ha_devoff,
HPC_ENET_DEVREGS_SIZE,
&sc->sc_regh)) != 0) {
printf(": unable to map Seeq registers, error = %d\n", err);
goto fail_0;
}
- /* XXXrkb: should be inherited from parent bus, but works for now */
- sc->sc_dmat = &sgimips_default_bus_dma_tag;
+ sc->sc_dmat = haa->ha_dmat;
if ((err = bus_dmamem_alloc(sc->sc_dmat, sizeof(struct sq_control),
PAGE_SIZE, PAGE_SIZE, &sc->sc_cdseg,
@@ -259,7 +262,7 @@ sq_attach(struct device *parent, struct device *self, void *aux)
goto fail_6;
}
- if ((cpu_intr_establish(3, IPL_NET, sq_intr, sc)) == NULL) {
+ if ((cpu_intr_establish(haa->ha_irq, IPL_NET, sq_intr, sc)) == NULL) {
printf(": unable to establish interrupt!\n");
goto fail_6;
}
diff --git a/sys/arch/sgimips/hpc/wdsc.c b/sys/arch/sgimips/hpc/wdsc.c
index 5dff644a6c5..82e21bdc8ed 100644
--- a/sys/arch/sgimips/hpc/wdsc.c
+++ b/sys/arch/sgimips/hpc/wdsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wdsc.c,v 1.3 2001/11/18 05:14:39 thorpej Exp $ */
+/* $NetBSD: wdsc.c,v 1.4 2001/11/18 08:16:16 thorpej Exp $ */
/*
* Copyright (c) 2001 Wayne Knowles
@@ -84,8 +84,6 @@ struct cfattach wdsc_ca = {
sizeof(struct wdsc_softc), wdsc_match, wdsc_attach
};
-extern struct cfdriver wdsc_cd;
-
int wdsc_dmasetup __P((struct sbic_softc *, caddr_t *,size_t *,
int, size_t *));
int wdsc_dmago __P((struct sbic_softc *));
@@ -110,9 +108,10 @@ wdsc_match(pdp, cf, auxp)
{
struct hpc_attach_args *haa = auxp;
- if (strcmp(haa->ha_name, wdsc_cd.cd_name))
- return (0);
- return (1);
+ if (strcmp(haa->ha_name, cf->cf_driver->cd_name) == 0)
+ return (1);
+
+ return (0);
}
/*
@@ -128,11 +127,11 @@ wdsc_attach(pdp, dp, auxp)
struct hpc_attach_args *haa = auxp;
int err;
- sc->sc_regt = haa->ha_iot;
+ sc->sc_regt = haa->ha_st;
wsc->sc_dmat = haa->ha_dmat;
- if ((err = bus_space_subregion(haa->ha_iot, haa->ha_ioh,
- HPC_SCSI0_DEVREGS,
+ if ((err = bus_space_subregion(haa->ha_st, haa->ha_sh,
+ haa->ha_devoff,
HPC_SCSI0_DEVREGS_SIZE,
&sc->sc_regh)) != 0) {
printf(": unable to map regs, err=%d\n", err);
@@ -161,8 +160,8 @@ wdsc_attach(pdp, dp, auxp)
evcnt_attach_dynamic(&wsc->sc_intrcnt, EVCNT_TYPE_INTR, NULL,
sc->sc_dev.dv_xname, "intr");
- /* XXX: 1 = IRQ_LOCAL0 + 1 */
- if ((cpu_intr_establish(1, IPL_BIO, wdsc_scsiintr, sc)) == NULL) {
+ if ((cpu_intr_establish(haa->ha_irq, IPL_BIO,
+ wdsc_scsiintr, sc)) == NULL) {
printf(": unable to establish interrupt!\n");
return;
}