diff --git a/lib/api.c b/lib/api.c index f162c2f7..31d8d30d 100644 --- a/lib/api.c +++ b/lib/api.c @@ -434,6 +434,8 @@ do { \ EXP int CALL set_stapm_limit(ryzen_access ry, uint32_t value){ int err = ADJ_ERR_FAM_UNSUPPORTED; + /* \_SB.ALIB (0x0c, [size, 0x05, val]) */ + switch (ry->family) { case FAM_RAVEN: @@ -449,6 +451,7 @@ EXP int CALL set_stapm_limit(ryzen_access ry, uint32_t value){ case FAM_MENDOCINO: case FAM_PHOENIX: case FAM_HAWKPOINT: + case FAM_STRIXPOINT: _do_adjust(0x14); if (err) { printf("%s: Retry with PSMU\n", __func__); @@ -463,6 +466,7 @@ EXP int CALL set_stapm_limit(ryzen_access ry, uint32_t value){ EXP int CALL set_fast_limit(ryzen_access ry, uint32_t value){ int err = ADJ_ERR_FAM_UNSUPPORTED; + /* \_SB.ALIB (0x0c, [size, 0x06, val]) */ switch (ry->family) { case FAM_RAVEN: @@ -478,6 +482,7 @@ EXP int CALL set_fast_limit(ryzen_access ry, uint32_t value){ case FAM_MENDOCINO: case FAM_PHOENIX: case FAM_HAWKPOINT: + case FAM_STRIXPOINT: _do_adjust(0x15); default: break; @@ -488,6 +493,8 @@ EXP int CALL set_fast_limit(ryzen_access ry, uint32_t value){ EXP int CALL set_slow_limit(ryzen_access ry, uint32_t value){ int err = ADJ_ERR_FAM_UNSUPPORTED; + /* \_SB.ALIB (0x0c, [size, 0x07, val]) */ + switch (ry->family) { case FAM_RAVEN: @@ -503,6 +510,7 @@ EXP int CALL set_slow_limit(ryzen_access ry, uint32_t value){ case FAM_MENDOCINO: case FAM_PHOENIX: case FAM_HAWKPOINT: + case FAM_STRIXPOINT: _do_adjust(0x16); default: break; @@ -513,6 +521,8 @@ EXP int CALL set_slow_limit(ryzen_access ry, uint32_t value){ EXP int CALL set_slow_time(ryzen_access ry, uint32_t value){ int err = ADJ_ERR_FAM_UNSUPPORTED; + /* \_SB.ALIB (0x0c, [size, 0x08, val]) */ + switch (ry->family) { case FAM_RAVEN: @@ -528,6 +538,7 @@ EXP int CALL set_slow_time(ryzen_access ry, uint32_t value){ case FAM_MENDOCINO: case FAM_PHOENIX: case FAM_HAWKPOINT: + case FAM_STRIXPOINT: _do_adjust(0x17); default: break; @@ -538,6 +549,8 @@ EXP int CALL set_slow_time(ryzen_access ry, uint32_t value){ EXP int CALL set_stapm_time(ryzen_access ry, uint32_t value){ int err = ADJ_ERR_FAM_UNSUPPORTED; + /* \_SB.ALIB (0x0c, [size, 0x01, val]) */ + switch (ry->family) { case FAM_RAVEN: @@ -553,6 +566,7 @@ EXP int CALL set_stapm_time(ryzen_access ry, uint32_t value){ case FAM_MENDOCINO: case FAM_PHOENIX: case FAM_HAWKPOINT: + case FAM_STRIXPOINT: _do_adjust(0x18); default: break; @@ -563,6 +577,8 @@ EXP int CALL set_stapm_time(ryzen_access ry, uint32_t value){ EXP int CALL set_tctl_temp(ryzen_access ry, uint32_t value){ int err = ADJ_ERR_FAM_UNSUPPORTED; + /* \_SB.ALIB (0x0c, [size, 0x03, val]) */ + switch (ry->family) { case FAM_RAVEN: @@ -578,6 +594,7 @@ EXP int CALL set_tctl_temp(ryzen_access ry, uint32_t value){ case FAM_MENDOCINO: case FAM_PHOENIX: case FAM_HAWKPOINT: + case FAM_STRIXPOINT: _do_adjust(0x19); default: break; @@ -588,6 +605,8 @@ EXP int CALL set_tctl_temp(ryzen_access ry, uint32_t value){ EXP int CALL set_vrm_current(ryzen_access ry, uint32_t value){ int err = ADJ_ERR_FAM_UNSUPPORTED; + /* \_SB.ALIB (0x0c, [size, 0x0b, val]) */ + switch (ry->family) { case FAM_RAVEN: @@ -603,6 +622,7 @@ EXP int CALL set_vrm_current(ryzen_access ry, uint32_t value){ case FAM_MENDOCINO: case FAM_PHOENIX: case FAM_HAWKPOINT: + case FAM_STRIXPOINT: _do_adjust(0x1a); default: break; @@ -613,6 +633,8 @@ EXP int CALL set_vrm_current(ryzen_access ry, uint32_t value){ EXP int CALL set_vrmsoc_current(ryzen_access ry, uint32_t value){ int err = ADJ_ERR_FAM_UNSUPPORTED; + /* \_SB.ALIB (0x0c, [size, 0x0e, val]) */ + switch (ry->family) { case FAM_RAVEN: @@ -628,6 +650,7 @@ EXP int CALL set_vrmsoc_current(ryzen_access ry, uint32_t value){ case FAM_MENDOCINO: case FAM_PHOENIX: case FAM_HAWKPOINT: + case FAM_STRIXPOINT: _do_adjust(0x1b); default: break; @@ -664,6 +687,8 @@ EXP int CALL set_vrmcvip_current(ryzen_access ry, uint32_t value){ EXP int CALL set_vrmmax_current(ryzen_access ry, uint32_t value){ int err = ADJ_ERR_FAM_UNSUPPORTED; + /* \_SB.ALIB (0x0c, [size, 0x0c, val]) */ + switch (ry->family) { case FAM_RAVEN: @@ -678,6 +703,7 @@ EXP int CALL set_vrmmax_current(ryzen_access ry, uint32_t value){ case FAM_MENDOCINO: case FAM_PHOENIX: case FAM_HAWKPOINT: + case FAM_STRIXPOINT: _do_adjust(0x1c); break; case FAM_VANGOGH: @@ -704,6 +730,8 @@ EXP int CALL set_vrmgfxmax_current(ryzen_access ry, uint32_t value){ EXP int CALL set_vrmsocmax_current(ryzen_access ry, uint32_t value){ int err = ADJ_ERR_FAM_UNSUPPORTED; + /* \_SB.ALIB (0x0c, [size, 0x11, val]) */ + switch (ry->family) { case FAM_RAVEN: @@ -718,6 +746,7 @@ EXP int CALL set_vrmsocmax_current(ryzen_access ry, uint32_t value){ case FAM_MENDOCINO: case FAM_PHOENIX: case FAM_HAWKPOINT: + case FAM_STRIXPOINT: _do_adjust(0x1d); default: break; @@ -954,6 +983,8 @@ EXP int CALL set_min_lclk(ryzen_access ry, uint32_t value){ EXP int CALL set_prochot_deassertion_ramp(ryzen_access ry, uint32_t value) { int err = ADJ_ERR_FAM_UNSUPPORTED; + /* \_SB.ALIB (0x0c, [size, 0x09, val]) */ + switch (ry->family) { case FAM_RAVEN: @@ -973,6 +1004,7 @@ EXP int CALL set_prochot_deassertion_ramp(ryzen_access ry, uint32_t value) { case FAM_MENDOCINO: case FAM_PHOENIX: case FAM_HAWKPOINT: + case FAM_STRIXPOINT: _do_adjust(0x1f); default: break; @@ -983,6 +1015,8 @@ EXP int CALL set_prochot_deassertion_ramp(ryzen_access ry, uint32_t value) { EXP int CALL set_apu_skin_temp_limit(ryzen_access ry, uint32_t value) { int err = ADJ_ERR_FAM_UNSUPPORTED; + /* \_SB.ALIB (0x0c, [size, 0x22, val]) */ + value *= 256; switch (ry->family) { @@ -1007,6 +1041,8 @@ EXP int CALL set_apu_skin_temp_limit(ryzen_access ry, uint32_t value) { EXP int CALL set_dgpu_skin_temp_limit(ryzen_access ry, uint32_t value) { int err = ADJ_ERR_FAM_UNSUPPORTED; + /* \_SB.ALIB (0x0c, [size, 0x23, val]) */ + value *= 256; switch (ry->family) { @@ -1020,6 +1056,7 @@ EXP int CALL set_dgpu_skin_temp_limit(ryzen_access ry, uint32_t value) { case FAM_MENDOCINO: case FAM_PHOENIX: case FAM_HAWKPOINT: + case FAM_STRIXPOINT: _do_adjust(0x34); break; default: @@ -1031,6 +1068,8 @@ EXP int CALL set_dgpu_skin_temp_limit(ryzen_access ry, uint32_t value) { EXP int CALL set_apu_slow_limit(ryzen_access ry, uint32_t value) { int err = ADJ_ERR_FAM_UNSUPPORTED; + /* \_SB.ALIB (0x0c, [size, 0x13, val]) */ + switch (ry->family) { case FAM_RENOIR: @@ -1041,6 +1080,7 @@ EXP int CALL set_apu_slow_limit(ryzen_access ry, uint32_t value) { case FAM_REMBRANDT: case FAM_PHOENIX: case FAM_HAWKPOINT: + case FAM_STRIXPOINT: _do_adjust(0x23); break; default: @@ -1052,6 +1092,8 @@ EXP int CALL set_apu_slow_limit(ryzen_access ry, uint32_t value) { EXP int CALL set_skin_temp_power_limit(ryzen_access ry, uint32_t value) { int err = ADJ_ERR_FAM_UNSUPPORTED; + /* \_SB.ALIB (0x0c, [size, 0x2e, val]) */ + switch (ry->family) { case FAM_RENOIR: @@ -1064,6 +1106,7 @@ EXP int CALL set_skin_temp_power_limit(ryzen_access ry, uint32_t value) { case FAM_MENDOCINO: case FAM_PHOENIX: case FAM_HAWKPOINT: + case FAM_STRIXPOINT: _do_adjust(0x4a); break; default: @@ -1097,6 +1140,8 @@ EXP int CALL set_power_saving(ryzen_access ry) { int err = ADJ_ERR_FAM_UNSUPPORTED; uint32_t value = 0; + /* \_SB.ALIB (0x01, [size, 0x1]) */ + switch (ry->family) { case FAM_RAVEN: @@ -1112,6 +1157,7 @@ EXP int CALL set_power_saving(ryzen_access ry) { case FAM_MENDOCINO: case FAM_PHOENIX: case FAM_HAWKPOINT: + case FAM_STRIXPOINT: _do_adjust(0x12); break; default: @@ -1124,6 +1170,8 @@ EXP int CALL set_max_performance(ryzen_access ry) { int err = ADJ_ERR_FAM_UNSUPPORTED; uint32_t value = 0; + /* \_SB.ALIB (0x01, [size, 0x0]) */ + switch (ry->family) { case FAM_RAVEN: @@ -1139,6 +1187,7 @@ EXP int CALL set_max_performance(ryzen_access ry) { case FAM_MENDOCINO: case FAM_PHOENIX: case FAM_HAWKPOINT: + case FAM_STRIXPOINT: _do_adjust(0x11); break; default: diff --git a/lib/nb_smu_ops.c b/lib/nb_smu_ops.c index fc2eb210..4224cd19 100644 --- a/lib/nb_smu_ops.c +++ b/lib/nb_smu_ops.c @@ -74,14 +74,26 @@ 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 || family == FAM_MENDOCINO || family == FAM_PHOENIX || family == FAM_HAWKPOINT) { + switch (family) { + case FAM_REMBRANDT: + case FAM_VANGOGH: + case FAM_MENDOCINO: + case FAM_PHOENIX: + case FAM_HAWKPOINT: smu->msg = MP1_C2PMSG_MESSAGE_ADDR_2; smu->rep = MP1_C2PMSG_RESPONSE_ADDR_2; smu->arg_base = MP1_C2PMSG_ARG_BASE_2; - } else { + break; + case FAM_STRIXPOINT: + smu->msg = MP1_C2PMSG_MESSAGE_ADDR_3; + smu->rep = MP1_C2PMSG_RESPONSE_ADDR_3; + smu->arg_base = MP1_C2PMSG_ARG_BASE_3; + break; + default: smu->msg = MP1_C2PMSG_MESSAGE_ADDR_1; smu->rep = MP1_C2PMSG_RESPONSE_ADDR_1; smu->arg_base = MP1_C2PMSG_ARG_BASE_1; + break; } break; case TYPE_PSMU: diff --git a/lib/nb_smu_ops.h b/lib/nb_smu_ops.h index 10eac629..37a6910d 100644 --- a/lib/nb_smu_ops.h +++ b/lib/nb_smu_ops.h @@ -44,6 +44,11 @@ enum SMU_TYPE{ #define MP1_C2PMSG_RESPONSE_ADDR_2 0x3B10578 #define MP1_C2PMSG_ARG_BASE_2 0x3B10998 +/* For Strix Point */ +#define MP1_C2PMSG_MESSAGE_ADDR_3 0x3b10928 +#define MP1_C2PMSG_RESPONSE_ADDR_3 0x3b10978 +#define MP1_C2PMSG_ARG_BASE_3 0x3b10998 + #define PSMU_C2PMSG_MESSAGE_ADDR 0x3B10a20 #define PSMU_C2PMSG_RESPONSE_ADDR 0x3B10a80 #define PSMU_C2PMSG_ARG_BASE 0x3B10a88