]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: mach-k3: am62: provide more soc feature info accessors
authorMax Krummenacher <max.krummenacher@toradex.com>
Wed, 17 Jan 2024 10:16:48 +0000 (11:16 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 24 Jan 2024 16:12:11 +0000 (11:12 -0500)
Add two functions, one which returns the SoC speed grade and one
which returns the SoC operating temperature range.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
arch/arm/mach-k3/include/mach/am62_hardware.h

index ea5bcf5d3def4f7d5342fc4dfa7730a252efccd8..54380f36e161f95b04b4f81a5a9b44bdcb156151 100644 (file)
@@ -86,6 +86,22 @@ static inline int k3_get_core_nr(void)
        return (full_devid & JTAG_DEV_CORE_NR_MASK) >> JTAG_DEV_CORE_NR_SHIFT;
 }
 
+static inline char k3_get_speed_grade(void)
+{
+       u32 full_devid = readl(CTRLMMR_WKUP_JTAG_DEVICE_ID);
+       u32 speed_grade = (full_devid & JTAG_DEV_SPEED_MASK) >>
+                          JTAG_DEV_SPEED_SHIFT;
+
+       return 'A' - 1 + speed_grade;
+}
+
+static inline int k3_get_temp_grade(void)
+{
+       u32 full_devid = readl(CTRLMMR_WKUP_JTAG_DEVICE_ID);
+
+       return (full_devid & JTAG_DEV_TEMP_MASK) >> JTAG_DEV_TEMP_SHIFT;
+}
+
 static inline int k3_has_pru(void)
 {
        u32 full_devid = readl(CTRLMMR_WKUP_JTAG_DEVICE_ID);