diff options
author | marcel <marcel@FreeBSD.org> | 2006-07-26 03:10:01 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2006-07-26 03:10:01 +0000 |
commit | aedab5da36dfc54c382d0733a9d398393672b2e4 (patch) | |
tree | d531de8eac09bb759213e84c96e8c590c58cedd7 | |
parent | 0d82cd6a1146405ed8904dc0c9a66490dad163b8 (diff) | |
download | FreeBSD-src-aedab5da36dfc54c382d0733a9d398393672b2e4.zip FreeBSD-src-aedab5da36dfc54c382d0733a9d398393672b2e4.tar.gz |
Fix braino: The cl_range field should not hold the shifted I/O
space range per channel, but rather the unshifted range. The
shifting depends on the bus. The hardcoded shift was specific
to the SBus on sparc64. The shifted range is now determined at
run-time. This fixes the mac-io attachment.
-rw-r--r-- | sys/dev/scc/scc_core.c | 4 | ||||
-rw-r--r-- | sys/dev/scc/scc_dev_z8530.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/scc/scc_core.c b/sys/dev/scc/scc_core.c index c9cda51..17be686 100644 --- a/sys/dev/scc/scc_core.c +++ b/sys/dev/scc/scc_core.c @@ -119,7 +119,7 @@ scc_bfe_attach(device_t dev) } else sc = sc0; - size = abs(cl->cl_range); + size = abs(cl->cl_range) << sc->sc_bas.regshft; mtx_init(&sc->sc_hwmtx, "scc_hwmtx", NULL, MTX_SPIN); @@ -351,7 +351,7 @@ scc_bfe_probe(device_t dev, u_int regshft, u_int rclk) if (device_get_desc(dev) == NULL) device_set_desc(dev, cl->name); - size = abs(cl->cl_range); + size = abs(cl->cl_range) << regshft; /* * Allocate the register resource. We assume that all SCCs have a diff --git a/sys/dev/scc/scc_dev_z8530.c b/sys/dev/scc/scc_dev_z8530.c index 6b17047..3d63c22 100644 --- a/sys/dev/scc/scc_dev_z8530.c +++ b/sys/dev/scc/scc_dev_z8530.c @@ -62,7 +62,7 @@ struct scc_class scc_z8530_class = { .cl_channels = 2, .cl_class = SCC_CLASS_Z8530, .cl_modes = SCC_MODE_ASYNC | SCC_MODE_BISYNC | SCC_MODE_HDLC, - .cl_range = (CHAN_B - CHAN_A) << 1, + .cl_range = CHAN_B - CHAN_A, }; /* Multiplexed I/O. */ |