summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Guo <[email protected]>2026-07-28 15:03:14 +0900
committerFabio Estevam <[email protected]>2026-08-03 09:31:54 -0300
commit01b7aee2ee995ca5089797f82bf3da7d4cc7025b (patch)
treee4b63360c06e502e6f5e664d9f95f015f13d52b4
parent4eeaaee054bec28a2af4ed9162381255dfd22c4b (diff)
imx: scmi: suppress invalid origin/errid in reset reason print
Only print origin and errid fields when the corresponding valid bits (MISC_BOOT_FLAG_ORG_VLD and MISC_BOOT_FLAG_ERR_VLD) are set. For a normal power-on reset, these fields are not valid, and printing -1 is just noise. Signed-off-by: Joseph Guo <[email protected]>
-rw-r--r--arch/arm/mach-imx/imx9/scmi/soc.c52
1 files changed, 24 insertions, 28 deletions
diff --git a/arch/arm/mach-imx/imx9/scmi/soc.c b/arch/arm/mach-imx/imx9/scmi/soc.c
index e8f739920be..8bb3ce5cad9 100644
--- a/arch/arm/mach-imx/imx9/scmi/soc.c
+++ b/arch/arm/mach-imx/imx9/scmi/soc.c
@@ -773,22 +773,20 @@ int get_reset_reason(bool sys, bool lm)
}
if (out.bootflags & MISC_BOOT_FLAG_VLD) {
- printf("SYS Boot reason: %s, origin: %ld, errid: %ld\n",
- rst[out.bootflags & MISC_BOOT_FLAG_REASON],
- out.bootflags & MISC_BOOT_FLAG_ORG_VLD ?
- FIELD_GET(MISC_BOOT_FLAG_ORIGIN, out.bootflags) : -1,
- out.bootflags & MISC_BOOT_FLAG_ERR_VLD ?
- FIELD_GET(MISC_BOOT_FLAG_ERR_ID, out.bootflags) : -1
- );
+ printf("SYS Boot reason: %s", rst[out.bootflags & MISC_BOOT_FLAG_REASON]);
+ if (out.bootflags & MISC_BOOT_FLAG_ORG_VLD)
+ printf(", origin: %ld", FIELD_GET(MISC_BOOT_FLAG_ORIGIN, out.bootflags));
+ if (out.bootflags & MISC_BOOT_FLAG_ERR_VLD)
+ printf(", errid: %ld", FIELD_GET(MISC_BOOT_FLAG_ERR_ID, out.bootflags));
+ puts("\n");
}
if (out.shutdownflags & MISC_SHUTDOWN_FLAG_VLD) {
- printf("SYS shutdown reason: %s, origin: %ld, errid: %ld\n",
- rst[out.shutdownflags & MISC_SHUTDOWN_FLAG_REASON],
- out.shutdownflags & MISC_SHUTDOWN_FLAG_ORG_VLD ?
- FIELD_GET(MISC_SHUTDOWN_FLAG_ORIGIN, out.shutdownflags) : -1,
- out.shutdownflags & MISC_SHUTDOWN_FLAG_ERR_VLD ?
- FIELD_GET(MISC_SHUTDOWN_FLAG_ERR_ID, out.shutdownflags) : -1
- );
+ printf("SYS shutdown reason: %s", rst[out.shutdownflags & MISC_SHUTDOWN_FLAG_REASON]);
+ if (out.shutdownflags & MISC_SHUTDOWN_FLAG_ORG_VLD)
+ printf(", origin: %ld", FIELD_GET(MISC_SHUTDOWN_FLAG_ORIGIN, out.shutdownflags));
+ if (out.shutdownflags & MISC_SHUTDOWN_FLAG_ERR_VLD)
+ printf(", errid: %ld", FIELD_GET(MISC_SHUTDOWN_FLAG_ERR_ID, out.shutdownflags));
+ puts("\n");
}
}
@@ -803,23 +801,21 @@ int get_reset_reason(bool sys, bool lm)
}
if (out.bootflags & MISC_BOOT_FLAG_VLD) {
- printf("LM Boot reason: %s, origin: %ld, errid: %ld\n",
- rst[out.bootflags & MISC_BOOT_FLAG_REASON],
- out.bootflags & MISC_BOOT_FLAG_ORG_VLD ?
- FIELD_GET(MISC_BOOT_FLAG_ORIGIN, out.bootflags) : -1,
- out.bootflags & MISC_BOOT_FLAG_ERR_VLD ?
- FIELD_GET(MISC_BOOT_FLAG_ERR_ID, out.bootflags) : -1
- );
+ printf("LM Boot reason: %s", rst[out.bootflags & MISC_BOOT_FLAG_REASON]);
+ if (out.bootflags & MISC_BOOT_FLAG_ORG_VLD)
+ printf(", origin: %ld", FIELD_GET(MISC_BOOT_FLAG_ORIGIN, out.bootflags));
+ if (out.bootflags & MISC_BOOT_FLAG_ERR_VLD)
+ printf(", errid: %ld", FIELD_GET(MISC_BOOT_FLAG_ERR_ID, out.bootflags));
+ puts("\n");
}
if (out.shutdownflags & MISC_SHUTDOWN_FLAG_VLD) {
- printf("LM shutdown reason: %s, origin: %ld, errid: %ld\n",
- rst[out.shutdownflags & MISC_SHUTDOWN_FLAG_REASON],
- out.shutdownflags & MISC_SHUTDOWN_FLAG_ORG_VLD ?
- FIELD_GET(MISC_SHUTDOWN_FLAG_ORIGIN, out.shutdownflags) : -1,
- out.shutdownflags & MISC_SHUTDOWN_FLAG_ERR_VLD ?
- FIELD_GET(MISC_SHUTDOWN_FLAG_ERR_ID, out.shutdownflags) : -1
- );
+ printf("LM shutdown reason: %s", rst[out.shutdownflags & MISC_SHUTDOWN_FLAG_REASON]);
+ if (out.shutdownflags & MISC_SHUTDOWN_FLAG_ORG_VLD)
+ printf(", origin: %ld", FIELD_GET(MISC_SHUTDOWN_FLAG_ORIGIN, out.shutdownflags));
+ if (out.shutdownflags & MISC_SHUTDOWN_FLAG_ERR_VLD)
+ printf(", errid: %ld", FIELD_GET(MISC_SHUTDOWN_FLAG_ERR_ID, out.shutdownflags));
+ puts("\n");
}
}