diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2024-01-17 11:16:48 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-01-24 11:12:11 -0500 |
commit | 00812e2257c95556af5fce5a131fbbcbc14d7615 (patch) | |
tree | 535caf5859af8fed991f42df2a669ef8e5f8f661 | |
parent | 9c68b0427cd75b22758f8b262a6b9e8bcca64320 (diff) | |
download | u-boot-00812e2257c95556af5fce5a131fbbcbc14d7615.zip u-boot-00812e2257c95556af5fce5a131fbbcbc14d7615.tar.gz u-boot-00812e2257c95556af5fce5a131fbbcbc14d7615.tar.bz2 |
arm: mach-k3: am62: provide more soc feature info accessors
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>
-rw-r--r-- | arch/arm/mach-k3/include/mach/am62_hardware.h | 16 |
1 files changed, 16 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 ea5bcf5..54380f3 100644 --- a/arch/arm/mach-k3/include/mach/am62_hardware.h +++ b/arch/arm/mach-k3/include/mach/am62_hardware.h @@ -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); |