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 <w.egorov@phytec.de>
This commit is contained in:
Wadim Egorov
2025-05-15 13:15:53 +02:00
committed by Tom Rini
parent 5b82721337
commit a282950deb
2 changed files with 11 additions and 0 deletions

View File

@@ -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

View File

@@ -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_ */