Le 01/06/2026 à 10:29, Thomas Richard a écrit :
On 4/30/26 10:43 AM, Richard Genoud (TI) wrote:
From: "Thomas Richard (TI)" <[email protected]>
Add the capability to detect a resume. This overrides the weak
function j7xx_board_is_resuming(void).
To detect the resume, SPL searches a magic value (0xBA) in a register
of PMICA.
This value is set by DM-Firmware during the suspend sequence.
Signed-off-by: Thomas Richard (TI) <[email protected]>
Co-developed-by: Gregory CLEMENT (TI) <[email protected]>
Signed-off-by: Gregory CLEMENT (TI) <[email protected]>
Co-developed-by: Richard Genoud (TI) <[email protected]>
Signed-off-by: Richard Genoud (TI) <[email protected]>
---
board/ti/common/k3-lpm.h | 17 +++++++++++++++++
board/ti/j721e/evm.c | 37 +++++++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+)
create mode 100644 board/ti/common/k3-lpm.h
diff --git a/board/ti/common/k3-lpm.h b/board/ti/common/k3-lpm.h
new file mode 100644
index 000000000000..a2141a0c25a8
--- /dev/null
+++ b/board/ti/common/k3-lpm.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2026, Texas Instruments Incorporated - https://www.ti.com/
+ * Copyright (C) 2026, Bootlin
+ */
+
+#ifndef __K3_LPM_H
+#define __K3_LPM_H
+
+/* Magic value in PMIC register to indicate the suspend state (SOC_OFF) */
+#define K3_LPM_MAGIC_SUSPEND 0xba
+
+/* PMIC register where the magic value resides */
+#define K3_LPM_SCRATCH_PAD_REG 0xcb
K3_LPM_SCRATCH_PAD_REG_3 so we easily know it is scratchpad reg 3.
ok
We currently use the entire SCRATCH_PAD_REG_3 register to mark a resume.
Some PMICs in certain configurations use some scratchpad registers for
other purposes, so we could consider using only a specific bit range (or
even a single bit) and document it. This would free up the remaining
bits for other uses.
However, an 8-bit magic value is likely more robust against accidental
user modification.
No strong opinion, just raising the topic for discussion.
This is indeed a good point.
Thanks!
Best Regards,
Thomas
Regards,
Richars