Skip to contentSkip to conversation

misc: sentinel: s400_api: Add get_events API

PATCH New Ye Li 2 participants 12 messages Jan 30, 2023 – Mar 29, 2023

Subsystems (4)
lore
Share & tools
lore

Ye Li

author
#0 lore raw

PATCH 1/6 misc: sentinel: s400_api: Add get_events API

Add get_events API to retrieve any singular events that has occurred since the FW has started from sentinel

---
 arch/arm/include/asm/mach-imx/s400_api.h |  2 ++
 drivers/misc/sentinel/s400_api.c         | 45 ++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)
arch/arm/include/asm/mach-imx/s400_api.h +2 -0
index 4819f20..79539b7 100644
@@ -18,6 +18,7 @@
 #define AHAB_FWD_LIFECYCLE_UP_REQ_CID   0x95
 #define AHAB_READ_FUSE_REQ_CID	0x97
 #define AHAB_GET_FW_VERSION_CID	0x9D
+#define AHAB_GET_EVENTS_REQ_CID 0xA2
 #define AHAB_RELEASE_RDC_REQ_CID   0xC4
 #define AHAB_GET_FW_STATUS_CID   0xC5
 #define AHAB_WRITE_FUSE_REQ_CID	0xD6
@@ -58,5 +59,6 @@ int ahab_dump_buffer(u32 *buffer, u32 buffer_length);
 int ahab_get_info(struct sentinel_get_info_data *info, u32 *response);
 int ahab_get_fw_status(u32 *status, u32 *response);
 int ahab_release_m33_trout(void);
+int ahab_get_events(u32 *events, u32 *events_cnt, u32 *response);
 
 #endif
drivers/misc/sentinel/s400_api.c +45 -0

48 lines not on this page · raw message

Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 2/6 imx93: ahab: Get and decode AHAB events

For ahab_status command, support to get and decode AHAB events

---
 arch/arm/include/asm/mach-imx/s400_api.h |  99 +++++++++++
 arch/arm/mach-imx/imx9/ahab.c            | 286 ++++++++++++++++++++++++++++---
 2 files changed, 359 insertions(+), 26 deletions(-)
arch/arm/include/asm/mach-imx/s400_api.h +99 -0
index 79539b7..c87a7c1 100644
@@ -10,6 +10,105 @@
 #define AHAB_CMD_TAG    0x17
 #define AHAB_RESP_TAG   0xe1
 
