]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arm: mach-k3: am62: Get a53 max cpu frequency by speed grade
authorJoao Paulo Goncalves <joao.goncalves@toradex.com>
Wed, 20 Mar 2024 12:16:31 +0000 (09:16 -0300)
committerTom Rini <trini@konsulko.com>
Thu, 11 Apr 2024 21:50:56 +0000 (15:50 -0600)
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>
arch/arm/mach-k3/include/mach/am62_hardware.h

index 264f8a488b4d83d28b0de62c087ae030dc8b3db8..90682d8ee31fe6257a0fe18568a360859c65a754 100644 (file)
@@ -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);