From d6451cc1e162eff89b03dd63e86d55b9baa8885b Mon Sep 17 00:00:00 2001 From: Teo Hall Date: Tue, 27 Nov 2018 14:50:50 -0600 Subject: plat: imx8qm/imx8qxp: Add MU flag check for partition reboot Test if a partition reboot has taken place with the MU interrupt bit. Check before returning the entrypoint Signed-off-by: Teo Hall (cherry picked from commit 627396daa5d9b62e8a0fb118844d1507b94e23f5) --- plat/imx/common/imx8_helpers.S | 19 +++++++++++++++++++ plat/imx/imx8qm/include/platform_def.h | 5 +++++ plat/imx/imx8qxp/include/platform_def.h | 4 ++++ 3 files changed, 28 insertions(+) diff --git a/plat/imx/common/imx8_helpers.S b/plat/imx/common/imx8_helpers.S index 18330281..a8293dce 100644 --- a/plat/imx/common/imx8_helpers.S +++ b/plat/imx/common/imx8_helpers.S @@ -116,6 +116,25 @@ endfunc plat_reset_handler * --------------------------------------------- */ func plat_get_my_entrypoint + +#if defined(PLAT_IMX8QXP) || defined(PLAT_IMX8QM) + /* --------------------------------------------- + * SCU will signal through a GIR bit when a + * partition boot has taken place which requires + * cold boot setup to take place once again + * --------------------------------------------- + */ + + mov x0, #PLAT_BOOT_MU_BASE + add x0, x0, #PLAT_MU_SR_OFF + ldr w1, [x0] + and w1, w1, #PLAT_MU_COLD_BOOT_FLG_MSK + cbz w1, warm_boot + str w1, [x0] + mov x0, #0 + ret +warm_boot: +#endif adrp x1, mailbox_base ldr x0, [x1, :lo12:mailbox_base] ret diff --git a/plat/imx/imx8qm/include/platform_def.h b/plat/imx/imx8qm/include/platform_def.h index 6add4716..720b2a58 100644 --- a/plat/imx/imx8qm/include/platform_def.h +++ b/plat/imx/imx8qm/include/platform_def.h @@ -28,6 +28,11 @@ #define PLAT_MAX_OFF_STATE 2 #define PLAT_MAX_RET_STATE 1 +#define PLAT_MU_SR_OFF 0x20 +#define PLAT_MU_COLD_BOOT_FLG_MSK 0x40000000 +#define PLAT_BOOT_MU_BASE 0x5D1B0000 + + #define BL31_BASE 0x80000000 #define BL31_LIMIT 0x80020000 diff --git a/plat/imx/imx8qxp/include/platform_def.h b/plat/imx/imx8qxp/include/platform_def.h index 4b656a79..31b67dec 100644 --- a/plat/imx/imx8qxp/include/platform_def.h +++ b/plat/imx/imx8qxp/include/platform_def.h @@ -25,6 +25,10 @@ #define PLAT_MAX_OFF_STATE 2 #define PLAT_MAX_RET_STATE 1 +#define PLAT_MU_SR_OFF 0x20 +#define PLAT_MU_COLD_BOOT_FLG_MSK 0x40000000 +#define PLAT_BOOT_MU_BASE 0x5D1B0000 + #define BL31_BASE 0x80000000 #define BL31_LIMIT 0x80020000 -- cgit v1.2.3