+/* ELE commands */
+#define ELE_PING_REQ (0x01)
+#define ELE_FW_AUTH_REQ (0x02)
+#define ELE_RESTART_RST_TIMER_REQ (0x04)
+#define ELE_DUMP_DEBUG_BUFFER_REQ (0x21)
+#define ELE_OEM_CNTN_AUTH_REQ (0x87)
+#define ELE_VERIFY_IMAGE_REQ (0x88)
+#define ELE_RELEASE_CONTAINER_REQ (0x89)
+#define ELE_WRITE_SECURE_FUSE_REQ (0x91)
+#define ELE_FWD_LIFECYCLE_UP_REQ (0x95)
+#define ELE_READ_FUSE_REQ (0x97)
+#define ELE_GET_FW_VERSION_REQ (0x9D)
+#define ELE_RET_LIFECYCLE_UP_REQ (0xA0)
+#define ELE_GET_EVENTS_REQ (0xA2)
+#define ELE_ENABLE_PATCH_REQ (0xC3)
+#define ELE_RELEASE_RDC_REQ (0xC4)
+#define ELE_GET_FW_STATUS_REQ (0xC5)
+#define ELE_ENABLE_OTFAD_REQ (0xC6)
+#define ELE_RESET_REQ (0xC7)
+#define ELE_UPDATE_OTP_CLKDIV_REQ (0xD0)
+#define ELE_POWER_DOWN_REQ (0xD1)
+#define ELE_ENABLE_APC_REQ (0xD2)
+#define ELE_ENABLE_RTC_REQ (0xD3)
+#define ELE_DEEP_POWER_DOWN_REQ (0xD4)
+#define ELE_STOP_RST_TIMER_REQ (0xD5)
+#define ELE_WRITE_FUSE_REQ (0xD6)
+#define ELE_RELEASE_CAAM_REQ (0xD7)
+#define ELE_RESET_A35_CTX_REQ (0xD8)
+#define ELE_MOVE_TO_UNSECURED_REQ (0xD9)
+#define ELE_GET_INFO_REQ (0xDA)
+#define ELE_ATTEST_REQ (0xDB)
+#define ELE_RELEASE_PATCH_REQ (0xDC)
+#define ELE_OTP_SEQ_SWITH_REQ (0xDD)
+
+/* ELE failure indications */
+#define ELE_ROM_PING_FAILURE_IND (0x0A)
+#define ELE_FW_PING_FAILURE_IND (0x1A)
+#define ELE_BAD_SIGNATURE_FAILURE_IND (0xF0)
+#define ELE_BAD_HASH_FAILURE_IND (0xF1)
+#define ELE_INVALID_LIFECYCLE_IND (0xF2)
+#define ELE_PERMISSION_DENIED_FAILURE_IND (0xF3)
+#define ELE_INVALID_MESSAGE_FAILURE_IND (0xF4)
+#define ELE_BAD_VALUE_FAILURE_IND (0xF5)
+#define ELE_BAD_FUSE_ID_FAILURE_IND (0xF6)
+#define ELE_BAD_CONTAINER_FAILURE_IND (0xF7)
+#define ELE_BAD_VERSION_FAILURE_IND (0xF8)
+#define ELE_INVALID_KEY_FAILURE_IND (0xF9)
+#define ELE_BAD_KEY_HASH_FAILURE_IND (0xFA)
+#define ELE_NO_VALID_CONTAINER_FAILURE_IND (0xFB)
+#define ELE_BAD_CERTIFICATE_FAILURE_IND (0xFC)
+#define ELE_BAD_UID_FAILURE_IND (0xFD)
+#define ELE_BAD_MONOTONIC_COUNTER_FAILURE_IND (0xFE)
+#define ELE_MUST_SIGNED_FAILURE_IND (0xE0)
+#define ELE_NO_AUTHENTICATION_FAILURE_IND (0xEE)
+#define ELE_BAD_SRK_SET_FAILURE_IND (0xEF)
+#define ELE_UNALIGNED_PAYLOAD_FAILURE_IND (0xA6)
+#define ELE_WRONG_SIZE_FAILURE_IND (0xA7)
+#define ELE_ENCRYPTION_FAILURE_IND (0xA8)
+#define ELE_DECRYPTION_FAILURE_IND (0xA9)
+#define ELE_OTP_PROGFAIL_FAILURE_IND (0xAA)
+#define ELE_OTP_LOCKED_FAILURE_IND (0xAB)
+#define ELE_OTP_INVALID_IDX_FAILURE_IND (0xAD)
+#define ELE_TIME_OUT_FAILURE_IND (0xB0)
+#define ELE_BAD_PAYLOAD_FAILURE_IND (0xB1)
+#define ELE_WRONG_ADDRESS_FAILURE_IND (0xB4)
+#define ELE_DMA_FAILURE_IND (0xB5)
+#define ELE_DISABLED_FEATURE_FAILURE_IND (0xB6)
+#define ELE_MUST_ATTEST_FAILURE_IND (0xB7)
+#define ELE_RNG_NOT_STARTED_FAILURE_IND (0xB8)
+#define ELE_CRC_ERROR_IND (0xB9)
+#define ELE_AUTH_SKIPPED_OR_FAILED_FAILURE_IND (0xBB)
+#define ELE_INCONSISTENT_PAR_FAILURE_IND (0xBC)
+#define ELE_RNG_INST_FAILURE_FAILURE_IND (0xBD)
+#define ELE_LOCKED_REG_FAILURE_IND (0xBE)
+#define ELE_BAD_ID_FAILURE_IND (0xBF)
+#define ELE_INVALID_OPERATION_FAILURE_IND (0xC0)
+#define ELE_NON_SECURE_STATE_FAILURE_IND (0xC1)
+#define ELE_MSG_TRUNCATED_IND (0xC2)
+#define ELE_BAD_IMAGE_NUM_FAILURE_IND (0xC3)
+#define ELE_BAD_IMAGE_ADDR_FAILURE_IND (0xC4)
+#define ELE_BAD_IMAGE_PARAM_FAILURE_IND (0xC5)
+#define ELE_BAD_IMAGE_TYPE_FAILURE_IND (0xC6)
+#define ELE_CORRUPTED_SRK_FAILURE_IND (0xD0)
+#define ELE_OUT_OF_MEMORY_IND (0xD1)
+#define ELE_CSTM_FAILURE_IND (0xCF)
+#define ELE_OLD_VERSION_FAILURE_IND (0xCE)
+#define ELE_WRONG_BOOT_MODE_FAILURE_IND (0xCD)
+#define ELE_APC_ALREADY_ENABLED_FAILURE_IND (0xCB)
+#define ELE_RTC_ALREADY_ENABLED_FAILURE_IND (0xCC)
+#define ELE_ABORT_IND (0xFF)
+
+/* ELE IPC identifier */
+#define ELE_IPC_MU_RTD (0x1)
+#define ELE_IPC_MU_APD (0x2)
+
+/* ELE Status*/
+#define ELE_SUCCESS_IND (0xD6)
+#define ELE_FAILURE_IND (0x29)
+
 #define AHAB_LOG_CID            0x21
 #define AHAB_AUTH_OEM_CTNR_CID  0x87
 #define AHAB_VERIFY_IMG_CID     0x88
