Skip to content

Commit

Permalink
Add experimental Mendocino and Phoenix Point support
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesCJ60 authored and FlyGoat committed Mar 18, 2023
1 parent 32c89f8 commit 607a7de
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
37 changes: 36 additions & 1 deletion lib/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ EXP int CALL set_stapm_limit(ryzen_access ry, uint32_t value){
case FAM_CEZANNE:
case FAM_VANGOGH:
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust(0x14);
if (err) {
printf("%s: Retry with PSMU\n", __func__);
Expand All @@ -453,6 +455,8 @@ EXP int CALL set_fast_limit(ryzen_access ry, uint32_t value){
case FAM_CEZANNE:
case FAM_VANGOGH:
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust(0x15);
}
return err;
Expand All @@ -473,6 +477,8 @@ EXP int CALL set_slow_limit(ryzen_access ry, uint32_t value){
case FAM_CEZANNE:
case FAM_VANGOGH:
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust(0x16);
}
return err;
Expand All @@ -493,6 +499,8 @@ EXP int CALL set_slow_time(ryzen_access ry, uint32_t value){
case FAM_CEZANNE:
case FAM_VANGOGH:
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust(0x17);
}
return err;
Expand All @@ -513,6 +521,8 @@ EXP int CALL set_stapm_time(ryzen_access ry, uint32_t value){
case FAM_CEZANNE:
case FAM_VANGOGH:
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust(0x18);
}
return err;
Expand All @@ -533,6 +543,8 @@ EXP int CALL set_tctl_temp(ryzen_access ry, uint32_t value){
case FAM_CEZANNE:
case FAM_VANGOGH:
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust(0x19);
}
return err;
Expand All @@ -553,6 +565,8 @@ EXP int CALL set_vrm_current(ryzen_access ry, uint32_t value){
case FAM_CEZANNE:
case FAM_VANGOGH:
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust(0x1a);
}
return err;
Expand All @@ -573,6 +587,8 @@ EXP int CALL set_vrmsoc_current(ryzen_access ry, uint32_t value){
case FAM_CEZANNE:
case FAM_VANGOGH:
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust(0x1b);
}
return err;
Expand Down Expand Up @@ -614,6 +630,8 @@ EXP int CALL set_vrmmax_current(ryzen_access ry, uint32_t value){
case FAM_LUCIENNE:
case FAM_CEZANNE:
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust(0x1c);
break;
case FAM_VANGOGH:
Expand Down Expand Up @@ -647,6 +665,8 @@ EXP int CALL set_vrmsocmax_current(ryzen_access ry, uint32_t value){
case FAM_LUCIENNE:
case FAM_CEZANNE:
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust(0x1d);
}
return err;
Expand Down Expand Up @@ -869,6 +889,8 @@ EXP int CALL set_prochot_deassertion_ramp(ryzen_access ry, uint32_t value) {
_do_adjust(0x22);
break;
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust(0x1f);
}
return err;
Expand All @@ -887,6 +909,8 @@ EXP int CALL set_apu_skin_temp_limit(ryzen_access ry, uint32_t value) {
break;
case FAM_VANGOGH:
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust(0x33);
break;
}
Expand All @@ -906,6 +930,8 @@ EXP int CALL set_dgpu_skin_temp_limit(ryzen_access ry, uint32_t value) {
break;
case FAM_VANGOGH:
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust(0x34);
break;
}
Expand All @@ -923,6 +949,7 @@ EXP int CALL set_apu_slow_limit(ryzen_access ry, uint32_t value) {
_do_adjust(0x21);
break;
case FAM_REMBRANDT:
case FAM_PHEONIX:
_do_adjust(0x23);
break;
}
Expand All @@ -941,6 +968,8 @@ EXP int CALL set_skin_temp_power_limit(ryzen_access ry, uint32_t value) {
break;
case FAM_VANGOGH:
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust(0x4a);
break;
}
Expand All @@ -957,6 +986,8 @@ EXP int CALL set_gfx_clk(ryzen_access ry, uint32_t value) {
case FAM_CEZANNE:
case FAM_VANGOGH:
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust_psmu(0x89);
break;
}
Expand All @@ -979,6 +1010,8 @@ EXP int CALL set_power_saving(ryzen_access ry) {
case FAM_CEZANNE:
case FAM_VANGOGH:
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust(0x12);
break;
}
Expand All @@ -1001,6 +1034,8 @@ EXP int CALL set_max_performance(ryzen_access ry) {
case FAM_CEZANNE:
case FAM_VANGOGH:
case FAM_REMBRANDT:
case FAM_MENDOCINO:
case FAM_PHEONIX:
_do_adjust(0x11);
break;
}
Expand Down Expand Up @@ -2570,4 +2605,4 @@ EXP float CALL get_socket_power(ryzen_access ry) {
_read_float_value(0xA8); //168
}
return NAN;
}
}
6 changes: 5 additions & 1 deletion lib/cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ static enum ryzen_family cpuid_load_family()
return FAM_LUCIENNE;
case 144:
return FAM_VANGOGH;
case 160:
return FAM_MENDOCINO;
default:
printf("Fam%xh: unsupported model %d\n", family, model);
break;
Expand All @@ -76,6 +78,8 @@ static enum ryzen_family cpuid_load_family()
case 64:
case 68:
return FAM_REMBRANDT;
case 116:
return FAM_PHEONIX;
default:
printf("Fam%xh: unsupported model %d\n", family, model);
break;
Expand Down Expand Up @@ -103,4 +107,4 @@ enum ryzen_family cpuid_get_family() {
cpuid_family = cpuid_load_family();

return cpuid_family;
}
}
2 changes: 1 addition & 1 deletion lib/nb_smu_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ smu_t get_smu(nb_t nb, int smu_type) {
/* Fill SMU information */
switch(smu_type){
case TYPE_MP1:
if (family == FAM_REMBRANDT || family == FAM_VANGOGH) {
if (family == FAM_REMBRANDT || family == FAM_VANGOGH || family == FAM_MENDOCINO || family == FAM_PHEONIX) {
smu->msg = MP1_C2PMSG_MESSAGE_ADDR_2;
smu->rep = MP1_C2PMSG_RESPONSE_ADDR_2;
smu->arg_base = MP1_C2PMSG_ARG_BASE_2;
Expand Down
2 changes: 2 additions & 0 deletions lib/ryzenadj.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ enum ryzen_family {
FAM_LUCIENNE,
FAM_VANGOGH,
FAM_REMBRANDT,
FAM_MENDOCINO,
FAM_PHEONIX,
FAM_END
};

Expand Down

0 comments on commit 607a7de

Please sign in to comment.