Skip to content

Commit

Permalink
Support cpufreq for t6031
Browse files Browse the repository at this point in the history
This seems to work, and matches the info i can find.

Signed-off-by: Daniel Berlin <[email protected]>
  • Loading branch information
dberlin authored and marcan committed Oct 30, 2024
1 parent 4b0fde2 commit 61cf108
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ static const struct cluster_t t6022_clusters[] = {
{},
};

static const struct cluster_t t6031_clusters[] = {
{"ECPU0", 0x210e00000, false, 1, 5},
{"PCPU0", 0x211e00000, true, 1, 6},
{"PCPU1", 0x212e00000, true, 1, 6},
{},
};
const struct cluster_t *cpufreq_get_clusters(void)
{
switch (chip_id) {
Expand All @@ -211,6 +217,8 @@ const struct cluster_t *cpufreq_get_clusters(void)
return t6020_clusters;
case T6022:
return t6022_clusters;
case T6031:
return t6031_clusters;
default:
printf("cpufreq: Chip 0x%x is unsupported\n", chip_id);
return NULL;
Expand Down Expand Up @@ -250,6 +258,16 @@ static const struct feat_t t6020_features[] = {
{},
};

static const struct feat_t t6031_features[] = {
{"cpu-apsc", CLUSTER_PSTATE, CLUSTER_PSTATE_M2_APSC_DIS, 0, CLUSTER_PSTATE_APSC_BUSY, false},
{"ppt-thrtl", 0x48400, 0, BIT(63), 0, false},
{"llc-thrtl", 0x40270, 0, BIT(63), 0, false},
{"amx-thrtl", 0x40250, 0, BIT(63), 0, false},
{"cpu-fixed-freq-pll-relock", CLUSTER_PSTATE, 0, CLUSTER_PSTATE_FIXED_FREQ_PLL_RECLOCK, 0,
false},
{},
};

const struct feat_t *cpufreq_get_features(void)
{
switch (chip_id) {
Expand All @@ -262,6 +280,8 @@ const struct feat_t *cpufreq_get_features(void)
case T6021:
case T6022:
return t6020_features;
case T6031:
return t6031_features;
default:
printf("cpufreq: Chip 0x%x is unsupported\n", chip_id);
return NULL;
Expand Down

0 comments on commit 61cf108

Please sign in to comment.