From 817ee68141a5239675f2ae3d4b66e403998ac26b Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Sun, 12 Feb 2006 22:57:04 +0000 Subject: MFC: 1.17 - 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: re (scottl) --- sys/dev/isp/isp_sbus.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'sys/dev/isp') 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. -- cgit v1.3