View | Details | Raw Unified | Return to bug 145718 | Differences between
and this patch

Collapse All | Expand All

(-)est.c (+8 lines)
Lines 1207-1217 Link Here
1207
	freq = tsc_freq / 1000000;
1207
	freq = tsc_freq / 1000000;
1208
	id = msr >> 32;
1208
	id = msr >> 32;
1209
	bus = freq / (id >> 8);
1209
	bus = freq / (id >> 8);
1210
	if( id & 0x4000 )
1211
	  bus = 2 * freq / ( (id >> 7 & 0x7e) + 1 );
1210
	device_printf(dev, "Guessed bus clock (high) of %d MHz\n", bus);
1212
	device_printf(dev, "Guessed bus clock (high) of %d MHz\n", bus);
1211
	if (!bus_speed_ok(bus)) {
1213
	if (!bus_speed_ok(bus)) {
1212
		/* We may be running on the low frequency. */
1214
		/* We may be running on the low frequency. */
1213
		id = msr >> 48;
1215
		id = msr >> 48;
1214
		bus = freq / (id >> 8);
1216
		bus = freq / (id >> 8);
1217
		if( id & 0x4000 )
1218
		  bus = 2 * freq / ( (id >> 7 & 0x7e) + 1 );
1215
		device_printf(dev, "Guessed bus clock (low) of %d MHz\n", bus);
1219
		device_printf(dev, "Guessed bus clock (low) of %d MHz\n", bus);
1216
		if (!bus_speed_ok(bus))
1220
		if (!bus_speed_ok(bus))
1217
			return (EOPNOTSUPP);
1221
			return (EOPNOTSUPP);
Lines 1219-1224 Link Here
1219
		/* Calculate high frequency. */
1223
		/* Calculate high frequency. */
1220
		id = msr >> 32;
1224
		id = msr >> 32;
1221
		freq = ((id >> 8) & 0xff) * bus;
1225
		freq = ((id >> 8) & 0xff) * bus;
1226
		if( id & 0x4000 )
1227
		  freq =( (id >> 7 & 0x7e) + 1 ) * bus / 2;
1222
	}
1228
	}
1223
1229
1224
	/* Fill out a new freq table containing just the high and low freqs. */
1230
	/* Fill out a new freq table containing just the high and low freqs. */
Lines 1241-1246 Link Here
1241
	/* Second, the low frequency. */
1247
	/* Second, the low frequency. */
1242
	id = msr >> 48;
1248
	id = msr >> 48;
1243
	freq = ((id >> 8) & 0xff) * bus;
1249
	freq = ((id >> 8) & 0xff) * bus;
1250
	if( id & 0x4000 )
1251
	  freq =( (id >> 7 & 0x7e) + 1 ) * bus / 2;
1244
	volts = id & 0xff;
1252
	volts = id & 0xff;
1245
	if (volts != 0) {
1253
	if (volts != 0) {
1246
		volts <<= 4;
1254
		volts <<= 4;

Return to bug 145718