diff options
author | Marius Strobl <marius@FreeBSD.org> | 2006-02-03 12:35:42 +0000 |
---|---|---|
committer | Marius Strobl <marius@FreeBSD.org> | 2006-02-03 12:35:42 +0000 |
commit | 8d727356c6635c5cb4335af97b007bee6eb3ee8e (patch) | |
tree | 3a64cdf591a64dc066a61335fa6357528f766824 | |
parent | d7bd3313e26178ab5c77fd2df71a248dcc15d92a (diff) | |
download | src-8d727356c6635c5cb4335af97b007bee6eb3ee8e.tar.gz src-8d727356c6635c5cb4335af97b007bee6eb3ee8e.zip |
- Don't shift the clock frequency in MHz left by 8 before assigning it
to sbus_mdvec.dv_clock as sbus_mdvec.dv_clock is meant to be specified
in MHz. While this was a bug it shouldn't have affected FreeBSD/sparc64
as sbus_mdvec.dv_clock is used to limit the clock rate of chips when
a machine isn't able to support them at maximum speed which isn't the
case for sun4u machines.
- Remove the code that checks whether the clock frequency returned by
sbus_get_clockfreq() is 0 and falls back to 25MHz if it is as that's
already done in sbus(4).
Approved by: mjacob
MFC after: 3 days
Notes
Notes:
svn path=/head/; revision=155251
-rw-r--r-- | sys/dev/isp/isp_sbus.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/dev/isp/isp_sbus.c b/sys/dev/isp/isp_sbus.c index 8914d9aba64c..b0dc0f056ec8 100644 --- a/sys/dev/isp/isp_sbus.c +++ b/sys/dev/isp/isp_sbus.c @@ -136,7 +136,7 @@ static int isp_sbus_attach(device_t dev) { struct resource *regs; - int tval, iqd, isp_debug, role, rid, ispburst, freq; + int tval, iqd, isp_debug, role, rid, ispburst; struct isp_sbussoftc *sbs; struct ispsoftc *isp = NULL; int locksetup = 0; @@ -203,16 +203,12 @@ isp_sbus_attach(device_t dev) isp->isp_role = role; isp->isp_dev = dev; - freq = sbus_get_clockfreq(dev); - if (freq) { - /* - * Convert from HZ to MHz, rounding up. - */ - freq = (freq + 500000)/1000000; - } else { - freq = 25; - } - sbs->sbus_mdvec.dv_clock = freq << 8; + /* + * Get the clock frequency and convert it from HZ to MHz, + * rounding up. This defaults to 25MHz if there isn't a + * device specific one in the OFW device tree. + */ + sbs->sbus_mdvec.dv_clock = (sbus_get_clockfreq(dev) + 500000)/1000000; /* * Now figure out what the proper burst sizes, etc., to use. |