Lines Matching +full:10 +full:- +full:bits

1 // SPDX-License-Identifier: GPL-2.0-only
10 * - We cli/sti on stepping A0 CPUs around the FID/VID transition.
13 * - We disable half multipliers if ACPI is used on A0 stepping CPUs.
38 #include "powernow-k7.h"
41 u8 signature[10];
64 } bits; member
77 /* divide by 10 to get FID. */
82 150, 225, 160, 165, 170, 180, -1, -1,
95 static unsigned int minimum_speed = -1;
107 delta = (fsbspeed > f) ? fsbspeed - f : f - fsbspeed; in check_fsb()
134 if ((c->x86_model == 6) && (c->x86_stepping == 0)) { in check_powernow()
180 return -ENOMEM; in get_ranges()
185 powernow_table[j].frequency = (fsb * fid_codes[fid]) / 10; in get_ranges()
186 powernow_table[j].driver_data = fid; /* lower 8 bits */ in get_ranges()
190 if ((fid_codes[fid] % 10) == 5) { in get_ranges()
203 powernow_table[j].driver_data |= (vid << 8); /* upper 8 bits */ in get_ranges()
206 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10, in get_ranges()
207 fid_codes[fid] % 10, speed/1000, vid, in get_ranges()
223 if (fidvidctl.bits.FID != fid) { in change_FID()
224 fidvidctl.bits.SGTC = latency; in change_FID()
225 fidvidctl.bits.FID = fid; in change_FID()
226 fidvidctl.bits.VIDC = 0; in change_FID()
227 fidvidctl.bits.FIDC = 1; in change_FID()
238 if (fidvidctl.bits.VID != vid) { in change_VID()
239 fidvidctl.bits.SGTC = latency; in change_VID()
240 fidvidctl.bits.VID = vid; in change_VID()
241 fidvidctl.bits.FIDC = 0; in change_VID()
242 fidvidctl.bits.VIDC = 1; in change_VID()
255 /* fid are the lower 8 bits of the index we stored into in powernow_target()
257 * vid are the upper 8 bits. in powernow_target()
264 cfid = fidvidstatus.bits.CFID; in powernow_target()
265 freqs.old = fsb * fid_codes[cfid] / 10; in powernow_target()
303 retval = -EINVAL; in powernow_acpi_init()
309 retval = -ENOMEM; in powernow_acpi_init()
313 if (!zalloc_cpumask_var(&acpi_processor_perf->shared_cpu_map, in powernow_acpi_init()
315 retval = -ENOMEM; in powernow_acpi_init()
320 retval = -EIO; in powernow_acpi_init()
324 if (acpi_processor_perf->control_register.space_id != in powernow_acpi_init()
326 retval = -ENODEV; in powernow_acpi_init()
330 if (acpi_processor_perf->status_register.space_id != in powernow_acpi_init()
332 retval = -ENODEV; in powernow_acpi_init()
336 number_scales = acpi_processor_perf->state_count; in powernow_acpi_init()
339 retval = -ENODEV; in powernow_acpi_init()
346 retval = -ENOMEM; in powernow_acpi_init()
350 pc.val = (unsigned long) acpi_processor_perf->states[0].control; in powernow_acpi_init()
354 &acpi_processor_perf->states[i]; in powernow_acpi_init()
357 pc.val = (unsigned long) state->control; in powernow_acpi_init()
360 (u32) state->core_frequency, in powernow_acpi_init()
361 (u32) state->power, in powernow_acpi_init()
362 (u32) state->transition_latency, in powernow_acpi_init()
363 (u32) state->control, in powernow_acpi_init()
364 pc.bits.sgtc); in powernow_acpi_init()
366 vid = pc.bits.vid; in powernow_acpi_init()
367 fid = pc.bits.fid; in powernow_acpi_init()
369 powernow_table[i].frequency = fsb * fid_codes[fid] / 10; in powernow_acpi_init()
370 powernow_table[i].driver_data = fid; /* lower 8 bits */ in powernow_acpi_init()
371 powernow_table[i].driver_data |= (vid << 8); /* upper 8 bits */ in powernow_acpi_init()
377 * get a KHz value (e.g. 1266000). However, powernow-k7 works in powernow_acpi_init()
387 if ((fid_codes[fid] % 10) == 5) { in powernow_acpi_init()
393 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10, in powernow_acpi_init()
394 fid_codes[fid] % 10, speed_mhz, vid, in powernow_acpi_init()
398 if (state->core_frequency != speed_mhz) { in powernow_acpi_init()
399 state->core_frequency = speed_mhz; in powernow_acpi_init()
404 if (latency < pc.bits.sgtc) in powernow_acpi_init()
405 latency = pc.bits.sgtc; in powernow_acpi_init()
424 free_cpumask_var(acpi_processor_perf->shared_cpu_map); in powernow_acpi_init()
435 …pr_info("no support for ACPI processor found - please recompile your kernel with ACPI processor\n"… in powernow_acpi_init()
436 return -EINVAL; in powernow_acpi_init()
444 pst->cpuid, pst->fsbspeed, pst->maxfid, pst->startvid); in print_pst_entry()
462 if (memcmp(p, "AMDK7PNOW!", 10) == 0) { in powernow_decode_bios()
465 pr_debug("Table version: 0x%x\n", psb->tableversion); in powernow_decode_bios()
466 if (psb->tableversion != 0x12) { in powernow_decode_bios()
468 return -ENODEV; in powernow_decode_bios()
471 pr_debug("Flags: 0x%x\n", psb->flags); in powernow_decode_bios()
472 if ((psb->flags & 1) == 0) in powernow_decode_bios()
477 latency = psb->settlingtime; in powernow_decode_bios()
484 psb->settlingtime); in powernow_decode_bios()
487 psb->numpst); in powernow_decode_bios()
493 for (j = 0; j < psb->numpst; j++) { in powernow_decode_bios()
495 number_scales = pst->numpstates; in powernow_decode_bios()
497 if ((etuple == pst->cpuid) && in powernow_decode_bios()
498 check_fsb(pst->fsbspeed) && in powernow_decode_bios()
499 (maxfid == pst->maxfid) && in powernow_decode_bios()
500 (startvid == pst->startvid)) { in powernow_decode_bios()
516 return -EINVAL; in powernow_decode_bios()
521 return -ENODEV; in powernow_decode_bios()
531 * the "well-known" other OS.
539 if ((m % 10) >= 5) in fixup_sgtc()
542 m /= 10; in fixup_sgtc()
561 cfid = fidvidstatus.bits.CFID; in powernow_get()
563 return fsb * fid_codes[cfid] / 10; in powernow_get()
570 d->ident); in acer_cpufreq_pst()
598 if (policy->cpu != 0) in powernow_cpu_init()
599 return -ENODEV; in powernow_cpu_init()
605 fsb = (10 * cpu_khz) / fid_codes[fidvidstatus.bits.CFID]; in powernow_cpu_init()
608 return -EINVAL; in powernow_cpu_init()
613 pr_info("PSB/PST known to be broken - trying ACPI instead\n"); in powernow_cpu_init()
616 result = powernow_decode_bios(fidvidstatus.bits.MFID, in powernow_cpu_init()
617 fidvidstatus.bits.SVID); in powernow_cpu_init()
621 minimum_speed = -1; in powernow_cpu_init()
637 pr_info("Minimum speed %d MHz - Maximum speed %d MHz\n", in powernow_cpu_init()
640 policy->cpuinfo.transition_latency = in powernow_cpu_init()
642 policy->freq_table = powernow_table; in powernow_cpu_init()
652 free_cpumask_var(acpi_processor_perf->shared_cpu_map); in powernow_cpu_exit()
669 .name = "powernow-k7",
676 return -ENODEV; in powernow_init()