arch/arm/mach-imx/imx9/ahab.c +260 -26

310 lines not on this page · raw message

Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/6 imx93: ahab: Get and decode AHAB events

Quoted 3 lines

For ahab_status command, support to get and decode AHAB events

Applied to u-boot-imx, next, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter  
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
author
#3 lore raw

PATCH 3/6 imx: ahab: Move imx9 and imx8ulp AHAB support together

In reply to Ye Li

Use common file ele_ahab.c for i.MX9 and iMX8ULP AHAB support, since both of them use same sentinel ELE APIs

---
 arch/arm/include/asm/arch-imx8ulp/imx-regs.h |   2 +
 arch/arm/include/asm/arch-imx9/imx-regs.h    |   2 +
 arch/arm/mach-imx/Makefile                   |   4 +
 arch/arm/mach-imx/ele_ahab.c                 | 579 ++++++++++++++++++++++++++
 arch/arm/mach-imx/imx8ulp/ahab.c             | 345 ----------------
 arch/arm/mach-imx/imx9/Makefile              |   1 -
 arch/arm/mach-imx/imx9/ahab.c                | 580 ---------------------------
 7 files changed, 587 insertions(+), 926 deletions(-)
 create mode 100644 arch/arm/mach-imx/ele_ahab.c
 delete mode 100644 arch/arm/mach-imx/imx8ulp/ahab.c
 delete mode 100644 arch/arm/mach-imx/imx9/ahab.c
arch/arm/include/asm/arch-imx8ulp/imx-regs.h +2 -0
index 723bab5..f5a2968 100644
@@ -62,6 +62,8 @@
 
 #define FEC_QUIRK_ENET_MAC
 
+#define IMG_CONTAINER_BASE             (0x22010000UL)
+
 #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
 #include <asm/types.h>
 
arch/arm/include/asm/arch-imx9/imx-regs.h +2 -0
index f575805..065fd1f 100644
@@ -40,6 +40,8 @@
 #define SRC_MIX_SLICE_FUNC_STAT_ISO_STAT BIT(4)
 #define SRC_MIX_SLICE_FUNC_STAT_MEM_STAT BIT(12)
 
+#define IMG_CONTAINER_BASE             (0x80000000UL)
+
 #define BCTRL_GPR_ENET_QOS_INTF_MODE_MASK        GENMASK(3, 1)
 #define BCTRL_GPR_ENET_QOS_INTF_SEL_MII          (0x0 << 1)
 #define BCTRL_GPR_ENET_QOS_INTF_SEL_RMII         (0x4 << 1)
arch/arm/mach-imx/Makefile +4 -0
index 61b4f4f..4469826 100644
@@ -77,6 +77,10 @@ ifeq ($(CONFIG_SPL_BUILD),y)
 obj-$(CONFIG_SPL_LOAD_IMX_CONTAINER) += image-container.o parse-container.o
 endif
 
+ifeq ($(SOC),$(filter $(SOC),imx8ulp imx9))
+obj-$(CONFIG_AHAB_BOOT) += ele_ahab.o
+endif
+
 PLUGIN = board/$(BOARDDIR)/plugin
 
 ifeq ($(CONFIG_USE_IMXIMG_PLUGIN),y)
arch/arm/mach-imx/ele_ahab.c new file +579 -0

579 lines not on this page · raw message

arch/arm/mach-imx/imx8ulp/ahab.c deleted +0 -345

345 lines not on this page · raw message

arch/arm/mach-imx/imx9/Makefile +0 -1
index 6d038a6..e1b09ab 100644
@@ -4,7 +4,6 @@
 
 obj-y += lowlevel_init.o
 obj-y += soc.o clock.o clock_root.o trdc.o
