summaryrefslogtreecommitdiffstats
path: root/sys/dev/scc
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2007-03-28 18:05:17 +0000
committermarcel <marcel@FreeBSD.org>2007-03-28 18:05:17 +0000
commit6a8f75121aa4929613cfb5981bd4890540f74682 (patch)
tree2c79145cc260514d33a893d7f9124b04deb0146d /sys/dev/scc
parent625c677e93c06d5f8011503de35094a5cb3b8442 (diff)
downloadFreeBSD-src-6a8f75121aa4929613cfb5981bd4890540f74682.zip
FreeBSD-src-6a8f75121aa4929613cfb5981bd4890540f74682.tar.gz
Add method enabled() to the SCC interface. This method can be used
by driver backends to mark individual channels as enabled or not. The default implementation of this method always mark channels as enabled. This method is currently not used, but is added with the PowerQUICC in mind where the 2nd SCC channel can be disabled.
Diffstat (limited to 'sys/dev/scc')
-rw-r--r--sys/dev/scc/scc_bfe.h1
-rw-r--r--sys/dev/scc/scc_core.c5
-rw-r--r--sys/dev/scc/scc_if.m16
3 files changed, 22 insertions, 0 deletions
diff --git a/sys/dev/scc/scc_bfe.h b/sys/dev/scc/scc_bfe.h
index 2db24f3..8209592 100644
--- a/sys/dev/scc/scc_bfe.h
+++ b/sys/dev/scc/scc_bfe.h
@@ -92,6 +92,7 @@ struct scc_chan {
struct scc_mode ch_mode[SCC_NMODES];
u_int ch_nr;
+ int ch_enabled:1;
int ch_sysdev:1;
uint32_t ch_ipend;
diff --git a/sys/dev/scc/scc_core.c b/sys/dev/scc/scc_core.c
index e8d77f65..7f8ed91 100644
--- a/sys/dev/scc/scc_core.c
+++ b/sys/dev/scc/scc_core.c
@@ -162,6 +162,10 @@ scc_bfe_attach(device_t dev)
resource_list_init(&ch->ch_rlist);
ch->ch_nr = c + 1;
+ if (!SCC_ENABLED(sc, ch))
+ goto next;
+
+ ch->ch_enabled = 1;
resource_list_add(&ch->ch_rlist, sc->sc_rtype, 0, start,
start + sz - 1, sz);
rle = resource_list_find(&ch->ch_rlist, sc->sc_rtype, 0);
@@ -192,6 +196,7 @@ scc_bfe_attach(device_t dev)
}
}
+ next:
start += (cl->cl_range < 0) ? -size : size;
sysdev |= ch->ch_sysdev;
}
diff --git a/sys/dev/scc/scc_if.m b/sys/dev/scc/scc_if.m
index 8aa30a4..c67e23f 100644
--- a/sys/dev/scc/scc_if.m
+++ b/sys/dev/scc/scc_if.m
@@ -38,6 +38,15 @@
INTERFACE scc;
+# Default implementations of some methods.
+CODE {
+ static int
+ default_enabled(struct scc_softc *this, struct scc_chan *ch)
+ {
+ return (1);
+ }
+}
+
# attach() - attach hardware.
# This method is called when the device is being attached. All resources
# have been allocated. The intend of this method is to setup the hardware
@@ -50,6 +59,13 @@ METHOD int attach {
int reset;
};
+# enabled()
+METHOD int enabled {
+ struct scc_softc *this;
+ struct scc_chan *chan;
+} DEFAULT default_enabled;
+
+# iclear()
METHOD void iclear {
struct scc_softc *this;
struct scc_chan *chan;
OpenPOWER on IntegriCloud