aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-k3
diff options
context:
space:
mode:
authorJoao Paulo Goncalves2024-03-20 09:16:31 -0300
committerTom Rini2024-04-11 15:50:56 -0600
commitba26524cad98aa70913afb7a2436949ac14c3b41 (patch)
treeae923bbfc3b506800bf6d6aab2cf9e4d6e3b5281 /arch/arm/mach-k3
parente8c828f124a51a52fc0e8346cd255d60de4f3d5f (diff)
arm: mach-k3: am62: Get a53 max cpu frequency by speed grade
AM62 SoC has multiple speed grades. Add function to return max A53 CPU frequency based on grade. Fastest grade's max frequency also depends on PMIC voltage, to simplify implementation use the smaller value. Suggested-by: Vignesh Raghavendra <vigneshr@ti.com> Signed-off-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
Diffstat (limited to 'arch/arm/mach-k3')
-rw-r--r--arch/arm/mach-k3/include/mach/am62_hardware.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/mach-k3/include/mach/am62_hardware.h b/arch/arm/mach-k3/include/mach/am62_hardware.h
index 264f8a488b4..90682d8ee31 100644
--- a/arch/arm/mach-k3/include/mach/am62_hardware.h
+++ b/arch/arm/mach-k3/include/mach/am62_hardware.h
@@ -122,6 +122,21 @@ static inline int k3_get_max_temp(void)
}
}
+static inline int k3_get_a53_max_frequency(void)
+{
+ switch (k3_get_speed_grade()) {
+ case 'K':
+ return 800000000;
+ case 'S':
+ return 1000000000;
+ case 'T':
+ return 1250000000;
+ case 'G':
+ default:
+ return 300000000;
+ }
+}
+
static inline int k3_has_pru(void)
{
u32 full_devid = readl(CTRLMMR_WKUP_JTAG_DEVICE_ID);