- 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
This commit is contained in:
parent
30033bf1b3
commit
ed93f993fd
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user