]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arm: mach-k3: Detect and print reset reason
authorWadim Egorov <w.egorov@phytec.de>
Thu, 15 May 2025 11:15:53 +0000 (13:15 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 29 May 2025 14:32:28 +0000 (08:32 -0600)
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>
arch/arm/mach-k3/common.c
arch/arm/mach-k3/include/mach/hardware.h

index fc230f180d0e667fa55f9c10cffaa54afdb91424..0323001d6d3746801b2c379a849c7b2e0d5b977a 100644 (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
index fc7bee4d00b0fab58432b70ad7512241a4a6a307..81b5f1fa45ea30456a43c6640aad01388ea6a3f2 100644 (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_ */