-obj-$(CONFIG_AHAB_BOOT) += ahab.o
 
 #ifndef CONFIG_SPL_BUILD
 obj-y += imx_bootaux.o
arch/arm/mach-imx/imx9/ahab.c deleted +0 -580

580 lines not on this page · raw message

Signature · 1 line
2.7.4
#4 lore raw

PATCH 3/6 imx: ahab: Move imx9 and imx8ulp AHAB support together

Quoted 4 lines

Use common file ele_ahab.c for i.MX9 and iMX8ULP AHAB support, since both of them use same sentinel ELE APIs

Applied to u-boot-imx, next, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter  
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
author
#5 lore raw

PATCH 4/6 misc: sentinel: s400_api: Use new command request definitions

In reply to Ye Li

Remove legacy command definitions, change to use new ELE_xxx command request.

---
 arch/arm/include/asm/mach-imx/s400_api.h | 15 ---------------
 arch/arm/mach-imx/imx8ulp/rdc.c          |  2 +-
 arch/arm/mach-imx/imx9/trdc.c            |  2 +-
 drivers/misc/sentinel/s400_api.c         | 28 ++++++++++++++--------------
 4 files changed, 16 insertions(+), 31 deletions(-)
arch/arm/include/asm/mach-imx/s400_api.h +0 -15
index c87a7c1..5582ff1 100644
@@ -109,21 +109,6 @@
 #define ELE_SUCCESS_IND (0xD6)
 #define ELE_FAILURE_IND (0x29)
 
