Skip to content

Commit f6faea7

Browse files
bryanbrattlofvireshk
authored andcommitted
cpufreq: ti: update OPP table for AM62Px SoCs
More speed grades for the AM62Px SoC family have been defined which unfortunately no longer align with the AM62x table. So create a new table with these new speed grades defined for the AM62Px Reviewed-by: Dhruva Gole <[email protected]> Signed-off-by: Bryan Brattlof <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent bc5de74 commit f6faea7

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

drivers/cpufreq/ti-cpufreq.c

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ enum {
6969
#define AM62A7_SUPPORT_R_MPU_OPP BIT(1)
7070
#define AM62A7_SUPPORT_V_MPU_OPP BIT(2)
7171

72+
#define AM62P5_EFUSE_O_MPU_OPP 15
73+
#define AM62P5_EFUSE_S_MPU_OPP 19
74+
#define AM62P5_EFUSE_U_MPU_OPP 21
75+
76+
#define AM62P5_SUPPORT_O_MPU_OPP BIT(0)
77+
#define AM62P5_SUPPORT_U_MPU_OPP BIT(2)
78+
7279
#define VERSION_COUNT 2
7380

7481
struct ti_cpufreq_data;
@@ -134,6 +141,23 @@ static unsigned long omap3_efuse_xlate(struct ti_cpufreq_data *opp_data,
134141
return BIT(efuse);
135142
}
136143

144+
static unsigned long am62p5_efuse_xlate(struct ti_cpufreq_data *opp_data,
145+
unsigned long efuse)
146+
{
147+
unsigned long calculated_efuse = AM62P5_SUPPORT_O_MPU_OPP;
148+
149+
switch (efuse) {
150+
case AM62P5_EFUSE_U_MPU_OPP:
151+
case AM62P5_EFUSE_S_MPU_OPP:
152+
calculated_efuse |= AM62P5_SUPPORT_U_MPU_OPP;
153+
fallthrough;
154+
case AM62P5_EFUSE_O_MPU_OPP:
155+
calculated_efuse |= AM62P5_SUPPORT_O_MPU_OPP;
156+
}
157+
158+
return calculated_efuse;
159+
}
160+
137161
static unsigned long am62a7_efuse_xlate(struct ti_cpufreq_data *opp_data,
138162
unsigned long efuse)
139163
{
@@ -291,6 +315,15 @@ static struct ti_cpufreq_soc_data am62a7_soc_data = {
291315
.multi_regulator = false,
292316
};
293317

318+
static struct ti_cpufreq_soc_data am62p5_soc_data = {
319+
.efuse_xlate = am62p5_efuse_xlate,
320+
.efuse_offset = 0x0,
321+
.efuse_mask = 0x07c0,
322+
.efuse_shift = 0x6,
323+
.rev_offset = 0x0014,
324+
.multi_regulator = false,
325+
};
326+
294327
/**
295328
* ti_cpufreq_get_efuse() - Parse and return efuse value present on SoC
296329
* @opp_data: pointer to ti_cpufreq_data context
@@ -395,7 +428,7 @@ static const struct of_device_id ti_cpufreq_of_match[] = {
395428
{ .compatible = "ti,omap36xx", .data = &omap36xx_soc_data, },
396429
{ .compatible = "ti,am625", .data = &am625_soc_data, },
397430
{ .compatible = "ti,am62a7", .data = &am62a7_soc_data, },
398-
{ .compatible = "ti,am62p5", .data = &am625_soc_data, },
431+
{ .compatible = "ti,am62p5", .data = &am62p5_soc_data, },
399432
/* legacy */
400433
{ .compatible = "ti,omap3430", .data = &omap34xx_soc_data, },
401434
{ .compatible = "ti,omap3630", .data = &omap36xx_soc_data, },

0 commit comments

Comments
 (0)