summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2022-08-23 09:36:22 +0800
committerYe Li <ye.li@nxp.com>2022-08-24 13:48:43 +0800
commitbcb12b8c8252eda4646ee2258d2941efc4a3e7aa (patch)
tree4d8895507954277b68b4a5b3131f80366aa4ba8d /arch/arm/mach-imx
parent81211a4f359a0c93ac54844f30efc9ab94ff5907 (diff)
LF-6798 imx: ele_ahab: confirm lifecycle before closing the part
Before moving the lifecycle to OEM closed, confirm the lifecycle is OEM open, otherwise cancel to move forward the lifecycle. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/ele_ahab.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/ele_ahab.c b/arch/arm/mach-imx/ele_ahab.c
index 66732c5fae..7e40243ae7 100644
--- a/arch/arm/mach-imx/ele_ahab.c
+++ b/arch/arm/mach-imx/ele_ahab.c
@@ -474,10 +474,20 @@ static int do_ahab_close(struct cmd_tbl *cmdtp, int flag, int argc,
{
int err;
u32 resp;
+ u32 lc;
if (!confirm_close())
return -EACCES;
+ lc = readl(FSB_BASE_ADDR + 0x41c);
+ lc &= 0x3ff;
+
+ if (lc != 0x8) {
+ puts("Current lifecycle is NOT OEM open, can't move to OEM closed\n");
+ display_life_cycle(lc);
+ return -EPERM;
+ }
+
err = ahab_forward_lifecycle(8, &resp);
if (err != 0) {
printf("Error in forward lifecycle to OEM closed\n");