diff options
| author | Wadim Egorov <[email protected]> | 2025-05-15 13:15:53 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-05-29 08:32:28 -0600 |
| commit | a282950debce20035cc12672c856ff2d70326ad4 (patch) | |
| tree | 49f3c5ff2b18282446ff029ca60a3df2e13be7e3 /arch | |
| parent | 5b82721337e271609419dce490884392085d8d1f (diff) | |
arm: mach-k3: Detect and print reset reason
Call get_reset_reason() during CPU info output and display the result
if the SoC provides the implementation. This helps in debugging by
providing context on the last system reset reason.
Signed-off-by: Wadim Egorov <[email protected]>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/arm/mach-k3/common.c | 10 | ||||
| -rw-r--r-- | arch/arm/mach-k3/include/mach/hardware.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index fc230f180d0..0323001d6d3 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -175,11 +175,17 @@ static const char *get_device_type_name(void) } } +__weak const char *get_reset_reason(void) +{ + return NULL; +} + int print_cpuinfo(void) { struct udevice *soc; char name[64]; int ret; + const char *reset_reason; printf("SoC: "); @@ -201,6 +207,10 @@ int print_cpuinfo(void) printf("%s\n", get_device_type_name()); + reset_reason = get_reset_reason(); + if (reset_reason) + printf("Reset reason: %s\n", reset_reason); + return 0; } #endif diff --git a/arch/arm/mach-k3/include/mach/hardware.h b/arch/arm/mach-k3/include/mach/hardware.h index fc7bee4d00b..81b5f1fa45e 100644 --- a/arch/arm/mach-k3/include/mach/hardware.h +++ b/arch/arm/mach-k3/include/mach/hardware.h @@ -125,4 +125,5 @@ struct rom_extended_boot_data { }; u32 get_boot_device(void); +const char *get_reset_reason(void); #endif /* _ASM_ARCH_HARDWARE_H_ */ |
