Lines Matching refs:msr
80 #define AMD_10H_11H_GET_PSTATE_MAX_VAL(msr) (((msr) >> 4) & 0x7) argument
81 #define AMD_10H_11H_GET_PSTATE_LIMIT(msr) (((msr)) & 0x7) argument
83 #define AMD_10H_11H_CUR_VID(msr) (((msr) >> 9) & 0x7F) argument
84 #define AMD_10H_11H_CUR_DID(msr) (((msr) >> 6) & 0x07) argument
85 #define AMD_10H_11H_CUR_FID(msr) ((msr) & 0x3F) argument
87 #define AMD_17H_CUR_IDIV(msr) (((msr) >> 30) & 0x03) argument
88 #define AMD_17H_CUR_IDD(msr) (((msr) >> 22) & 0xFF) argument
89 #define AMD_17H_CUR_VID(msr) (((msr) >> 14) & 0xFF) argument
90 #define AMD_17H_CUR_DID(msr) (((msr) >> 8) & 0x3F) argument
91 #define AMD_17H_CUR_FID(msr) ((msr) & 0xFF) argument
93 #define AMD_1AH_CUR_FID(msr) ((msr) & 0xFFF) argument
195 uint64_t msr; in hwpstate_goto_pstate() local
200 msr = rdmsr(MSR_AMD_10H_11H_LIMIT); in hwpstate_goto_pstate()
201 limit = AMD_10H_11H_GET_PSTATE_LIMIT(msr); in hwpstate_goto_pstate()
242 msr = rdmsr(MSR_AMD_10H_11H_STATUS); in hwpstate_goto_pstate()
243 if (msr == id) in hwpstate_goto_pstate()
250 (int)msr, i); in hwpstate_goto_pstate()
251 if (msr != id) { in hwpstate_goto_pstate()
287 uint64_t msr; in hwpstate_get() local
292 msr = rdmsr(MSR_AMD_10H_11H_STATUS); in hwpstate_get()
293 if (msr >= sc->cfnum) in hwpstate_get()
295 set = sc->hwpstate_settings[msr]; in hwpstate_get()
373 uint64_t msr; in hwpstate_probe() local
419 msr = rdmsr(MSR_AMD_10H_11H_LIMIT); in hwpstate_probe()
420 if (sc->cfnum != 1 + AMD_10H_11H_GET_PSTATE_MAX_VAL(msr)) { in hwpstate_probe()
422 " count mismatch\n", (intmax_t)msr, sc->cfnum); in hwpstate_probe()
452 uint64_t msr; in hwpstate_get_info_from_msr() local
458 msr = rdmsr(MSR_AMD_10H_11H_LIMIT); in hwpstate_get_info_from_msr()
459 sc->cfnum = 1 + AMD_10H_11H_GET_PSTATE_MAX_VAL(msr); in hwpstate_get_info_from_msr()
462 msr = rdmsr(MSR_AMD_10H_11H_CONFIG + i); in hwpstate_get_info_from_msr()
463 if ((msr & ((uint64_t)1 << 63)) == 0) { in hwpstate_get_info_from_msr()
467 did = AMD_10H_11H_CUR_DID(msr); in hwpstate_get_info_from_msr()
468 fid = AMD_10H_11H_CUR_FID(msr); in hwpstate_get_info_from_msr()
490 fid = AMD_1AH_CUR_FID(msr); in hwpstate_get_info_from_msr()
501 did = AMD_17H_CUR_DID(msr); in hwpstate_get_info_from_msr()
507 fid = AMD_17H_CUR_FID(msr); in hwpstate_get_info_from_msr()
513 (155000 - (625 * AMD_17H_CUR_VID(msr))) / 100; in hwpstate_get_info_from_msr()
520 hwpstate_set[i].power = AMD_17H_CUR_IDD(msr) * 1000; in hwpstate_get_info_from_msr()
522 hwpstate_set[i].power, AMD_17H_CUR_IDIV(msr)); in hwpstate_get_info_from_msr()