-#define AHAB_LOG_CID            0x21
-#define AHAB_AUTH_OEM_CTNR_CID  0x87
-#define AHAB_VERIFY_IMG_CID     0x88
-#define AHAB_RELEASE_CTNR_CID   0x89
-#define AHAB_WRITE_SECURE_FUSE_REQ_CID	0x91
-#define AHAB_FWD_LIFECYCLE_UP_REQ_CID   0x95
-#define AHAB_READ_FUSE_REQ_CID	0x97
-#define AHAB_GET_FW_VERSION_CID	0x9D
-#define AHAB_GET_EVENTS_REQ_CID 0xA2
-#define AHAB_RELEASE_RDC_REQ_CID   0xC4
-#define AHAB_GET_FW_STATUS_CID   0xC5
-#define AHAB_WRITE_FUSE_REQ_CID	0xD6
-#define AHAB_CAAM_RELEASE_CID 0xD7
-#define AHAB_GET_INFO_CID 0xDA
-
 #define S400_MAX_MSG          255U
 
 struct sentinel_msg {
arch/arm/mach-imx/imx8ulp/rdc.c +1 -1
index 56df111..50b097b 100644
@@ -210,7 +210,7 @@ int release_rdc(enum rdc_type type)
 	msg.version = AHAB_VERSION;
 	msg.tag = AHAB_CMD_TAG;
 	msg.size = 2;
-	msg.command = AHAB_RELEASE_RDC_REQ_CID;
+	msg.command = ELE_RELEASE_RDC_REQ;
 	msg.data[0] = (rdc_id << 8) | 0x2; /* A35 XRDC */
 
 	mu_hal_init(s_mu_base);
arch/arm/mach-imx/imx9/trdc.c +1 -1
index 3f37ce7..e05c704 100644
@@ -339,7 +339,7 @@ int release_rdc(u8 xrdc)
 	msg.version = AHAB_VERSION;
 	msg.tag = AHAB_CMD_TAG;
 	msg.size = 2;
-	msg.command = AHAB_RELEASE_RDC_REQ_CID;
+	msg.command = ELE_RELEASE_RDC_REQ;
 	msg.data[0] = (rdc_id << 8) | 0x2; /* A55 */
 
 	mu_hal_init(s_mu_base);
drivers/misc/sentinel/s400_api.c +14 -14
index c6b4ef5..6c0d0b3 100644
@@ -29,7 +29,7 @@ int ahab_release_rdc(u8 core_id, u8 xrdc, u32 *response)
 	msg.version = AHAB_VERSION;
 	msg.tag = AHAB_CMD_TAG;
 	msg.size = 2;
-	msg.command = AHAB_RELEASE_RDC_REQ_CID;
+	msg.command = ELE_RELEASE_RDC_REQ;
 	switch (xrdc) {
 	case 0:
 		msg.data[0] = (0x74 << 8) | core_id;
@@ -74,7 +74,7 @@ int ahab_auth_oem_ctnr(ulong ctnr_addr, u32 *response)
 	msg.version = AHAB_VERSION;
 	msg.tag = AHAB_CMD_TAG;
 	msg.size = 3;
-	msg.command = AHAB_AUTH_OEM_CTNR_CID;
+	msg.command = ELE_OEM_CNTN_AUTH_REQ;
 	msg.data[0] = upper_32_bits(ctnr_addr);
 	msg.data[1] = lower_32_bits(ctnr_addr);
 
@@ -104,7 +104,7 @@ int ahab_release_container(u32 *response)
 	msg.version = AHAB_VERSION;
 	msg.tag = AHAB_CMD_TAG;
 	msg.size = 1;
-	msg.command = AHAB_RELEASE_CTNR_CID;
+	msg.command = ELE_RELEASE_CONTAINER_REQ;
 
 	ret = misc_call(dev, false, &msg, size, &msg, size);
 	if (ret)
@@ -132,7 +132,7 @@ int ahab_verify_image(u32 img_id, u32 *response)
 	msg.version = AHAB_VERSION;
 	msg.tag = AHAB_CMD_TAG;
 	msg.size = 2;
-	msg.command = AHAB_VERIFY_IMG_CID;
+	msg.command = ELE_VERIFY_IMAGE_REQ;
 	msg.data[0] = 1 << img_id;
 
 	ret = misc_call(dev, false, &msg, size, &msg, size);
@@ -161,7 +161,7 @@ int ahab_forward_lifecycle(u16 life_cycle, u32 *response)
 	msg.version = AHAB_VERSION;
 	msg.tag = AHAB_CMD_TAG;
 	msg.size = 2;
-	msg.command = AHAB_FWD_LIFECYCLE_UP_REQ_CID;
+	msg.command = ELE_FWD_LIFECYCLE_UP_REQ;
 	msg.data[0] = life_cycle;
 
 	ret = misc_call(dev, false, &msg, size, &msg, size);
@@ -201,7 +201,7 @@ int ahab_read_common_fuse(u16 fuse_id, u32 *fuse_words, u32 fuse_num, u32 *respo
 	msg.version = AHAB_VERSION;
 	msg.tag = AHAB_CMD_TAG;
 	msg.size = 2;
-	msg.command = AHAB_READ_FUSE_REQ_CID;
+	msg.command = ELE_READ_FUSE_REQ;
 	msg.data[0] = fuse_id;
 
 	ret = misc_call(dev, false, &msg, size, &msg, size);
@@ -238,7 +238,7 @@ int ahab_write_fuse(u16 fuse_id, u32 fuse_val, bool lock, u32 *response)
 	msg.version = AHAB_VERSION;
 	msg.tag = AHAB_CMD_TAG;
 	msg.size = 3;
-	msg.command = AHAB_WRITE_FUSE_REQ_CID;
+	msg.command = ELE_WRITE_FUSE_REQ;
 	msg.data[0] = (32 << 16) | (fuse_id << 5);
 	if (lock)
 		msg.data[0] |= (1 << 31);
@@ -271,7 +271,7 @@ int ahab_release_caam(u32 core_did, u32 *response)
 	msg.version = AHAB_VERSION;
 	msg.tag = AHAB_CMD_TAG;
 	msg.size = 2;
-	msg.command = AHAB_CAAM_RELEASE_CID;
+	msg.command = ELE_RELEASE_CAAM_REQ;
 	msg.data[0] = core_did;
 
 	ret = misc_call(dev, false, &msg, size, &msg, size);
@@ -310,7 +310,7 @@ int ahab_get_fw_version(u32 *fw_version, u32 *sha1, u32 *response)
 	msg.version = AHAB_VERSION;
 	msg.tag = AHAB_CMD_TAG;
 	msg.size = 1;
-	msg.command = AHAB_GET_FW_VERSION_CID;
+	msg.command = ELE_GET_FW_VERSION_REQ;
 
 	ret = misc_call(dev, false, &msg, size, &msg, size);
 	if (ret)
@@ -341,7 +341,7 @@ int ahab_dump_buffer(u32 *buffer, u32 buffer_length)
 	msg.version = AHAB_VERSION;
 	msg.tag = AHAB_CMD_TAG;
 	msg.size = 1;
-	msg.command = AHAB_LOG_CID;
+	msg.command = ELE_DUMP_DEBUG_BUFFER_REQ;
 
 	ret = misc_call(dev, false, &msg, size, &msg, size);
 	if (ret) {
@@ -375,7 +375,7 @@ int ahab_get_info(struct sentinel_get_info_data *info, u32 *response)
 	msg.version = AHAB_VERSION;
 	msg.tag = AHAB_CMD_TAG;
 	msg.size = 4;
-	msg.command = AHAB_GET_INFO_CID;
+	msg.command = ELE_GET_INFO_REQ;
 	msg.data[0] = upper_32_bits((ulong)info);
 	msg.data[1] = lower_32_bits((ulong)info);
 	msg.data[2] = sizeof(struct sentinel_get_info_data);
@@ -406,7 +406,7 @@ int ahab_get_fw_status(u32 *status, u32 *response)
 	msg.version = AHAB_VERSION;
 	msg.tag = AHAB_CMD_TAG;
 	msg.size = 1;
-	msg.command = AHAB_GET_FW_STATUS_CID;
+	msg.command = ELE_GET_FW_STATUS_REQ;
 
 	ret = misc_call(dev, false, &msg, size, &msg, size);
 	if (ret)
@@ -436,7 +436,7 @@ int ahab_release_m33_trout(void)
 	msg.version = AHAB_VERSION;
 	msg.tag = AHAB_CMD_TAG;
 	msg.size = 1;
-	msg.command = 0xd3;
+	msg.command = ELE_ENABLE_RTC_REQ;
 
 	ret = misc_call(dev, false, &msg, size, &msg, size);
 	if (ret)
@@ -467,7 +467,7 @@ int ahab_get_events(u32 *events, u32 *events_cnt, u32 *response)
 	msg.version = AHAB_VERSION;
 	msg.tag = AHAB_CMD_TAG;
 	msg.size = 1;
-	msg.command = AHAB_GET_EVENTS_REQ_CID;
+	msg.command = ELE_GET_EVENTS_REQ;
 
 	ret = misc_call(dev, false, &msg, size, &msg, size);
 	if (ret)
Signature · 1 line
2.7.4
#6 lore raw

PATCH 4/6 misc: sentinel: s400_api: Use new command request definitions

Quoted 4 lines

Remove legacy command definitions, change to use new ELE_xxx command request.

Applied to u-boot-imx, next, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter  
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
author
#7 lore raw

PATCH 5/6 imx: ele_ahab: confirm lifecycle before closing the part

In reply to Ye Li

Before moving the lifecycle to OEM closed, confirm the lifecycle is OEM open, otherwise cancel to move forward the lifecycle.

---
 arch/arm/mach-imx/ele_ahab.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/mach-imx/ele_ahab.c +10 -0
index da8c99b..58b6542 100644
@@ -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");
Signature · 1 line
2.7.4
#8 lore raw

PATCH 5/6 imx: ele_ahab: confirm lifecycle before closing the part

Quoted 4 lines

Before moving the lifecycle to OEM closed, confirm the lifecycle is OEM open, otherwise cancel to move forward the lifecycle.

Applied to u-boot-imx, next, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter  
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
author
#9 lore raw

PATCH 6/6 imx: ele_ahab: Remove OEM Secure World Closed print

In reply to Ye Li

The OEM Secure World Closed is not a valid lifecycle on iMX8ULP/iMX9. So remove it from lifecycle print.

---
 arch/arm/mach-imx/ele_ahab.c | 3 ---
 1 file changed, 3 deletions(-)
arch/arm/mach-imx/ele_ahab.c +0 -3
index 58b6542..99fc540 100644
@@ -429,9 +429,6 @@ static void display_life_cycle(u32 lc)
 	case 0x8:
 		printf("OEM Open\n\n");
 		break;
-	case 0x10:
-		printf("OEM Secure World Closed\n\n");
-		break;
 	case 0x20:
 		printf("OEM closed\n\n");
 		break;
Signature · 1 line
2.7.4
#10 lore raw

PATCH 6/6 imx: ele_ahab: Remove OEM Secure World Closed print

Quoted 4 lines

The OEM Secure World Closed is not a valid lifecycle on iMX8ULP/iMX9. So remove it from lifecycle print.

Applied to u-boot-imx, next, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter  
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#11 lore raw

PATCH 1/6 misc: sentinel: s400_api: Add get_events API

In reply to Ye Li
Quoted 4 lines

Add get_events API to retrieve any singular events that has occurred since the FW has started from sentinel

Applied to u-boot-imx, next, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter  
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================