1/*- 2 * Copyright (c) 2004-2005 Bruno Ducrot 3 * Copyright (c) 2004 FUKUDA Nobuhiko <nfukuda@spa.is.uec.ac.jp> 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 */ 25 26/* 27 * Many thanks to Nate Lawson for his helpful comments on this driver and 28 * to Jung-uk Kim for testing. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/x86/cpufreq/powernow.c 221102 2011-04-27 00:32:35Z jkim $"); |
33 34#include <sys/param.h> 35#include <sys/bus.h> 36#include <sys/cpu.h> 37#include <sys/kernel.h> 38#include <sys/malloc.h> 39#include <sys/module.h> 40#include <sys/pcpu.h> --- 755 unchanged lines hidden (view full) --- 796 ctrl = sets[i].spec[PX_SPEC_CONTROL]; 797 switch (sc->pn_type) { 798 case PN7_TYPE: 799 state.fid = ACPI_PN7_CTRL_TO_FID(ctrl); 800 state.vid = ACPI_PN7_CTRL_TO_VID(ctrl); 801 if ((sc->errata & A0_ERRATA) && 802 (pn7_fid_to_mult[state.fid] % 10) == 5) 803 continue; |
804 break; 805 case PN8_TYPE: 806 state.fid = ACPI_PN8_CTRL_TO_FID(ctrl); 807 state.vid = ACPI_PN8_CTRL_TO_VID(ctrl); |
808 break; 809 } |
810 state.freq = sets[i].freq * 1000; |
811 state.power = sets[i].power; 812 813 j = n; 814 while (j > 0 && sc->powernow_states[j - 1].freq < state.freq) { 815 memcpy(&sc->powernow_states[j], 816 &sc->powernow_states[j - 1], 817 sizeof(struct powernow_state)); 818 --j; --- 15 unchanged lines hidden (view full) --- 834 * This maybe indicates we have the wrong tables. Therefore, 835 * don't implement a quirk, but fallback to BIOS legacy 836 * tables instead. 837 */ 838 if (PN7_STA_MFID(status) != state.fid) { 839 device_printf(dev, "ACPI MAX frequency not found\n"); 840 return (EINVAL); 841 } |
842 sc->fsb = state.freq / 100 / pn7_fid_to_mult[state.fid]; |
843 break; 844 case PN8_TYPE: 845 sc->vst = ACPI_PN8_CTRL_TO_VST(ctrl), 846 sc->mvs = ACPI_PN8_CTRL_TO_MVS(ctrl), 847 sc->pll = ACPI_PN8_CTRL_TO_PLL(ctrl), 848 sc->rvo = ACPI_PN8_CTRL_TO_RVO(ctrl), 849 sc->irt = ACPI_PN8_CTRL_TO_IRT(ctrl); 850 sc->low = 0; /* XXX */ 851 852 /* 853 * powernow k8 supports only one low frequency. 854 */ 855 if (sc->powernow_max_states >= 2 && 856 (sc->powernow_states[sc->powernow_max_states - 2].fid < 8)) 857 return (EINVAL); |
858 sc->fsb = state.freq / 100 / pn8_fid_to_mult[state.fid]; |
859 break; 860 } 861 862 return (0); 863} 864 865static void 866pn_identify(driver_t *driver, device_t parent) --- 104 unchanged lines hidden --- |