Skip to content

Commit dea8bfe

Browse files
DhruvaG2000vireshk
authored andcommitted
cpufreq: ti-cpufreq: add support for AM62L3 SoC
Add CPUFreq support for the AM62L3 SoC with the appropriate AM62L3 speed grade constants according to the datasheet [1]. This follows the same architecture-specific implementation pattern as other TI SoCs in the AM6x family. While at it, also sort instances where the SOC family names were not sorted alphabetically. [1] https://www.ti.com/lit/pdf/SPRSPA1 Signed-off-by: Dhruva Gole <d-gole@ti.com> Reviewed-by: Kendall Willis <k-willis@ti.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent 945fc28 commit dea8bfe

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

drivers/cpufreq/ti-cpufreq.c

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ enum {
7070
#define AM62A7_SUPPORT_R_MPU_OPP BIT(1)
7171
#define AM62A7_SUPPORT_V_MPU_OPP BIT(2)
7272

73+
#define AM62L3_EFUSE_E_MPU_OPP 5
74+
#define AM62L3_EFUSE_O_MPU_OPP 15
75+
76+
#define AM62L3_SUPPORT_E_MPU_OPP BIT(0)
77+
#define AM62L3_SUPPORT_O_MPU_OPP BIT(1)
78+
7379
#define AM62P5_EFUSE_O_MPU_OPP 15
7480
#define AM62P5_EFUSE_S_MPU_OPP 19
7581
#define AM62P5_EFUSE_T_MPU_OPP 20
@@ -213,6 +219,22 @@ static unsigned long am625_efuse_xlate(struct ti_cpufreq_data *opp_data,
213219
return calculated_efuse;
214220
}
215221

222+
static unsigned long am62l3_efuse_xlate(struct ti_cpufreq_data *opp_data,
223+
unsigned long efuse)
224+
{
225+
unsigned long calculated_efuse = AM62L3_SUPPORT_E_MPU_OPP;
226+
227+
switch (efuse) {
228+
case AM62L3_EFUSE_O_MPU_OPP:
229+
calculated_efuse |= AM62L3_SUPPORT_O_MPU_OPP;
230+
fallthrough;
231+
case AM62L3_EFUSE_E_MPU_OPP:
232+
calculated_efuse |= AM62L3_SUPPORT_E_MPU_OPP;
233+
}
234+
235+
return calculated_efuse;
236+
}
237+
216238
static struct ti_cpufreq_soc_data am3x_soc_data = {
217239
.efuse_xlate = amx3_efuse_xlate,
218240
.efuse_fallback = AM33XX_800M_ARM_MPU_MAX_FREQ,
@@ -313,8 +335,9 @@ static struct ti_cpufreq_soc_data am3517_soc_data = {
313335
static const struct soc_device_attribute k3_cpufreq_soc[] = {
314336
{ .family = "AM62X", },
315337
{ .family = "AM62AX", },
316-
{ .family = "AM62PX", },
317338
{ .family = "AM62DX", },
339+
{ .family = "AM62LX", },
340+
{ .family = "AM62PX", },
318341
{ /* sentinel */ }
319342
};
320343

@@ -335,6 +358,14 @@ static struct ti_cpufreq_soc_data am62a7_soc_data = {
335358
.multi_regulator = false,
336359
};
337360

361+
static struct ti_cpufreq_soc_data am62l3_soc_data = {
362+
.efuse_xlate = am62l3_efuse_xlate,
363+
.efuse_offset = 0x0,
364+
.efuse_mask = 0x07c0,
365+
.efuse_shift = 0x6,
366+
.multi_regulator = false,
367+
};
368+
338369
static struct ti_cpufreq_soc_data am62p5_soc_data = {
339370
.efuse_xlate = am62p5_efuse_xlate,
340371
.efuse_offset = 0x0,
@@ -463,6 +494,7 @@ static const struct of_device_id ti_cpufreq_of_match[] __maybe_unused = {
463494
{ .compatible = "ti,am625", .data = &am625_soc_data, },
464495
{ .compatible = "ti,am62a7", .data = &am62a7_soc_data, },
465496
{ .compatible = "ti,am62d2", .data = &am62a7_soc_data, },
497+
{ .compatible = "ti,am62l3", .data = &am62l3_soc_data, },
466498
{ .compatible = "ti,am62p5", .data = &am62p5_soc_data, },
467499
/* legacy */
468500
{ .compatible = "ti,omap3430", .data = &omap34xx_soc_data, },

0 commit comments

Comments
 (0)