summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2008-04-26 18:40:59 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2008-04-26 18:40:59 +0000
commit6239f9e5f1c3272eb7d16415bb6c24bef21b1f1d (patch)
treeca20d5371a6bb7561b78df7dfca0226950ae04a0
parent4924db935d8175b07ff7246542907e7a7451746a (diff)
Notes
-rw-r--r--sys/dev/scc/scc_bfe.h2
-rw-r--r--sys/dev/scc/scc_bfe_ebus.c9
-rw-r--r--sys/dev/scc/scc_bfe_macio.c9
-rw-r--r--sys/dev/scc/scc_bfe_quicc.c9
-rw-r--r--sys/dev/scc/scc_bfe_sbus.c9
-rw-r--r--sys/dev/scc/scc_core.c13
6 files changed, 44 insertions, 7 deletions
diff --git a/sys/dev/scc/scc_bfe.h b/sys/dev/scc/scc_bfe.h
index 56d2bea026ea1..d4f415551c449 100644
--- a/sys/dev/scc/scc_bfe.h
+++ b/sys/dev/scc/scc_bfe.h
@@ -138,7 +138,7 @@ struct scc_softc {
extern devclass_t scc_devclass;
extern char scc_driver_name[];
-int scc_bfe_attach(device_t dev);
+int scc_bfe_attach(device_t dev, u_int ipc);
int scc_bfe_detach(device_t dev);
int scc_bfe_probe(device_t dev, u_int regshft, u_int rclk, u_int rid);
diff --git a/sys/dev/scc/scc_bfe_ebus.c b/sys/dev/scc/scc_bfe_ebus.c
index 2d4a9d8e92a10..17386db3751c7 100644
--- a/sys/dev/scc/scc_bfe_ebus.c
+++ b/sys/dev/scc/scc_bfe_ebus.c
@@ -64,10 +64,17 @@ scc_ebus_probe(device_t dev)
return (ENXIO);
}
+static int
+scc_ebus_attach(device_t dev)
+{
+
+ return (scc_bfe_attach(dev, 0));
+}
+
static device_method_t scc_ebus_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, scc_ebus_probe),
- DEVMETHOD(device_attach, scc_bfe_attach),
+ DEVMETHOD(device_attach, scc_ebus_attach),
DEVMETHOD(device_detach, scc_bfe_detach),
DEVMETHOD(bus_alloc_resource, scc_bus_alloc_resource),
diff --git a/sys/dev/scc/scc_bfe_macio.c b/sys/dev/scc/scc_bfe_macio.c
index c09859549b34c..1d7bf82bfcfde 100644
--- a/sys/dev/scc/scc_bfe_macio.c
+++ b/sys/dev/scc/scc_bfe_macio.c
@@ -61,10 +61,17 @@ scc_macio_probe(device_t dev)
return (ENXIO);
}
+static int
+scc_macio_attach(device_t dev)
+{
+
+ return (scc_bfe_attach(dev, 3));
+}
+
static device_method_t scc_macio_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, scc_macio_probe),
- DEVMETHOD(device_attach, scc_bfe_attach),
+ DEVMETHOD(device_attach, scc_macio_attach),
DEVMETHOD(device_detach, scc_bfe_detach),
DEVMETHOD(bus_alloc_resource, scc_bus_alloc_resource),
diff --git a/sys/dev/scc/scc_bfe_quicc.c b/sys/dev/scc/scc_bfe_quicc.c
index 4dc7024de98b5..f92aa52d1d92d 100644
--- a/sys/dev/scc/scc_bfe_quicc.c
+++ b/sys/dev/scc/scc_bfe_quicc.c
@@ -69,10 +69,17 @@ scc_quicc_probe(device_t dev)
return (scc_bfe_probe(dev, 0, rclk, 0));
}
+static int
+scc_quicc_attach(device_t dev)
+{
+
+ return (scc_bfe_attach(dev, 0));
+}
+
static device_method_t scc_quicc_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, scc_quicc_probe),
- DEVMETHOD(device_attach, scc_bfe_attach),
+ DEVMETHOD(device_attach, scc_quicc_attach),
DEVMETHOD(device_detach, scc_bfe_detach),
DEVMETHOD(bus_alloc_resource, scc_bus_alloc_resource),
diff --git a/sys/dev/scc/scc_bfe_sbus.c b/sys/dev/scc/scc_bfe_sbus.c
index 2ce1e1e8d1210..8eb963fa0b4ad 100644
--- a/sys/dev/scc/scc_bfe_sbus.c
+++ b/sys/dev/scc/scc_bfe_sbus.c
@@ -61,10 +61,17 @@ scc_sbus_probe(device_t dev)
return (ENXIO);
}
+static int
+scc_sbus_attach(device_t dev)
+{
+
+ return (scc_bfe_attach(dev, 0));
+}
+
static device_method_t scc_sbus_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, scc_sbus_probe),
- DEVMETHOD(device_attach, scc_bfe_attach),
+ DEVMETHOD(device_attach, scc_sbus_attach),
DEVMETHOD(device_detach, scc_bfe_detach),
DEVMETHOD(bus_alloc_resource, scc_bus_alloc_resource),
diff --git a/sys/dev/scc/scc_core.c b/sys/dev/scc/scc_core.c
index 7f8ed9117f923..76388ad1ae385 100644
--- a/sys/dev/scc/scc_core.c
+++ b/sys/dev/scc/scc_core.c
@@ -94,7 +94,7 @@ scc_bfe_intr(void *arg)
}
int
-scc_bfe_attach(device_t dev)
+scc_bfe_attach(device_t dev, u_int ipc)
{
struct resource_list_entry *rle;
struct scc_chan *ch;
@@ -144,9 +144,18 @@ scc_bfe_attach(device_t dev)
M_SCC, M_WAITOK | M_ZERO);
for (c = 0; c < cl->cl_channels; c++) {
ch = &sc->sc_chan[c];
- ch->ch_irid = c;
+ /*
+ * XXX temporary hack. If we have more than 1 interrupt
+ * per channel, allocate the first for the channel. At
+ * this time only the macio bus front-end has more than
+ * 1 interrupt per channel and we don't use the 2nd and
+ * 3rd, because we don't support DMA yet.
+ */
+ ch->ch_irid = c * ipc;
ch->ch_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ,
&ch->ch_irid, RF_ACTIVE | RF_SHAREABLE);
+ if (ipc == 0)
+ break;
}
/*