Add support for resuming from suspend in board_init_f for J722S. The resume state of the SOC is identified and lpm resume sequence is followed accordingly:
- Extract context address from devicetree and send to TIFS. - Power on the rproc cluster. - Replay the certificates attached to saved images of ATF and OPTEE. - Resume sequence for context restore and rproc resume. - Image entry to DM firmware. The context address area is firewalled by TIFS to protect it from other hosts. Signed-off-by: Richard Genoud (TI) <[email protected]> --- arch/arm/mach-k3/j722s/j722s_init.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-k3/j722s/j722s_init.c b/arch/arm/mach-k3/j722s/j722s_init.c index 1180c75f551d..e687bcb354c9 100644 --- a/arch/arm/mach-k3/j722s/j722s_init.c +++ b/arch/arm/mach-k3/j722s/j722s_init.c @@ -14,6 +14,7 @@ #include "../sysfw-loader.h" #include "../common.h" +#include "../lpm-common.h" struct fwl_data cbass_main_fwls[] = { { "FSS_DAT_REG3", 7, 8 }, @@ -37,7 +38,7 @@ static void store_boot_info_from_rom(void) sizeof(struct rom_extended_boot_data)); } -static void ctrl_mmr_unlock(void) +void ctrl_mmr_unlock(void) { /* Unlock all WKUP_CTRL_MMR0 module registers */ mmr_unlock(WKUP_CTRL_MMR0_BASE, 0); @@ -156,6 +157,11 @@ static void k3_spl_init(void) k3_dm_print_ver(); } +__weak bool j7xx_board_is_resuming(void) +{ + return false; +} + static void k3_mem_init(void) { struct udevice *dev; @@ -186,6 +192,9 @@ void board_init_f(ulong dummy) k3_spl_init(); k3_mem_init(); + if (j7xx_board_is_resuming()) + do_resume(); /* no return */ + setup_qos(); if (IS_ENABLED(CONFIG_ESM_K3)) { -- 2.47.3

