Merge "NXP SecureElement HAL update for SNxxx" into main am: 12517449e9

Original change: https://android-review.googlesource.com/c/platform/hardware/nxp/secure_element/+/2845640

Change-Id: I189e5887c2941d474f6443f5c0bf5d54219df95c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/snxxx/1.0/SecureElement.cpp b/snxxx/1.0/SecureElement.cpp
old mode 100755
new mode 100644
index 021f783..f605957
--- a/snxxx/1.0/SecureElement.cpp
+++ b/snxxx/1.0/SecureElement.cpp
@@ -128,7 +128,7 @@
   }
   status = phNxpEse_SetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "Endpoint set failed";
+    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed";
   }
   status = phNxpEse_getAtr(&atrData);
   if (status != ESESTATUS_SUCCESS) {
@@ -142,7 +142,7 @@
 
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "Endpoint set failed";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed";
   }
 
   if (status != ESESTATUS_SUCCESS) {
@@ -202,7 +202,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
 
   _hidl_cb(result);
@@ -302,7 +302,7 @@
     send the callback and return*/
     status = phNxpEse_ResetEndPoint_Cntxt(0);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
     _hidl_cb(resApduBuff, sestatus);
     return Void();
@@ -390,7 +390,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
   _hidl_cb(resApduBuff, sestatus);
   phNxpEse_free(cpdu.pdata);
@@ -490,7 +490,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
   if (sestatus != SecureElementStatus::SUCCESS) {
     SecureElementStatus closeChannelStatus =
@@ -553,7 +553,7 @@
     }
     status = phNxpEse_ResetEndPoint_Cntxt(0);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
   }
   if (mOpenedChannels[channelNumber]) {
@@ -611,7 +611,7 @@
     }
     status = phNxpEse_ResetEndPoint_Cntxt(0);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
   }
   if (mOpenedChannels[channelNumber]) {
@@ -679,7 +679,7 @@
   if (ESESTATUS_SUCCESS != deInitStatus) mIsDeInitDone = false;
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     mIsDeInitDone = false;
   }
   status = phNxpEse_close(deInitStatus);
diff --git a/snxxx/1.0/VirtualISO.cpp b/snxxx/1.0/VirtualISO.cpp
index 3683208..12c2197 100644
--- a/snxxx/1.0/VirtualISO.cpp
+++ b/snxxx/1.0/VirtualISO.cpp
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2018-2021 NXP
+ *  Copyright 2018-2021, 2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -144,7 +144,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(1);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
 
   _hidl_cb(result);
@@ -241,7 +241,7 @@
     send the callback and return*/
     status = phNxpEse_ResetEndPoint_Cntxt(1);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
     _hidl_cb(resApduBuff, sestatus);
     return Void();
@@ -326,7 +326,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(1);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
   _hidl_cb(resApduBuff, sestatus);
   phNxpEse_free(cpdu.pdata);
@@ -415,7 +415,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(1);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
   if (sestatus != SecureElementStatus::SUCCESS) {
     SecureElementStatus closeChannelStatus =
@@ -479,7 +479,7 @@
     }
     status = phNxpEse_ResetEndPoint_Cntxt(1);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
   }
   if (mOpenedChannels[channelNumber]) {
@@ -538,7 +538,7 @@
     }
     status = phNxpEse_ResetEndPoint_Cntxt(1);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
   }
   if (mOpenedChannels[channelNumber]) {
@@ -593,7 +593,7 @@
   if (ESESTATUS_SUCCESS != deInitStatus) mIsDeInitDone = false;
   status = phNxpEse_ResetEndPoint_Cntxt(1);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt  failed!!!";
     mIsDeInitDone = false;
   }
   status = phNxpEse_close(deInitStatus);
diff --git a/snxxx/1.1/SecureElement.cpp b/snxxx/1.1/SecureElement.cpp
old mode 100755
new mode 100644
index e261910..8b27e77
--- a/snxxx/1.1/SecureElement.cpp
+++ b/snxxx/1.1/SecureElement.cpp
@@ -220,7 +220,7 @@
   }
   status = phNxpEse_SetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "Endpoint set failed";
+    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed";
   }
   status = phNxpEse_getAtr(&atrData);
   if (status != ESESTATUS_SUCCESS) {
@@ -234,7 +234,7 @@
 
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "Endpoint set failed";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed";
   }
 
   if (status != ESESTATUS_SUCCESS) {
@@ -295,7 +295,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt  failed!!!";
   }
 
   _hidl_cb(result);
@@ -388,7 +388,7 @@
     send the callback and return*/
     status = phNxpEse_ResetEndPoint_Cntxt(0);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
     _hidl_cb(resApduBuff, sestatus);
     return Void();
@@ -476,7 +476,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
   _hidl_cb(resApduBuff, sestatus);
   phNxpEse_free(cpdu.pdata);
@@ -576,7 +576,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
   if (sestatus != SecureElementStatus::SUCCESS) {
     SecureElementStatus closeChannelStatus =
@@ -629,7 +629,7 @@
     }
     status = phNxpEse_ResetEndPoint_Cntxt(0);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
   }
   if (channelNumber < mMaxChannelCount) {
@@ -705,7 +705,7 @@
   if (ESESTATUS_SUCCESS != deInitStatus) mIsDeInitDone = false;
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     mIsDeInitDone = false;
   }
   status = phNxpEse_close(deInitStatus);
diff --git a/snxxx/1.1/VirtualISO.cpp b/snxxx/1.1/VirtualISO.cpp
old mode 100755
new mode 100644
index 6b0748a..ae90211
--- a/snxxx/1.1/VirtualISO.cpp
+++ b/snxxx/1.1/VirtualISO.cpp
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2018-2021 NXP
+ *  Copyright 2018-2021, 2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -211,7 +211,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(1);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
 
   _hidl_cb(result);
@@ -308,7 +308,7 @@
     send the callback and return*/
     status = phNxpEse_ResetEndPoint_Cntxt(1);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
     _hidl_cb(resApduBuff, sestatus);
     return Void();
@@ -393,7 +393,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(1);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
   _hidl_cb(resApduBuff, sestatus);
   phNxpEse_free(cpdu.pdata);
@@ -482,7 +482,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(1);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
   if (sestatus != SecureElementStatus::SUCCESS) {
     SecureElementStatus closeChannelStatus =
@@ -537,7 +537,7 @@
     }
     status = phNxpEse_ResetEndPoint_Cntxt(1);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
     if (mOpenedChannels[channelNumber]) {
       mOpenedChannels[channelNumber] = false;
@@ -586,7 +586,7 @@
     }
     status = phNxpEse_ResetEndPoint_Cntxt(1);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
     if (mOpenedChannels[channelNumber]) {
       mOpenedChannels[channelNumber] = false;
@@ -642,7 +642,7 @@
   if (ESESTATUS_SUCCESS != deInitStatus) mIsDeInitDone = false;
   status = phNxpEse_ResetEndPoint_Cntxt(1);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     mIsDeInitDone = false;
   }
   status = phNxpEse_close(deInitStatus);
diff --git a/snxxx/1.2/Android.bp b/snxxx/1.2/Android.bp
index 5ca335d..aedd554 100644
--- a/snxxx/1.2/Android.bp
+++ b/snxxx/1.2/Android.bp
@@ -28,7 +28,7 @@
     init_rc: ["android.hardware.secure_element_snxxx@1.2-service.rc"],
     proprietary: true,
     defaults: ["hidl_defaults"],
-    enabled: true,
+    enabled: false,
     srcs: [
         "NxpEseService.cpp",
         "SecureElement.cpp",
diff --git a/snxxx/1.2/NxpEseService.cpp b/snxxx/1.2/NxpEseService.cpp
index b3ff2b9..0da44e7 100755
--- a/snxxx/1.2/NxpEseService.cpp
+++ b/snxxx/1.2/NxpEseService.cpp
@@ -22,14 +22,14 @@
 #include <hidl/LegacySupport.h>
 #include <log/log.h>
 #include <string.h>
-#include <vendor/nxp/nxpese/1.0/INxpEse.h>
 
 #include <regex>
 
-#include "NxpEse.h"
 #include "SecureElement.h"
 #include "VirtualISO.h"
 #ifdef NXP_BOOTTIME_UPDATE
+#include <vendor/nxp/nxpese/1.0/INxpEse.h>
+#include "NxpEse.h"
 #include "eSEClient.h"
 #endif
 
@@ -46,8 +46,10 @@
 using INfc = android::hardware::nfc::V1_2::INfc;
 using android::hardware::secure_element::V1_2::ISecureElement;
 using android::hardware::secure_element::V1_2::implementation::SecureElement;
+#ifdef NXP_BOOTTIME_UPDATE
 using vendor::nxp::nxpese::V1_0::INxpEse;
 using vendor::nxp::nxpese::V1_0::implementation::NxpEse;
+#endif
 using vendor::nxp::virtual_iso::V1_0::implementation::VirtualISO;
 using INfcAidl = ::aidl::android::hardware::nfc::INfc;
 
@@ -94,7 +96,9 @@
   bool ret = false;
 
   android::sp<ISecureElement> se_service = nullptr;
+#ifdef NXP_BOOTTIME_UPDATE
   android::sp<INxpEse> nxp_se_service = nullptr;
+#endif
   android::sp<ISecureElement> virtual_iso_service = nullptr;
 
   try {
@@ -124,7 +128,7 @@
         goto shutdown;
       }
       ALOGI("Secure Element Service is ready");
-
+#ifdef NXP_BOOTTIME_UPDATE
       ALOGI("NXP Secure Element Extn Service 1.0 is starting.");
       nxp_se_service = new NxpEse();
       if (nxp_se_service == nullptr) {
@@ -142,6 +146,7 @@
         goto shutdown;
       }
       ALOGI("Secure Element Service is ready");
+#endif
     }
 
 #ifdef NXP_VISO_ENABLE
diff --git a/snxxx/1.2/SecureElement.cpp b/snxxx/1.2/SecureElement.cpp
old mode 100755
new mode 100644
index 35b84eb..8cdb5c4
--- a/snxxx/1.2/SecureElement.cpp
+++ b/snxxx/1.2/SecureElement.cpp
@@ -17,8 +17,8 @@
  ******************************************************************************/
 #include "SecureElement.h"
 
-#include "NxpEse.h"
 #ifdef NXP_BOOTTIME_UPDATE
+#include "NxpEse.h"
 #include "eSEClient.h"
 #endif
 #include <android-base/logging.h>
@@ -55,7 +55,9 @@
 static hidl_vec<uint8_t> gsRspDataBuff(256);
 sp<V1_0::ISecureElementHalCallback> SecureElement::mCallbackV1_0 = nullptr;
 std::vector<bool> SecureElement::mOpenedChannels;
+#ifdef NXP_BOOTTIME_UPDATE
 using vendor::nxp::nxpese::V1_0::implementation::NxpEse;
+#endif
 SecureElement::SecureElement()
     : mMaxChannelCount(0), mOpenedchannelCount(0), mIsEseInitialized(false) {}
 
@@ -109,8 +111,10 @@
     if (ESESTATUS_SUCCESS == phNxpEse_SetEndPoint_Cntxt(0)) {
       initStatus = phNxpEse_init(initParams);
       if (ESESTATUS_SUCCESS == initStatus) {
-        /*update OS mode during first init*/
-        IS_OSU_MODE(OsuHalExtn::getInstance().INIT, 0);
+        if (GET_CHIP_OS_VERSION() < OS_VERSION_8_9) {
+          /*update OS mode during first init*/
+          IS_OSU_MODE(OsuHalExtn::getInstance().INIT, 0);
+        }
 
         if (ESESTATUS_SUCCESS == phNxpEse_ResetEndPoint_Cntxt(0)) {
           LOG(INFO) << "ESE SPI init complete!!!";
@@ -125,7 +129,8 @@
     if (status == ESESTATUS_SUCCESS &&
         (initStatus == ESESTATUS_TRANSCEIVE_FAILED ||
          initStatus == ESESTATUS_FAILED)) {
-      IS_OSU_MODE(OsuHalExtn::getInstance().INIT, 0);
+      if (GET_CHIP_OS_VERSION() < OS_VERSION_8_9)
+        IS_OSU_MODE(OsuHalExtn::getInstance().INIT, 0);
       mIsInitDone = true;
     }
   }
@@ -220,7 +225,8 @@
       initStatus = phNxpEse_init(initParams);
       if (initStatus == ESESTATUS_SUCCESS) {
         /*update OS mode during first init*/
-        IS_OSU_MODE(OsuHalExtn::getInstance().INIT, 0);
+        if (GET_CHIP_OS_VERSION() < OS_VERSION_8_9)
+          IS_OSU_MODE(OsuHalExtn::getInstance().INIT, 0);
 
         if (ESESTATUS_SUCCESS == phNxpEse_ResetEndPoint_Cntxt(0)) {
           LOG(INFO) << "ESE SPI init complete!!!";
@@ -235,7 +241,8 @@
     if (status == ESESTATUS_SUCCESS &&
         (initStatus == ESESTATUS_TRANSCEIVE_FAILED ||
          initStatus == ESESTATUS_FAILED)) {
-      IS_OSU_MODE(OsuHalExtn::getInstance().INIT, 0);
+      if (GET_CHIP_OS_VERSION() < OS_VERSION_8_9)
+        IS_OSU_MODE(OsuHalExtn::getInstance().INIT, 0);
       mIsInitDone = true;
     }
   }
@@ -264,7 +271,8 @@
   bool mIsSeHalInitDone = false;
 
   // In dedicated mode getATR not allowed
-  if (IS_OSU_MODE(OsuHalExtn::getInstance().GETATR)) {
+  if ((GET_CHIP_OS_VERSION() < OS_VERSION_8_9) &&
+      (IS_OSU_MODE(OsuHalExtn::getInstance().GETATR))) {
     LOG(ERROR) << "%s: Not allowed in dedicated mode!!!" << __func__;
     _hidl_cb(response);
     return Void();
@@ -282,7 +290,7 @@
   }
   status = phNxpEse_SetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "Endpoint set failed";
+    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed";
   }
   status = phNxpEse_getAtr(&atrData);
   if (status != ESESTATUS_SUCCESS) {
@@ -296,7 +304,7 @@
 
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "Endpoint set failed";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed";
   }
 
   if (status != ESESTATUS_SUCCESS) {
@@ -337,23 +345,24 @@
     _hidl_cb(result);
     return Void();
   }
-  OsuHalExtn::OsuApduMode mode = IS_OSU_MODE(
-      data, OsuHalExtn::getInstance().TRANSMIT, &gsTxRxBuffer.cmdData);
-  if (mode == OsuHalExtn::getInstance().OSU_BLOCKED_MODE) {
-    LOG(ERROR) << "Not allowed in dedicated mode!!!";
-    /*Return empty hidl_vec*/
-    _hidl_cb(result);
-    return Void();
-  } else if (mode == OsuHalExtn::getInstance().OSU_RST_MODE) {
-    uint8_t sw[2] = {0x90, 0x00};
-    result.resize(sizeof(sw));
-    memcpy(&result[0], sw, sizeof(sw));
-    _hidl_cb(result);
-    return Void();
+  if (GET_CHIP_OS_VERSION() < OS_VERSION_8_9) {
+    OsuHalExtn::OsuApduMode mode = IS_OSU_MODE(
+        data, OsuHalExtn::getInstance().TRANSMIT, &gsTxRxBuffer.cmdData);
+    if (mode == OsuHalExtn::getInstance().OSU_BLOCKED_MODE) {
+      LOG(ERROR) << "Not allowed in dedicated mode!!!";
+      /*Return empty hidl_vec*/
+      _hidl_cb(result);
+      return Void();
+    } else if (mode == OsuHalExtn::getInstance().OSU_RST_MODE) {
+      uint8_t sw[2] = {0x90, 0x00};
+      result.resize(sizeof(sw));
+      memcpy(&result[0], sw, sizeof(sw));
+      _hidl_cb(result);
+      return Void();
+    }
   } else {
-    // continue with normal processing
+    memcpy(gsTxRxBuffer.cmdData.p_data, data.data(), gsTxRxBuffer.cmdData.len);
   }
-  // memcpy(gsTxRxBuffer.cmdData.p_data, data.data(), gsTxRxBuffer.cmdData.len);
   LOG(INFO) << "Acquired lock for SPI";
   status = phNxpEse_SetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
@@ -373,7 +382,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
 
   _hidl_cb(result);
@@ -424,7 +433,8 @@
   LOG(INFO) << "Acquired the lock from SPI openLogicalChannel";
 
   // In dedicated mode openLogical not allowed
-  if (IS_OSU_MODE(OsuHalExtn::getInstance().OPENLOGICAL)) {
+  if ((GET_CHIP_OS_VERSION() < OS_VERSION_6_2) &&
+      (IS_OSU_MODE(OsuHalExtn::getInstance().OPENLOGICAL))) {
     LOG(ERROR) << "%s: Not allowed in dedicated mode!!!" << __func__;
     _hidl_cb(resApduBuff, SecureElementStatus::IOERROR);
     return Void();
@@ -494,7 +504,7 @@
     send the callback and return*/
     status = phNxpEse_ResetEndPoint_Cntxt(0);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
     _hidl_cb(resApduBuff, sestatus);
     return Void();
@@ -590,7 +600,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
   _hidl_cb(resApduBuff, sestatus);
   phNxpEse_free(cpdu.pdata);
@@ -616,9 +626,9 @@
                               0x41, 0x01, 0x43, 0x4F, 0x52, 0x01};
 
   LOG(ERROR) << "Acquired the lock in SPI openBasicChannel";
-  OsuHalExtn::OsuApduMode mode =
-      IS_OSU_MODE(aid, OsuHalExtn::getInstance().OPENBASIC);
-  if (mode == OsuHalExtn::OSU_PROP_MODE) {
+  if ((GET_CHIP_OS_VERSION() < OS_VERSION_8_9) &&
+      IS_OSU_MODE(aid, OsuHalExtn::getInstance().OPENBASIC) ==
+          OsuHalExtn::OSU_PROP_MODE) {
     uint8_t sw[2] = {0x90, 0x00};
     result.resize(sizeof(sw));
     memcpy(&result[0], sw, 2);
@@ -662,22 +672,24 @@
     }
   }
 
-  phNxpEse_data atrData;
-  if (phNxpEse_getAtr(&atrData) != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_getAtr failed";
-  }
-  if (atrData.p_data != NULL) {
-    phNxpEse_free(atrData.p_data);
-  }
-
-  if (phNxpEse_GetOsMode() == OSU_MODE) {
-    if (mOpenedchannelCount == 0) {
-      if (seHalDeInit() != SecureElementStatus::SUCCESS) {
-        LOG(INFO) << "seDeInit Failed";
-      }
+  if (GET_CHIP_OS_VERSION() < OS_VERSION_8_9) {
+    phNxpEse_data atrData;
+    if (phNxpEse_getAtr(&atrData) != ESESTATUS_SUCCESS) {
+      LOG(ERROR) << "phNxpEse_getAtr failed";
     }
-    _hidl_cb(result, SecureElementStatus::IOERROR);
-    return Void();
+    if (atrData.p_data != NULL) {
+      phNxpEse_free(atrData.p_data);
+    }
+
+    if (phNxpEse_GetOsMode() == OSU_MODE) {
+      if (mOpenedchannelCount == 0) {
+        if (seHalDeInit() != SecureElementStatus::SUCCESS) {
+          LOG(INFO) << "seDeInit Failed";
+        }
+      }
+      _hidl_cb(result, SecureElementStatus::IOERROR);
+      return Void();
+    }
   }
 
   if (mOpenedChannels.size() == 0x00) {
@@ -755,7 +767,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
   if (sestatus != SecureElementStatus::SUCCESS) {
     SecureElementStatus closeChannelStatus =
@@ -808,7 +820,7 @@
     }
     status = phNxpEse_ResetEndPoint_Cntxt(0);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
   }
   if (channelNumber < mMaxChannelCount) {
@@ -829,7 +841,8 @@
 Return<SecureElementStatus> SecureElement::closeChannel(uint8_t channelNumber) {
   AutoMutex guard(seHalLock);
   // Close internal allowed when not in dedicated Mode
-  if (!IS_OSU_MODE(OsuHalExtn::getInstance().CLOSE, channelNumber)) {
+  if ((GET_CHIP_OS_VERSION() >= OS_VERSION_8_9) ||
+      (!IS_OSU_MODE(OsuHalExtn::getInstance().CLOSE, channelNumber))) {
     return internalCloseChannel(channelNumber);
   } else {
     /*Decrement channel count opened to
@@ -904,7 +917,7 @@
   if (ESESTATUS_SUCCESS != deInitStatus) mIsDeInitDone = false;
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     mIsDeInitDone = false;
   }
   status = phNxpEse_close(deInitStatus);
diff --git a/snxxx/1.2/SecureElement.h b/snxxx/1.2/SecureElement.h
old mode 100755
new mode 100644
index 198a039..28e95ff
--- a/snxxx/1.2/SecureElement.h
+++ b/snxxx/1.2/SecureElement.h
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2020,2022-2023  NXP
+ *  Copyright 2020,2022-2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
diff --git a/snxxx/1.2/VirtualISO.cpp b/snxxx/1.2/VirtualISO.cpp
old mode 100755
new mode 100644
index 857a254..445d97d
--- a/snxxx/1.2/VirtualISO.cpp
+++ b/snxxx/1.2/VirtualISO.cpp
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2018-2022 NXP
+ *  Copyright 2018-2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -17,9 +17,9 @@
  ******************************************************************************/
 #include "VirtualISO.h"
 
-#include "NxpEse.h"
 #include "SecureElement.h"
 #ifdef NXP_BOOTTIME_UPDATE
+#include "NxpEse.h"
 #include "eSEClient.h"
 #endif
 #include <android-base/logging.h>
@@ -42,7 +42,9 @@
 #define DEFAULT_BASIC_CHANNEL 0x00
 
 using ::android::hardware::secure_element::V1_2::ISecureElement;
+#ifdef NXP_BOOTTIME_UPDATE
 using vendor::nxp::nxpese::V1_0::implementation::NxpEse;
+#endif
 
 typedef struct gsTransceiveBuffer {
   phNxpEse_data cmdData;
@@ -214,7 +216,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(1);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
 
   _hidl_cb(result);
@@ -328,7 +330,7 @@
     send the callback and return*/
     status = phNxpEse_ResetEndPoint_Cntxt(1);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
     _hidl_cb(resApduBuff, sestatus);
     return Void();
@@ -413,7 +415,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(1);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
   _hidl_cb(resApduBuff, sestatus);
   phNxpEse_free(cpdu.pdata);
@@ -507,7 +509,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(1);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
   if (sestatus != SecureElementStatus::SUCCESS) {
     SecureElementStatus closeChannelStatus =
@@ -562,7 +564,7 @@
     }
     status = phNxpEse_ResetEndPoint_Cntxt(1);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
     if (mOpenedChannels[channelNumber]) {
       mOpenedChannels[channelNumber] = false;
@@ -611,7 +613,7 @@
     }
     status = phNxpEse_ResetEndPoint_Cntxt(1);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
     if (mOpenedChannels[channelNumber]) {
       mOpenedChannels[channelNumber] = false;
@@ -667,7 +669,7 @@
   if (ESESTATUS_SUCCESS != deInitStatus) mIsDeInitDone = false;
   status = phNxpEse_ResetEndPoint_Cntxt(1);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     mIsDeInitDone = false;
   }
   status = phNxpEse_close(deInitStatus);
diff --git a/snxxx/1.2/VirtualISO.h b/snxxx/1.2/VirtualISO.h
old mode 100755
new mode 100644
index 53419e1..dc4f296
--- a/snxxx/1.2/VirtualISO.h
+++ b/snxxx/1.2/VirtualISO.h
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2018-2020,2022 NXP
+ *  Copyright 2018-2020,2022-2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -21,6 +21,8 @@
 #include <android-base/stringprintf.h>
 #include <android/hardware/secure_element/1.0/types.h>
 #include <android/hardware/secure_element/1.2/ISecureElement.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
 #include <hardware/hardware.h>
 #include <hidl/MQDescriptor.h>
 #include <hidl/Status.h>
diff --git a/snxxx/aidl/SecureElement.cpp b/snxxx/aidl/SecureElement.cpp
index 7a7a5aa..432a2ef 100644
--- a/snxxx/aidl/SecureElement.cpp
+++ b/snxxx/aidl/SecureElement.cpp
@@ -50,6 +50,19 @@
 std::shared_ptr<ISecureElementCallback> SecureElement::mCb = nullptr;
 AIBinder_DeathRecipient* clientDeathRecipient = nullptr;
 std::vector<bool> SecureElement::mOpenedChannels;
+static const std::vector<std::vector<uint8_t>> kWeaverAIDs = {
+    {0xA0, 0x00, 0x00, 0x03, 0x96, 0x10, 0x10},  // Primary AID
+    {0xA0, 0x00, 0x00, 0x03, 0x96, 0x54, 0x53, 0x00, 0x00, 0x00, 0x01, 0x00,
+     0x23, 0x00, 0x00, 0x00},  // Alternate AID
+};
+
+static bool isWeaverApplet(std::vector<uint8_t> aid) {
+  if (std::find(kWeaverAIDs.begin(), kWeaverAIDs.end(), aid) !=
+      kWeaverAIDs.end()) {
+    return true;
+  }
+  return false;
+}
 
 SecureElement::SecureElement()
     : mMaxChannelCount(0), mOpenedchannelCount(0), mIsEseInitialized(false) {}
@@ -119,9 +132,10 @@
     if (ESESTATUS_SUCCESS == phNxpEse_SetEndPoint_Cntxt(0)) {
       initStatus = phNxpEse_init(initParams);
       if (initStatus == ESESTATUS_SUCCESS) {
-        /*update OS mode during first init*/
-        IS_OSU_MODE(OsuHalExtn::getInstance().INIT, 0);
-
+        if (GET_CHIP_OS_VERSION() < OS_VERSION_8_9) {
+          /*update OS mode during first init*/
+          IS_OSU_MODE(OsuHalExtn::getInstance().INIT, 0);
+        }
         if (ESESTATUS_SUCCESS == phNxpEse_ResetEndPoint_Cntxt(0)) {
           LOG(INFO) << "ESE SPI init complete!!!";
           mIsInitDone = true;
@@ -135,7 +149,8 @@
     if (status == ESESTATUS_SUCCESS &&
         (initStatus == ESESTATUS_TRANSCEIVE_FAILED ||
          initStatus == ESESTATUS_FAILED)) {
-      IS_OSU_MODE(OsuHalExtn::getInstance().INIT, 0);
+      if (GET_CHIP_OS_VERSION() < OS_VERSION_8_9)
+        IS_OSU_MODE(OsuHalExtn::getInstance().INIT, 0);
       mIsInitDone = true;
     }
   }
@@ -163,7 +178,8 @@
   bool mIsSeHalInitDone = false;
 
   // In dedicated mode getATR not allowed
-  if (IS_OSU_MODE(OsuHalExtn::getInstance().GETATR)) {
+  if ((GET_CHIP_OS_VERSION() < OS_VERSION_6_2) &&
+      (IS_OSU_MODE(OsuHalExtn::getInstance().GETATR))) {
     LOG(ERROR) << "%s: Not allowed in dedicated mode!!!" << __func__;
     *_aidl_return = response;
     return ndk::ScopedAStatus::ok();
@@ -181,7 +197,7 @@
   }
   status = phNxpEse_SetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "Endpoint set failed";
+    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed";
   }
   status = phNxpEse_getAtr(&atrData);
   if (status != ESESTATUS_SUCCESS) {
@@ -195,7 +211,7 @@
 
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "Endpoint set failed";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed";
   }
 
   if (status != ESESTATUS_SUCCESS) {
@@ -204,7 +220,7 @@
       ALOGI("0x%x\t", *i);
   }
 
-  *_aidl_return = response;
+  *_aidl_return = std::move(response);
   if (atrData.p_data != NULL) {
     phNxpEse_free(atrData.p_data);
   }
@@ -228,6 +244,14 @@
   AutoMutex guard(seHalLock);
   ESESTATUS status = ESESTATUS_FAILED;
   std::vector<uint8_t> result;
+  if (!mOpenedchannelCount) {
+    // 0x69, 0x86 = COMMAND NOT ALLOWED
+    uint8_t sw[2] = {0x69, 0x86};
+    result.resize(sizeof(sw));
+    memcpy(&result[0], sw, sizeof(sw));
+    return ScopedAStatus::fromServiceSpecificError(CHANNEL_NOT_AVAILABLE);
+  }
+
   phNxpEse_memset(&gsTxRxBuffer.cmdData, 0x00, sizeof(phNxpEse_data));
   phNxpEse_memset(&gsTxRxBuffer.rspData, 0x00, sizeof(phNxpEse_data));
   gsTxRxBuffer.cmdData.len = (uint32_t)data.size();
@@ -239,23 +263,24 @@
     *_aidl_return = result;
     return ScopedAStatus::ok();
   }
-  OsuHalExtn::OsuApduMode mode = IS_OSU_MODE(
-      data, OsuHalExtn::getInstance().TRANSMIT, &gsTxRxBuffer.cmdData);
-  if (mode == OsuHalExtn::getInstance().OSU_BLOCKED_MODE) {
-    LOG(ERROR) << "Not allowed in dedicated mode!!!";
-    /*Return empty vec*/
-    *_aidl_return = result;
-    return ScopedAStatus::ok();
-  } else if (mode == OsuHalExtn::getInstance().OSU_RST_MODE) {
-    uint8_t sw[2] = {0x90, 0x00};
-    result.resize(sizeof(sw));
-    memcpy(&result[0], sw, sizeof(sw));
-    *_aidl_return = result;
-    return ScopedAStatus::ok();
+  if (GET_CHIP_OS_VERSION() < OS_VERSION_8_9) {
+    OsuHalExtn::OsuApduMode mode = IS_OSU_MODE(
+        data, OsuHalExtn::getInstance().TRANSMIT, &gsTxRxBuffer.cmdData);
+    if (mode == OsuHalExtn::getInstance().OSU_BLOCKED_MODE) {
+      LOG(ERROR) << "Not allowed in dedicated mode!!!";
+      /*Return empty vec*/
+      *_aidl_return = result;
+      return ScopedAStatus::ok();
+    } else if (mode == OsuHalExtn::getInstance().OSU_RST_MODE) {
+      uint8_t sw[2] = {0x90, 0x00};
+      result.resize(sizeof(sw));
+      memcpy(&result[0], sw, sizeof(sw));
+      *_aidl_return = result;
+      return ScopedAStatus::ok();
+    }
   } else {
-    // continue with normal processing
+    memcpy(gsTxRxBuffer.cmdData.p_data, data.data(), gsTxRxBuffer.cmdData.len);
   }
-  // memcpy(gsTxRxBuffer.cmdData.p_data, data.data(), gsTxRxBuffer.cmdData.len);
   LOG(INFO) << "Acquired lock for SPI";
   status = phNxpEse_SetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
@@ -272,19 +297,13 @@
     memcpy(&result[0], respBuf, sizeof(respBuf));
   } else {
     LOG(ERROR) << "transmit failed!!!";
-    if (!mOpenedchannelCount) {
-      // 0x69, 0x86 = COMMAND NOT ALLOWED
-      uint8_t sw[2] = {0x69, 0x86};
-      result.resize(sizeof(sw));
-      memcpy(&result[0], sw, sizeof(sw));
-    }
   }
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
 
-  *_aidl_return = result;
+  *_aidl_return = std::move(result);
   if (NULL != gsTxRxBuffer.cmdData.p_data) {
     phNxpEse_free(gsTxRxBuffer.cmdData.p_data);
     gsTxRxBuffer.cmdData.p_data = NULL;
@@ -333,7 +352,8 @@
   LOG(INFO) << "Acquired the lock from SPI openLogicalChannel";
 
   // In dedicated mode openLogical not allowed
-  if (IS_OSU_MODE(OsuHalExtn::getInstance().OPENLOGICAL)) {
+  if ((GET_CHIP_OS_VERSION() < OS_VERSION_8_9) &&
+      (IS_OSU_MODE(OsuHalExtn::getInstance().OPENLOGICAL))) {
     LOG(ERROR) << "%s: Not allowed in dedicated mode!!!" << __func__;
     *_aidl_return = resApduBuff;
     return ScopedAStatus::fromServiceSpecificError(IOERROR);
@@ -403,7 +423,7 @@
     send the callback and return*/
     status = phNxpEse_ResetEndPoint_Cntxt(0);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
     *_aidl_return = resApduBuff;
     return ScopedAStatus::fromServiceSpecificError(sestatus);
@@ -497,9 +517,9 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
-  *_aidl_return = resApduBuff;
+  *_aidl_return = std::move(resApduBuff);
   phNxpEse_free(cpdu.pdata);
   phNxpEse_free(rpdu.pdata);
 
@@ -521,6 +541,8 @@
   ESESTATUS status = ESESTATUS_SUCCESS;
   phNxpEse_7816_cpdu_t cpdu;
   phNxpEse_7816_rpdu_t rpdu;
+  std::vector<uint8_t> ls_aid = {0xA0, 0x00, 0x00, 0x03, 0x96, 0x41, 0x4C,
+                                 0x41, 0x01, 0x43, 0x4F, 0x52, 0x01};
 
   if (mOpenedChannels[0]) {
     LOG(ERROR) << "openBasicChannel failed, channel already in use";
@@ -529,9 +551,9 @@
   }
 
   LOG(ERROR) << "Acquired the lock in SPI openBasicChannel";
-  OsuHalExtn::OsuApduMode mode =
-      IS_OSU_MODE(aid, OsuHalExtn::getInstance().OPENBASIC);
-  if (mode == OsuHalExtn::OSU_PROP_MODE) {
+  if ((GET_CHIP_OS_VERSION() < OS_VERSION_8_9) &&
+      IS_OSU_MODE(aid, OsuHalExtn::getInstance().OPENBASIC) ==
+          OsuHalExtn::OSU_PROP_MODE) {
     uint8_t sw[2] = {0x90, 0x00};
     result.resize(sizeof(sw));
     memcpy(&result[0], sw, 2);
@@ -562,6 +584,8 @@
       *_aidl_return = result;
       return ScopedAStatus::fromServiceSpecificError(FAILED);
     } else {
+      mOpenedChannels[0] = true;
+      mOpenedchannelCount++;
       *_aidl_return = result;
       return ScopedAStatus::ok();
     }
@@ -576,22 +600,24 @@
     }
   }
 
-  phNxpEse_data atrData;
-  if (phNxpEse_getAtr(&atrData) != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_getAtr failed";
-  }
-  if (atrData.p_data != NULL) {
-    phNxpEse_free(atrData.p_data);
-  }
-
-  if (phNxpEse_GetOsMode() == OSU_MODE) {
-    if (mOpenedchannelCount == 0) {
-      if (seHalDeInit() != SESTATUS_SUCCESS) {
-        LOG(INFO) << "seDeInit Failed";
-      }
+  if (GET_CHIP_OS_VERSION() < OS_VERSION_8_9) {
+    phNxpEse_data atrData;
+    if (phNxpEse_getAtr(&atrData) != ESESTATUS_SUCCESS) {
+      LOG(ERROR) << "phNxpEse_getAtr failed";
     }
-    *_aidl_return = result;
-    return ScopedAStatus::fromServiceSpecificError(IOERROR);
+    if (atrData.p_data != NULL) {
+      phNxpEse_free(atrData.p_data);
+    }
+
+    if (phNxpEse_GetOsMode() == OSU_MODE) {
+      if (mOpenedchannelCount == 0) {
+        if (seHalDeInit() != SESTATUS_SUCCESS) {
+          LOG(INFO) << "seDeInit Failed";
+        }
+      }
+      *_aidl_return = result;
+      return ScopedAStatus::fromServiceSpecificError(IOERROR);
+    }
   }
 
   if (mOpenedChannels.size() == 0x00) {
@@ -669,7 +695,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
   if (sestatus != SESTATUS_SUCCESS) {
     int closeChannelStatus = internalCloseChannel(DEFAULT_BASIC_CHANNEL);
@@ -677,7 +703,7 @@
       LOG(ERROR) << "%s: closeChannel Failed" << __func__;
     }
   }
-  *_aidl_return = result;
+  *_aidl_return = std::move(result);
   phNxpEse_free(cpdu.pdata);
   phNxpEse_free(rpdu.pdata);
   return sestatus == SESTATUS_SUCCESS
@@ -723,7 +749,7 @@
     }
     status = phNxpEse_ResetEndPoint_Cntxt(0);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
   } else if (channelNumber == DEFAULT_BASIC_CHANNEL &&
              mOpenedChannels[channelNumber]) {
@@ -750,7 +776,8 @@
   AutoMutex guard(seHalLock);
   int sestatus;
   // Close internal allowed when not in dedicated Mode
-  if (!IS_OSU_MODE(OsuHalExtn::getInstance().CLOSE, channelNumber)) {
+  if ((GET_CHIP_OS_VERSION() >= OS_VERSION_8_9) ||
+      (!IS_OSU_MODE(OsuHalExtn::getInstance().CLOSE, channelNumber))) {
     sestatus = internalCloseChannel(channelNumber);
   } else {
     /*Decrement channel count opened to
@@ -814,7 +841,7 @@
   if (ESESTATUS_SUCCESS != deInitStatus) mIsDeInitDone = false;
   status = phNxpEse_ResetEndPoint_Cntxt(0);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     mIsDeInitDone = false;
   }
   status = phNxpEse_close(deInitStatus);
@@ -928,13 +955,11 @@
 }
 
 uint8_t SecureElement::getReserveChannelCnt(const std::vector<uint8_t>& aid) {
-  const std::vector<uint8_t> weaverAid = {0xA0, 0x00, 0x00, 0x03,
-                                          0x96, 0x10, 0x10};
   const std::vector<uint8_t> araAid = {0xA0, 0x00, 0x00, 0x01, 0x51,
                                        0x41, 0x43, 0x4C, 0x00};
   uint8_t reserveChannel = 0;
   // Check priority access enabled then only reserve channel
-  if (mHasPriorityAccess && aid != weaverAid && aid != araAid) {
+  if (mHasPriorityAccess && !isWeaverApplet(aid) && aid != araAid) {
     // Exclude basic channel
     reserveChannel = 1;
   }
diff --git a/snxxx/aidl/VirtualISO.cpp b/snxxx/aidl/VirtualISO.cpp
index 571e365..5808238 100644
--- a/snxxx/aidl/VirtualISO.cpp
+++ b/snxxx/aidl/VirtualISO.cpp
@@ -111,7 +111,7 @@
 
 ScopedAStatus VirtualISO::getAtr(std::vector<uint8_t>* _aidl_return) {
   std::vector<uint8_t> response;
-  *_aidl_return = response;
+  *_aidl_return = std::move(response);
   return ScopedAStatus::ok();
 }
 
@@ -152,10 +152,10 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(1);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
 
-  *_aidl_return = result;
+  *_aidl_return = std::move(result);
 
   if (NULL != gsTxRxBuffer.cmdData.p_data) {
     phNxpEse_free(gsTxRxBuffer.cmdData.p_data);
@@ -269,7 +269,7 @@
     send the callback and return*/
     status = phNxpEse_ResetEndPoint_Cntxt(1);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
     *_aidl_return = resApduBuff;
     return ScopedAStatus::fromServiceSpecificError(sestatus);
@@ -352,9 +352,9 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(1);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
-  *_aidl_return = resApduBuff;
+  *_aidl_return = std::move(resApduBuff);
   phNxpEse_free(cpdu.pdata);
   phNxpEse_free(rpdu.pdata);
 
@@ -448,7 +448,7 @@
   }
   status = phNxpEse_ResetEndPoint_Cntxt(1);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
   }
   if (sestatus != SESTATUS_SUCCESS) {
     int closeChannelStatus = internalCloseChannel(DEFAULT_BASIC_CHANNEL);
@@ -456,7 +456,7 @@
       LOG(ERROR) << "%s: closeChannel Failed" << __func__;
     }
   }
-  *_aidl_return = result;
+  *_aidl_return = std::move(result);
   phNxpEse_free(cpdu.pdata);
   phNxpEse_free(rpdu.pdata);
   return sestatus == SESTATUS_SUCCESS
@@ -503,7 +503,7 @@
     }
     status = phNxpEse_ResetEndPoint_Cntxt(1);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
     if (mOpenedChannels[channelNumber]) {
       mOpenedChannels[channelNumber] = false;
@@ -551,7 +551,7 @@
     }
     status = phNxpEse_ResetEndPoint_Cntxt(1);
     if (status != ESESTATUS_SUCCESS) {
-      LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+      LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     }
     if (mOpenedChannels[channelNumber]) {
       mOpenedChannels[channelNumber] = false;
@@ -610,7 +610,7 @@
   if (ESESTATUS_SUCCESS != deInitStatus) mIsDeInitDone = false;
   status = phNxpEse_ResetEndPoint_Cntxt(1);
   if (status != ESESTATUS_SUCCESS) {
-    LOG(ERROR) << "phNxpEse_SetEndPoint_Cntxt failed!!!";
+    LOG(ERROR) << "phNxpEse_ResetEndPoint_Cntxt failed!!!";
     mIsDeInitDone = false;
   }
   status = phNxpEse_close(deInitStatus);
diff --git a/snxxx/ese-clients/inc/eSEClient.h b/snxxx/ese-clients/inc/eSEClient.h
index a017f60..4122f7e 100644
--- a/snxxx/ese-clients/inc/eSEClient.h
+++ b/snxxx/ese-clients/inc/eSEClient.h
@@ -16,6 +16,7 @@
  *
  ******************************************************************************/
 
+#ifdef NXP_BOOTTIME_UPDATE
 #include "eSEClientIntf.h"
 #include "phNxpEse_Api.h"
 
@@ -37,3 +38,4 @@
 } SEDomainID;
 
 #endif /* ESE_UPDATE_2_H_ */
+#endif /* NXP_BOOTTIME_UPDATE */
\ No newline at end of file
diff --git a/snxxx/ese-clients/src/eSEClient.cpp b/snxxx/ese-clients/src/eSEClient.cpp
index 2498027..566358b 100644
--- a/snxxx/ese-clients/src/eSEClient.cpp
+++ b/snxxx/ese-clients/src/eSEClient.cpp
@@ -16,6 +16,7 @@
  *
  ******************************************************************************/
 
+#ifdef NXP_BOOTTIME_UPDATE
 #include "eSEClient.h"
 
 #include <IChannel.h>
@@ -501,3 +502,4 @@
   }
   return SESTATUS_SUCCESS;
 }
+#endif /* NXP_BOOTTIME_UPDATE */
\ No newline at end of file
diff --git a/snxxx/extns/impl/NxpEse.cpp b/snxxx/extns/impl/NxpEse.cpp
old mode 100755
new mode 100644
index 9970db6..72390dd
--- a/snxxx/extns/impl/NxpEse.cpp
+++ b/snxxx/extns/impl/NxpEse.cpp
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2018-2022 NXP
+ *  Copyright 2018-2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -15,10 +15,9 @@
  *  limitations under the License.
  *
  ******************************************************************************/
-#include "NxpEse.h"
 #ifdef NXP_BOOTTIME_UPDATE
+#include "NxpEse.h"
 #include "eSEClient.h"
-#endif
 #include <android-base/logging.h>
 #include <android-base/stringprintf.h>
 #include <memunreachable/memunreachable.h>
@@ -166,7 +165,6 @@
       virtualISOCallback->onStateChange(false);
   }
 }
-#ifdef NXP_BOOTTIME_UPDATE
 Return<void> NxpEse::ioctlHandler(uint64_t ioctlType,
                                   ese_nxp_IoctlInOutData_t& inpOutData) {
   switch (ioctlType) {
@@ -183,7 +181,6 @@
   }
   return Void();
 }
-#endif
 
 Return<void> NxpEse::ioctl(uint64_t ioctlType,
                            const hidl_vec<uint8_t>& inOutData,
@@ -196,20 +193,16 @@
    * underlying HAL implementation since it's an inout argument*/
   memcpy(&inpOutData, pInOutData, sizeof(ese_nxp_IoctlInOutData_t));
   ESESTATUS status = phNxpEse_spiIoctl(ioctlType, &inpOutData);
-#ifdef NXP_BOOTTIME_UPDATE
   ioctlHandler(ioctlType, inpOutData);
-#endif
   /*copy data and additional fields indicating status of ioctl operation
    * and context of the caller. Then invoke the corresponding proxy callback*/
   inpOutData.out.ioctlType = ioctlType;
   inpOutData.out.result = status;
-#ifdef NXP_BOOTTIME_UPDATE
   if (ioctlType == HAL_ESE_IOCTL_GET_ESE_UPDATE_STATE) {
     inpOutData.out.data.status =
         (getJcopUpdateRequired() | (getLsUpdateRequired() << 8));
   }
-#endif
-  hidl_vec<uint8_t> outputData;
+  EseData outputData;
   outputData.setToExternal((uint8_t*)&inpOutData.out,
                            sizeof(ese_nxp_ExtnOutputData_t));
   LOG(ERROR) << "GET ESE update state2 = " << inpOutData.out.data.status;
@@ -230,3 +223,4 @@
 }  // namespace nxpese
 }  // namespace nxp
 }  // namespace vendor
+#endif //NXP_BOOTTIME_UPDATE
\ No newline at end of file
diff --git a/snxxx/extns/impl/NxpEse.h b/snxxx/extns/impl/NxpEse.h
old mode 100755
new mode 100644
index 02e2302..bc2b01c
--- a/snxxx/extns/impl/NxpEse.h
+++ b/snxxx/extns/impl/NxpEse.h
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2018-2019,2022 NXP
+ *  Copyright 2018-2019,2022-2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
  *  limitations under the License.
  *
  ******************************************************************************/
+#ifdef NXP_BOOTTIME_UPDATE
 #ifndef VENDOR_NXP_NXPNFC_V1_0_NXPNFC_H
 #define VENDOR_NXP_NXPNFC_V1_0_NXPNFC_H
 
@@ -56,7 +57,6 @@
   // Methods from ::android::hidl::base::V1_0::IBase follow.
   Return<void> debug(const hidl_handle& handle,
                      const hidl_vec<hidl_string>& options) override;
-
   Return<void> ioctl(uint64_t ioctlType, const hidl_vec<uint8_t>& inOutData,
                      ioctl_cb _hidl_cb) override;
   static Return<void> setSeCallBack(
@@ -73,7 +73,6 @@
           clientCallback);
   static void initSEService();
   static void initVIrtualISOService();
-
  private:
   Return<void> ioctlHandler(uint64_t ioctlType,
                             ese_nxp_IoctlInOutData_t& inpOutData);
@@ -86,3 +85,4 @@
 }  // namespace vendor
 
 #endif  // VENDOR_NXP_NXPNFC_V1_0_NXPNFC_H
+#endif // NXP_BOOTTIME_UPDATE
\ No newline at end of file
diff --git a/snxxx/libese-spi/common/include/phNxpEseFeatures.h b/snxxx/libese-spi/common/include/phNxpEseFeatures.h
index af8f491..4cc1d0e 100644
--- a/snxxx/libese-spi/common/include/phNxpEseFeatures.h
+++ b/snxxx/libese-spi/common/include/phNxpEseFeatures.h
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2018-2020, 2022 NXP
+ *  Copyright 2018-2020, 2022-2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -39,6 +39,7 @@
   OS_VERSION_5_2_2 = 4,
   OS_VERSION_6_2 = 5,
   OS_VERSION_6_3 = 6,
+  OS_VERSION_8_9 = 8,
   INVALID_OS_VERSION = 0xFF,
 } phNxpEse_OsVersion_t;
 
diff --git a/snxxx/libese-spi/p73/inc/phNxpEse_Api.h b/snxxx/libese-spi/p73/inc/phNxpEse_Api.h
old mode 100755
new mode 100644
index 7d720db..f21c6d2
--- a/snxxx/libese-spi/p73/inc/phNxpEse_Api.h
+++ b/snxxx/libese-spi/p73/inc/phNxpEse_Api.h
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2018-2021,2022 NXP
+ *  Copyright 2018-2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -115,16 +115,7 @@
  */
 ESESTATUS phNxpEse_init(phNxpEse_initParams initParams);
 
-/**
- * \ingroup spi_libese
- *
- * \brief  Check if libese has opened
- *
- * \retval return false if it is close, otherwise true.
- *
- */
-bool phNxpEse_isOpen();
-
+#ifdef NXP_BOOTTIME_UPDATE
 /**
  * \ingroup spi_libese
  *
@@ -138,6 +129,8 @@
  *
  */
 ESESTATUS phNxpEse_spiIoctl(uint64_t ioctlType, void* p_data);
+#endif
+
 /**
  * \ingroup spi_libese
  *
@@ -184,21 +177,6 @@
 
 /**
  * \ingroup spi_libese
- * \brief This function is called by Jni during the
- *        initialization of the ESE. It opens the physical connection
- *        with ESE () and creates required client thread for
- *        operation.  This will get priority access to ESE for timeout period.
- *
- * \param[in]     initParams - Initialize with init mode ( normal/osu) and media
- * type(SPI- legacy/ APDU type).
- *
- * \retval ESESTATUS_SUCCESS On Success ESESTATUS_SUCCESS else proper error code
- *
- */
-ESESTATUS phNxpEse_openPrioSession(phNxpEse_initParams initParams);
-
-/**
- * \ingroup spi_libese
  * \brief This function prepares the C-APDU, send to ESE and then receives the
  *response from ESE,
  *         decode it and returns data.
@@ -291,16 +269,6 @@
 
 /**
  * \ingroup spi_libese
- * \brief This function sends the S-frame to indicate END_OF_APDU
- *
- *
- * \retval ESESTATUS_SUCCESS Always return ESESTATUS_SUCCESS (0).
- *
- */
-ESESTATUS phNxpEse_EndOfApdu(void);
-
-/**
- * \ingroup spi_libese
  * \brief This function  suspends execution of the calling thread for
  *           (at least) usec microseconds
  *
@@ -375,27 +343,6 @@
 
 /**
  * \ingroup spi_libese
- * \brief This function performs disable/enable power control
- *
- *
- * \retval ESESTATUS_SUCCESS Always return ESESTATUS_SUCCESS (0).
- *
- */
-ESESTATUS phNxpEse_DisablePwrCntrl(void);
-
-/**
- * \ingroup spi_libese
- * \brief This function is used to get the ESE timer status
- *
- * \param[out]       timer_buffer
- *
- * \retval ESESTATUS_SUCCESS Always return ESESTATUS_SUCCESS (0).
- *
- */
-ESESTATUS phNxpEse_GetEseStatus(phNxpEse_data* timer_buffer);
-
-/**
- * \ingroup spi_libese
  * \brief This function power recycles the ESE
  *        (using prop. FW command) by talking to NFC HAL
  *
diff --git a/snxxx/libese-spi/p73/lib/phNxpEseProto7816_3.cpp b/snxxx/libese-spi/p73/lib/phNxpEseProto7816_3.cpp
index 5a3d01d..4dea1c4 100644
--- a/snxxx/libese-spi/p73/lib/phNxpEseProto7816_3.cpp
+++ b/snxxx/libese-spi/p73/lib/phNxpEseProto7816_3.cpp
@@ -191,15 +191,6 @@
 
 /**
  * \ingroup ISO7816-3_protocol_lib
- * \brief      This internal function is used to
- *                  1. Send proprietary S-Frame command for re-sync
- *T=1 sequence at worker
- *
- */
-static ESESTATUS phNxpEseProto7816_RSync(void);
-
-/**
- * \ingroup ISO7816-3_protocol_lib
  * \brief       This function is used to send the spi hard reset command
  *
  */
@@ -889,13 +880,15 @@
                                    (phNxpEseProto7816_3_Var.atrInfo.bgt[1]));
   NXP_LOG_ESE_D("BWT = %d ms", phNxpEseProto7816_3_Var.atrInfo.bwt[0] << 8 |
                                    phNxpEseProto7816_3_Var.atrInfo.bwt[1]);
-  NXP_LOG_ESE_D("Max supported frequency = %d Hz",
+  NXP_LOG_ESE_D("Max supported frequency = %d KHz",
                 phNxpEseProto7816_3_Var.atrInfo.maxFreq[0] << 8 |
                     phNxpEseProto7816_3_Var.atrInfo.maxFreq[1]);
   NXP_LOG_ESE_D("Checksum LRC(0)/CRC(1) supports = 0x%x",
                 phNxpEseProto7816_3_Var.atrInfo.checksum);
   NXP_LOG_ESE_D("DefaultIFSC = %d bytes",
                 phNxpEseProto7816_3_Var.atrInfo.defaultIFSC);
+  NXP_LOG_ESE_D("Number of logical connections supported = %d",
+                phNxpEseProto7816_3_Var.atrInfo.numChannels);
   NXP_LOG_ESE_D("Max IFSC = %d bytes",
                 phNxpEseProto7816_3_Var.atrInfo.maxIFSC[0] << 8 |
                     phNxpEseProto7816_3_Var.atrInfo.maxIFSC[1]);
@@ -916,7 +909,11 @@
                                                              : "OSU Mode"));
   }
   if (phNxpEseProto7816_3_Var.atrInfo.vendorID[PH_PROTO_ATR_RSP_VENDOR_ID_LEN -
-                                               1] >= PH_SE_OS_VERSION_21) {
+                                               1] >= PH_SE_OS_VERSION_30) {
+    phNxpEse_setOsVersion(OS_VERSION_8_9);
+  } else if (phNxpEseProto7816_3_Var.atrInfo
+                 .vendorID[PH_PROTO_ATR_RSP_VENDOR_ID_LEN - 1] >=
+             PH_SE_OS_VERSION_21) {
     phNxpEse_setOsVersion(OS_VERSION_6_3);
   } else if (phNxpEseProto7816_3_Var.atrInfo
                  .vendorID[PH_PROTO_ATR_RSP_VENDOR_ID_LEN - 1] >=
@@ -990,20 +987,86 @@
 }
 
 /******************************************************************************
+ * Function         phNxpEseProto7816_SetTxstate
+ *
+ * Description      This internal function is used to set the Tranceive state
+ *                  of T=1 Proto stack. Accordingly, it will set the params
+ *                  for next transceive.
+ * Returns          void.
+ *
+ ******************************************************************************/
+static void phNxpEseProto7816_SetTxstate(
+    phNxpEseProto7816_TransceiveStates_t state) {
+  phNxpEseProto7816_3_Var.phNxpEseNextTx_Cntx.FrameType = SFRAME;
+  phNxpEseProto7816_3_Var.phNxpEseProto7816_nextTransceiveState = state;
+  switch (state) {
+    case SEND_S_IFS_ADJ:
+      phNxpEseProto7816_3_Var.phNxpEseNextTx_Cntx.SframeInfo.sFrameType =
+          IFS_REQ;
+      break;
+    case SEND_S_ATR_REQ:
+      phNxpEseProto7816_3_Var.phNxpEseNextTx_Cntx.SframeInfo.sFrameType =
+          ATR_REQ;
+      break;
+    default:
+      NXP_LOG_ESE_E("%s: Wrong transceive state received ", __FUNCTION__);
+      break;
+  }
+}
+/******************************************************************************
+ * Function         phNxpEseProto7816_DecodeAtrRsp
+ *
+ * Description      The function phNxpEseProto7816_DecodeFrame() shall call
+ *                  this function up on receiving the ATR RSP
+ *                  1. If Last sent frame is S-Frame then send back the correct
+ *                    S-frame response.
+ *                  2. If Last sent frame is I-Frame then trigger the recovery
+ *                    RESET_TYPE_OS_RESET.
+ * Returns          On success returns ESESTATUS_SUCCESS else ESESTATUS_FAILED.
+ *
+ ******************************************************************************/
+static ESESTATUS phNxpEseProto7816_DecodeAtrRsp(uint8_t* p_data) {
+  ESESTATUS status = ESESTATUS_SUCCESS;
+  // This is 4ms delay and delay of 1ms in also there in line 1401 before
+  // next Tx
+  phNxpEse_Sleep(HARD_RESET_RES_DELAY);
+  if (phNxpEseProto7816_3_Var.phNxpEseLastTx_Cntx.FrameType == IFRAME) {
+    // Applicable only for SN300
+    phNxpEseProto7816_SetTxstate(SEND_S_ATR_REQ);
+    phNxpEseProto7816_3_Var.reset_type = RESET_TYPE_OS_RESET;
+  } else {
+    if (p_data[PH_PROPTO_7816_FRAME_LENGTH_OFFSET] > 0) {
+      /*Response status either success/fail*/
+      if (!p_data[PH_PROPTO_7816_FRAME_LENGTH_OFFSET + 1])
+        status = ESESTATUS_FAILED;
+      else
+        status = ESESTATUS_SUCCESS;
+    }
+    phNxpEseProto7816_3_Var.phNxpEseNextTx_Cntx.FrameType = UNKNOWN;
+    phNxpEseProto7816_3_Var.phNxpEseProto7816_nextTransceiveState = IDLE_STATE;
+  }
+  phNxpEseProto7816_3_Var.phNxpEseRx_Cntx.lastRcvdSframeInfo.sFrameType =
+      HARD_RESET_RSP;
+  return status;
+}
+/******************************************************************************
  * Function         phNxpEseProto7816_DecodeFrame
  *
  * Description      This internal function is used to
  *                  1. Identify the received frame
  *                  2. If the received frame is I-frame with expected sequence
- number, store it or else send R-NACK
-                    3. If the received frame is R-frame,
-                       3.1 R-ACK with expected seq. number: Send the next
- chained I-frame
-                       3.2 R-ACK with different sequence number: Send the R-Nack
-                       3.3 R-NACK: Re-send the last frame
-                    4. If the received frame is S-frame, send back the correct
- S-frame response.
- * Returns          On success return true or else false.
+ *                     number, store it or else send R-NACK
+ *                  3. If the received frame is R-frame,
+ *                     3.1 R-ACK with expected seq. number: Send the next
+ *                     chained I-frame
+ *                     3.2 R-ACK with different sequence number: Send the R-Nack
+ *                     3.3 R-NACK: Re-send the last frame
+ *                   4. If the received frame is S-frame,
+ *                     4.1 Last sent frame is S-Frame then send back the
+ *                         correct S-frame response.
+ *                     4.2 Last sent frame is I-Frame then trigger the recovery
+ *                         RESET_TYPE_OS_RESET.
+ * Returns          On success returns true else false.
  *
  ******************************************************************************/
 static ESESTATUS phNxpEseProto7816_DecodeFrame(uint8_t* p_data,
@@ -1289,6 +1352,8 @@
         phNxpEseProto7816_3_Var.phNxpEseNextTx_Cntx.FrameType = UNKNOWN;
         phNxpEseProto7816_3_Var.phNxpEseProto7816_nextTransceiveState =
             IDLE_STATE;
+        if (phNxpEseProto7816_3_Var.reset_type == RESET_TYPE_OS_RESET)
+          status = ESESTATUS_FAILED;
         break;
       case ABORT_REQ:
         phNxpEseProto7816_3_Var.phNxpEseRx_Cntx.lastRcvdSframeInfo.sFrameType =
@@ -1377,11 +1442,7 @@
           phNxpEseProto7816_3_Var.currentIFSDSize = tmpcurrentIFSDSize;
           phNxpEseProto7816_3_Var.phNxpEseProto7816_CurrentState =
               PH_NXP_ESE_PROTO_7816_TRANSCEIVE;
-          phNxpEseProto7816_3_Var.phNxpEseNextTx_Cntx.FrameType = SFRAME;
-          phNxpEseProto7816_3_Var.phNxpEseNextTx_Cntx.SframeInfo.sFrameType =
-              IFS_REQ;
-          phNxpEseProto7816_3_Var.phNxpEseProto7816_nextTransceiveState =
-              SEND_S_IFS_ADJ;
+          phNxpEseProto7816_SetTxstate(SEND_S_IFS_ADJ);
         } else {
           phNxpEseProto7816_ResetProtoParams();
           phNxpEseProto7816_3_Var.phNxpEseRx_Cntx.lastRcvdSframeInfo
@@ -1414,21 +1475,7 @@
             HARD_RESET_REQ;
         break;
       case HARD_RESET_RSP:
-        // This is 4ms delay and delay of 1ms in also there in line 1401 before
-        // next Tx
-        phNxpEse_Sleep(HARD_RESET_RES_DELAY);
-        phNxpEseProto7816_3_Var.phNxpEseRx_Cntx.lastRcvdSframeInfo.sFrameType =
-            HARD_RESET_RSP;
-        if (p_data[PH_PROPTO_7816_FRAME_LENGTH_OFFSET] > 0) {
-          /*Response status either success/fail*/
-          if (!p_data[PH_PROPTO_7816_FRAME_LENGTH_OFFSET + 1])
-            status = ESESTATUS_FAILED;
-          else
-            status = ESESTATUS_SUCCESS;
-        }
-        phNxpEseProto7816_3_Var.phNxpEseNextTx_Cntx.FrameType = UNKNOWN;
-        phNxpEseProto7816_3_Var.phNxpEseProto7816_nextTransceiveState =
-            IDLE_STATE;
+        status = phNxpEseProto7816_DecodeAtrRsp(p_data);
         break;
       case ATR_RSP:
         phNxpEseProto7816_3_Var.phNxpEseRx_Cntx.lastRcvdSframeInfo.sFrameType =
@@ -1441,9 +1488,13 @@
         } else {
           phNxpEse_setOsVersion(OS_VERSION_4_0);
         }
-        phNxpEseProto7816_3_Var.phNxpEseNextTx_Cntx.FrameType = UNKNOWN;
-        phNxpEseProto7816_3_Var.phNxpEseProto7816_nextTransceiveState =
-            IDLE_STATE;
+        if (phNxpEseProto7816_3_Var.reset_type == RESET_TYPE_OS_RESET) {
+          phNxpEseProto7816_SetTxstate(SEND_S_IFS_ADJ);
+        } else {
+          phNxpEseProto7816_3_Var.phNxpEseNextTx_Cntx.FrameType = UNKNOWN;
+          phNxpEseProto7816_3_Var.phNxpEseProto7816_nextTransceiveState =
+              IDLE_STATE;
+        }
         break;
       default:
         NXP_LOG_ESE_E("%s Wrong S-Frame Received", __FUNCTION__);
@@ -1806,29 +1857,6 @@
 }
 
 /******************************************************************************
- * Function         phNxpEseProto7816_RSync
- *
- * Description      This function is used to send the RSync command
- *
- * Returns          On success return true or else false.
- *
- ******************************************************************************/
-static ESESTATUS phNxpEseProto7816_RSync(void) {
-  ESESTATUS status = ESESTATUS_FAILED;
-  phNxpEseProto7816_3_Var.phNxpEseProto7816_CurrentState =
-      PH_NXP_ESE_PROTO_7816_TRANSCEIVE;
-  /* send the end of session s-frame */
-  phNxpEseProto7816_3_Var.phNxpEseNextTx_Cntx.FrameType = SFRAME;
-  phNxpEseProto7816_3_Var.phNxpEseNextTx_Cntx.SframeInfo.sFrameType =
-      RESYNCH_REQ;
-  phNxpEseProto7816_3_Var.phNxpEseProto7816_nextTransceiveState = SEND_S_RSYNC;
-  status = TransceiveProcess();
-  phNxpEseProto7816_3_Var.phNxpEseProto7816_CurrentState =
-      PH_NXP_ESE_PROTO_7816_IDLE;
-  return status;
-}
-
-/******************************************************************************
  * Function         phNxpEseProto7816_HardReset
  *
  * Description      This function is used to send the spi hard reset command
@@ -1925,17 +1953,12 @@
   ESESTATUS status = ESESTATUS_FAILED;
   /* Resetting host protocol instance */
   phNxpEseProto7816_ResetProtoParams();
-  if (GET_CHIP_OS_VERSION() != OS_VERSION_4_0) {
-    status = phNxpEseProto7816_HardReset();
-    if (status == ESESTATUS_SUCCESS) {
-      /* Updating the ATR information(IFS,..) to 7816 stack */
-      phNxpEse_data atrRsp;
-      phNxpEseProto7816_getAtr(&atrRsp);
-      phNxpEse_free(atrRsp.p_data);
-    }
-  } else {
-    /* Resynchronising ESE protocol instance */
-    status = phNxpEseProto7816_RSync();
+  status = phNxpEseProto7816_HardReset();
+  if (status == ESESTATUS_SUCCESS) {
+    /* Updating the ATR information(IFS,..) to 7816 stack */
+    phNxpEse_data atrRsp;
+    phNxpEseProto7816_getAtr(&atrRsp);
+    phNxpEse_free(atrRsp.p_data);
   }
   return status;
 }
@@ -1967,16 +1990,12 @@
     }
   } else /* Initialisation condition to achieve usecases like JCOP download */
   {
-    if (GET_CHIP_OS_VERSION() != OS_VERSION_4_0) {
-      status = phNxpEseProto7816_HardReset();
-      /* Updating the ATR information (Eg: IFS,..) to 7816 stack */
-      if (status == ESESTATUS_SUCCESS) {
-        phNxpEse_data atrRsp;
-        phNxpEseProto7816_getAtr(&atrRsp);
-        phNxpEse_free(atrRsp.p_data);
-      }
-    } else {
-      status = phNxpEseProto7816_RSync();
+    status = phNxpEseProto7816_HardReset();
+    /* Updating the ATR information (Eg: IFS,..) to 7816 stack */
+    if (status == ESESTATUS_SUCCESS) {
+      phNxpEse_data atrRsp;
+      phNxpEseProto7816_getAtr(&atrRsp);
+      phNxpEse_free(atrRsp.p_data);
     }
   }
   return status;
@@ -2134,10 +2153,7 @@
   }
   phNxpEseProto7816_3_Var.phNxpEseProto7816_CurrentState =
       PH_NXP_ESE_PROTO_7816_TRANSCEIVE;
-  phNxpEseProto7816_3_Var.phNxpEseNextTx_Cntx.FrameType = SFRAME;
-  phNxpEseProto7816_3_Var.phNxpEseNextTx_Cntx.SframeInfo.sFrameType = IFS_REQ;
-  phNxpEseProto7816_3_Var.phNxpEseProto7816_nextTransceiveState =
-      SEND_S_IFS_ADJ;
+  phNxpEseProto7816_SetTxstate(SEND_S_IFS_ADJ);
   status = TransceiveProcess();
   if (ESESTATUS_FAILED == status) {
     /* reset all the structures */
@@ -2208,11 +2224,7 @@
   NXP_LOG_ESE_D("Enter %s ", __FUNCTION__);
   phNxpEseProto7816_3_Var.phNxpEseProto7816_CurrentState =
       PH_NXP_ESE_PROTO_7816_TRANSCEIVE;
-  phNxpEseProto7816_3_Var.phNxpEseNextTx_Cntx.FrameType = SFRAME;
-
-  phNxpEseProto7816_3_Var.phNxpEseNextTx_Cntx.SframeInfo.sFrameType = ATR_REQ;
-  phNxpEseProto7816_3_Var.phNxpEseProto7816_nextTransceiveState =
-      SEND_S_ATR_REQ;
+  phNxpEseProto7816_SetTxstate(SEND_S_ATR_REQ);
   status = TransceiveProcess();
   if (ESESTATUS_FAILED == status) {
     /* reset all the structures */
diff --git a/snxxx/libese-spi/p73/lib/phNxpEseProto7816_3.h b/snxxx/libese-spi/p73/lib/phNxpEseProto7816_3.h
old mode 100755
new mode 100644
index f71d8fc..d6e4758
--- a/snxxx/libese-spi/p73/lib/phNxpEseProto7816_3.h
+++ b/snxxx/libese-spi/p73/lib/phNxpEseProto7816_3.h
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2018-2022 NXP
+ *  Copyright 2018-2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -122,7 +122,8 @@
  */
 typedef enum phNxpEseProto7816_ResetType {
   RESET_TYPE_NONE,
-  RESET_TYPE_RECOVERY
+  RESET_TYPE_RECOVERY,
+  RESET_TYPE_OS_RESET
 } phNxpEseProto7816_ResetType_t;
 
 /*!
@@ -503,6 +504,10 @@
  */
 #define PH_SE_OS_VERSION_21 0x21
 /*!
+ * \brief OS version on SE for SN300
+ */
+#define PH_SE_OS_VERSION_30 0x30
+/*!
  * \brief Default wait extension notification interval
  */
 #define PH_DEFAULT_WTX_NTF_LIMIT 0x03
diff --git a/snxxx/libese-spi/p73/lib/phNxpEse_Api.cpp b/snxxx/libese-spi/p73/lib/phNxpEse_Api.cpp
index 09d9df9..7c0e254 100644
--- a/snxxx/libese-spi/p73/lib/phNxpEse_Api.cpp
+++ b/snxxx/libese-spi/p73/lib/phNxpEse_Api.cpp
@@ -45,8 +45,6 @@
 static ESESTATUS phNxpEse_setJcopDwnldState(phNxpEse_JcopDwnldState state);
 static ESESTATUS phNxpEse_checkFWDwnldStatus(void);
 static void phNxpEse_GetMaxTimer(unsigned long* pMaxTimer);
-static unsigned char* phNxpEse_GgetTimerTlvBuffer(unsigned char* timer_buffer,
-                                                  unsigned int value);
 static __inline bool phNxpEse_isColdResetRequired(phNxpEse_initMode mode,
                                                   ESESTATUS status);
 static int poll_sof_chained_delay = 0;
@@ -481,205 +479,6 @@
 }
 
 /******************************************************************************
- * \ingroup spi_libese
- *
- * \brief  Check if libese has opened
- *
- * \retval return false if it is close, otherwise true.
- **
- ******************************************************************************/
-bool phNxpEse_isOpen() { return nxpese_ctxt.EseLibStatus != ESE_STATUS_CLOSE; }
-
-/******************************************************************************
- * Function         phNxpEse_openPrioSession
- *
- * Description      This function is called by Jni during the
- *                  initialization of the ESE. It opens the physical connection
- *                  with ESE () and creates required client thread for
- *                  operation.  This will get priority access to ESE for timeout
- duration.
-
- * Returns          This function return ESESTATUS_SUCCESS (0) in case of
- success
- *                  In case of failure returns other failure value.
- *
- ******************************************************************************/
-ESESTATUS phNxpEse_openPrioSession(phNxpEse_initParams initParams) {
-  phPalEse_Config_t tPalConfig;
-  ESESTATUS wConfigStatus = ESESTATUS_SUCCESS;
-  unsigned long int num = 0, tpm_enable = 0;
-
-  /* initialize trace level */
-  phNxpLog_InitializeLogLevel();
-  NXP_LOG_ESE_D("phNxpEse_openPrioSession Enter");
-#ifdef SPM_INTEGRATED
-  ESESTATUS wSpmStatus = ESESTATUS_SUCCESS;
-  spm_state_t current_spm_state = SPM_STATE_INVALID;
-#endif
-  phNxpEse_memset(&nxpese_ctxt, 0x00, sizeof(nxpese_ctxt));
-  phNxpEse_memset(&tPalConfig, 0x00, sizeof(tPalConfig));
-
-  NXP_LOG_ESE_D("MW SEAccessKit Version");
-  NXP_LOG_ESE_D("Android Version:0x%x", NXP_ANDROID_VER);
-  NXP_LOG_ESE_D("Major Version:0x%x", ESELIB_MW_VERSION_MAJ);
-  NXP_LOG_ESE_D("Minor Version:0x%x", ESELIB_MW_VERSION_MIN);
-
-#if (NXP_POWER_SCHEME_SUPPORT == true)
-  if (EseConfig::hasKey(NAME_NXP_POWER_SCHEME)) {
-    num = EseConfig::getUnsigned(NAME_NXP_POWER_SCHEME);
-    nxpese_ctxt.pwr_scheme = num;
-    NXP_LOG_ESE_D("Power scheme read from config file - %lu", num);
-  } else
-#endif
-  {
-    nxpese_ctxt.pwr_scheme = PN67T_POWER_SCHEME;
-    NXP_LOG_ESE_D("Power scheme not defined in config file - %lu", num);
-  }
-  if (EseConfig::hasKey(NAME_NXP_TP_MEASUREMENT)) {
-    tpm_enable = EseConfig::getUnsigned(NAME_NXP_TP_MEASUREMENT);
-    NXP_LOG_ESE_D(
-        "SPI Throughput measurement enable/disable read from config file - %lu",
-        tpm_enable);
-  } else {
-    NXP_LOG_ESE_D("SPI Throughput not defined in config file - %lu", num);
-  }
-
-  tPalConfig.pDevName = (int8_t*)"/dev/p73";
-
-  /* Initialize PAL layer */
-  wConfigStatus = phPalEse_open_and_configure(&tPalConfig);
-  if (wConfigStatus != ESESTATUS_SUCCESS) {
-    NXP_LOG_ESE_E("phPalEse_Init Failed");
-    goto clean_and_return;
-  }
-  /* Copying device handle to hal context*/
-  nxpese_ctxt.pDevHandle = tPalConfig.pDevHandle;
-
-#ifdef SPM_INTEGRATED
-  /* Get the Access of ESE*/
-  wSpmStatus = phNxpEse_SPM_Init(nxpese_ctxt.pDevHandle);
-  if (wSpmStatus != ESESTATUS_SUCCESS) {
-    NXP_LOG_ESE_E("phNxpEse_SPM_Init Failed");
-    wConfigStatus = ESESTATUS_FAILED;
-    goto clean_and_return_2;
-  }
-  wSpmStatus = phNxpEse_SPM_SetPwrScheme(nxpese_ctxt.pwr_scheme);
-  if (wSpmStatus != ESESTATUS_SUCCESS) {
-    NXP_LOG_ESE_E(" %s : phNxpEse_SPM_SetPwrScheme Failed", __FUNCTION__);
-    wConfigStatus = ESESTATUS_FAILED;
-    goto clean_and_return_1;
-  }
-  wSpmStatus = phNxpEse_SPM_GetState(&current_spm_state);
-  if (wSpmStatus != ESESTATUS_SUCCESS) {
-    NXP_LOG_ESE_E(" %s : phNxpEse_SPM_GetPwrState Failed", __FUNCTION__);
-    wConfigStatus = ESESTATUS_FAILED;
-    goto clean_and_return_1;
-  } else {
-    if ((current_spm_state & SPM_STATE_SPI) |
-        (current_spm_state & SPM_STATE_SPI_PRIO)) {
-      NXP_LOG_ESE_E(" %s : SPI is already opened...second instance not allowed",
-                    __FUNCTION__);
-      wConfigStatus = ESESTATUS_FAILED;
-      goto clean_and_return_1;
-    }
-    if (current_spm_state & SPM_STATE_JCOP_DWNLD) {
-      NXP_LOG_ESE_E(" %s : Denying to open JCOP Download in progress",
-                    __FUNCTION__);
-      wConfigStatus = ESESTATUS_FAILED;
-      goto clean_and_return_1;
-    }
-    if (GET_CHIP_OS_VERSION() == OS_VERSION_4_0) {
-      wConfigStatus = phNxpEse_checkFWDwnldStatus();
-      if (wConfigStatus != ESESTATUS_SUCCESS) {
-        NXP_LOG_ESE_D(
-            "Failed to open SPI due to VEN pin used by FW download \n");
-        wConfigStatus = ESESTATUS_FAILED;
-        goto clean_and_return_1;
-      }
-    }
-  }
-  phNxpEse_memcpy(&nxpese_ctxt.initParams, &initParams.initMode,
-                  sizeof(phNxpEse_initParams));
-  if (GET_CHIP_OS_VERSION() == OS_VERSION_4_0) {
-    /* Updating ESE power state based on the init mode */
-    if (ESE_MODE_OSU == nxpese_ctxt.initParams.initMode) {
-      wConfigStatus = phNxpEse_checkJcopDwnldState();
-      if (wConfigStatus != ESESTATUS_SUCCESS) {
-        NXP_LOG_ESE_E("phNxpEse_checkJcopDwnldState failed");
-        goto clean_and_return_1;
-      }
-    }
-  }
-  wSpmStatus = phNxpEse_SPM_ConfigPwr(SPM_POWER_PRIO_ENABLE);
-  if (wSpmStatus != ESESTATUS_SUCCESS) {
-    NXP_LOG_ESE_E("phNxpEse_SPM_ConfigPwr: enabling power for spi prio Failed");
-    if (wSpmStatus == ESESTATUS_BUSY) {
-      wConfigStatus = ESESTATUS_BUSY;
-    } else if (wSpmStatus == ESESTATUS_DWNLD_BUSY) {
-      wConfigStatus = ESESTATUS_DWNLD_BUSY;
-    } else {
-      wConfigStatus = ESESTATUS_FAILED;
-    }
-    goto clean_and_return;
-  } else {
-    NXP_LOG_ESE_E("nxpese_ctxt.spm_power_state true");
-    nxpese_ctxt.spm_power_state = true;
-  }
-#endif
-
-#ifndef SPM_INTEGRATED
-  wConfigStatus =
-      phPalEse_ioctl(phPalEse_e_ResetDevice, nxpese_ctxt.pDevHandle, 2);
-  if (wConfigStatus != ESESTATUS_SUCCESS) {
-    NXP_LOG_ESE_E("phPalEse_IoCtl Failed");
-    goto clean_and_return;
-  }
-#endif
-  wConfigStatus =
-      phPalEse_ioctl(phPalEse_e_EnableLog, nxpese_ctxt.pDevHandle, 0);
-  if (wConfigStatus != ESESTATUS_SUCCESS) {
-    NXP_LOG_ESE_E("phPalEse_IoCtl Failed");
-    goto clean_and_return;
-  }
-  wConfigStatus =
-      phPalEse_ioctl(phPalEse_e_EnablePollMode, nxpese_ctxt.pDevHandle, 1);
-  if (wConfigStatus != ESESTATUS_SUCCESS) {
-    NXP_LOG_ESE_E("phPalEse_IoCtl Failed");
-    goto clean_and_return;
-  }
-  NXP_LOG_ESE_D("wConfigStatus %x", wConfigStatus);
-  if (GET_CHIP_OS_VERSION() == OS_VERSION_4_0) {
-    if (tpm_enable) {
-      wConfigStatus = phPalEse_ioctl(phPalEse_e_EnableThroughputMeasurement,
-                                     nxpese_ctxt.pDevHandle, 0);
-      if (wConfigStatus != ESESTATUS_SUCCESS) {
-        NXP_LOG_ESE_E("phPalEse_IoCtl Failed");
-        goto clean_and_return;
-      }
-    }
-  }
-  return wConfigStatus;
-
-clean_and_return:
-#ifdef SPM_INTEGRATED
-  wSpmStatus = phNxpEse_SPM_ConfigPwr(SPM_POWER_DISABLE);
-  if (wSpmStatus != ESESTATUS_SUCCESS) {
-    NXP_LOG_ESE_E("phNxpEse_SPM_ConfigPwr: disabling power Failed");
-  }
-clean_and_return_1:
-  phNxpEse_SPM_DeInit();
-clean_and_return_2:
-#endif
-  if (NULL != nxpese_ctxt.pDevHandle) {
-    phPalEse_close(nxpese_ctxt.pDevHandle);
-    phNxpEse_memset(&nxpese_ctxt, 0x00, sizeof(nxpese_ctxt));
-  }
-  nxpese_ctxt.EseLibStatus = ESE_STATUS_CLOSE;
-  nxpese_ctxt.spm_power_state = false;
-  return ESESTATUS_FAILED;
-}
-
-/******************************************************************************
  * Function         phNxpEse_setJcopDwnldState
  *
  * Description      This function is  used to check whether JCOP OS
@@ -969,25 +768,6 @@
   NXP_LOG_ESE_D(" %s Exit \n", __FUNCTION__);
   return status;
 }
-/******************************************************************************
- * Function         phNxpEse_EndOfApdu
- *
- * Description      This function is used to send S-frame to indicate
- *END_OF_APDU
- *
- * Returns          It returns ESESTATUS_SUCCESS (0) if the operation is
- *successful else
- *                  ESESTATUS_FAILED(1)
- *
- ******************************************************************************/
-ESESTATUS phNxpEse_EndOfApdu(void) {
-  ESESTATUS status = ESESTATUS_SUCCESS;
-#if (NXP_ESE_END_OF_SESSION == true)
-  status = phNxpEseProto7816_Close(
-      (phNxpEseProto7816SecureTimer_t*)&nxpese_ctxt.secureTimerParams);
-#endif
-  return status;
-}
 
 /******************************************************************************
  * Function         phNxpEse_chipReset
@@ -1584,11 +1364,13 @@
   phNxpEse_memcpy(nxpese_ctxt.p_cmd_data, p_data, data_len);
   nxpese_ctxt.cmd_len = data_len;
 
-  // eSE requires around 200 usec to switch from tx to rx mode
-  // As per the observation, debug logs when enabled introduces around
-  // same amount of delay, therefore below explicit delay is required
-  // only if debug logs are disabled
-  if (ese_log_level < NXPESE_LOGLEVEL_DEBUG) phPalEse_BusyWait(200 /*usecs*/);
+  if (GET_CHIP_OS_VERSION() < OS_VERSION_8_9) {
+    // eSE requires around 200 usec to switch from tx to rx mode
+    // As per the observation, debug logs when enabled introduces around
+    // same amount of delay, therefore below explicit delay is required
+    // only if debug logs are disabled
+    if (ese_log_level < NXPESE_LOGLEVEL_DEBUG) phPalEse_BusyWait(200 /*usecs*/);
+  }
 
   dwNoBytesWrRd = phPalEse_write(nxpese_ctxt.pDevHandle, nxpese_ctxt.p_cmd_data,
                                  nxpese_ctxt.cmd_len);
@@ -1740,33 +1522,6 @@
 }
 
 /******************************************************************************
- * Function         phNxpEseP61_DisablePwrCntrl
- *
- * Description      This function disables eSE GPIO power off/on control
- *                  when enabled
- *
- * Returns         SUCCESS/FAIL.
- *
- ******************************************************************************/
-ESESTATUS phNxpEse_DisablePwrCntrl(void) {
-  ESESTATUS status = ESESTATUS_SUCCESS;
-  unsigned long maxTimer = 0;
-  NXP_LOG_ESE_E("%s Enter", __FUNCTION__);
-  phNxpEse_GetMaxTimer(&maxTimer);
-  if (GET_CHIP_OS_VERSION() == OS_VERSION_4_0) {
-    status = phNxpEse_SPM_DisablePwrControl(maxTimer);
-    if (status != ESESTATUS_SUCCESS) {
-      NXP_LOG_ESE_E("%s phNxpEseP61_DisablePwrCntrl: failed", __FUNCTION__);
-    }
-  } else {
-    NXP_LOG_ESE_E("%s phNxpEseP61_DisablePwrCntrl: not supported",
-                  __FUNCTION__);
-    status = ESESTATUS_FAILED;
-  }
-  return status;
-}
-
-/******************************************************************************
  * Function         phNxpEse_getOsVersion
  *
  * Description      This function returns OS version from config file &
@@ -1833,101 +1588,6 @@
 }
 
 /******************************************************************************
- * Function         phNxpEse_GetEseStatus(unsigned char *timer_buffer)
- *
- * Description      This function returns the all three timer
- * Timeout buffer length should be minimum 18 bytes. Response will be in below
- format:
- * <0xF1><Len><Timer Value><0xF2><Len><Timer Value><0xF3><Len><Timer Value>
- *
- * Returns         SUCCESS/FAIL.
- * ESESTATUS_SUCCESS if 0xF1 or 0xF2 tag timeout >= 0 & 0xF3 == 0
- * ESESTATUS_BUSY if 0xF3 tag timeout > 0
- * ESESTATUS_FAILED if any other error
-
- ******************************************************************************/
-ESESTATUS phNxpEse_GetEseStatus(phNxpEse_data* timer_buffer) {
-  ESESTATUS status = ESESTATUS_FAILED;
-
-  phNxpEse_SecureTimer_t secureTimerParams;
-  uint8_t* temp_timer_buffer = NULL;
-  NXP_LOG_ESE_D("%s Enter", __FUNCTION__);
-  if (GET_CHIP_OS_VERSION() != OS_VERSION_4_0) {
-    NXP_LOG_ESE_E("%s function not supported", __FUNCTION__);
-    return status;
-  }
-  if (timer_buffer != NULL) {
-    timer_buffer->len =
-        (sizeof(secureTimerParams.secureTimer1) +
-         sizeof(secureTimerParams.secureTimer2) +
-         sizeof(secureTimerParams.secureTimer3)) +
-        PH_PROPTO_7816_FRAME_LENGTH_OFFSET * PH_PROPTO_7816_FRAME_LENGTH_OFFSET;
-    temp_timer_buffer = (uint8_t*)phNxpEse_memalloc(timer_buffer->len);
-    timer_buffer->p_data = temp_timer_buffer;
-
-    phNxpEse_memcpy(&secureTimerParams, &nxpese_ctxt.secureTimerParams,
-                    sizeof(phNxpEse_SecureTimer_t));
-
-    NXP_LOG_ESE_D(
-        "%s secureTimer1 0x%x secureTimer2 0x%x secureTimer3 0x%x len = %d",
-        __FUNCTION__, secureTimerParams.secureTimer1,
-        secureTimerParams.secureTimer2, secureTimerParams.secureTimer3,
-        timer_buffer->len);
-
-    *temp_timer_buffer++ = PH_PROPTO_7816_SFRAME_TIMER1;
-    *temp_timer_buffer++ = sizeof(secureTimerParams.secureTimer1);
-    temp_timer_buffer = phNxpEse_GgetTimerTlvBuffer(
-        temp_timer_buffer, secureTimerParams.secureTimer1);
-    if (temp_timer_buffer != NULL) {
-      *temp_timer_buffer++ = PH_PROPTO_7816_SFRAME_TIMER2;
-      *temp_timer_buffer++ = sizeof(secureTimerParams.secureTimer2);
-      temp_timer_buffer = phNxpEse_GgetTimerTlvBuffer(
-          temp_timer_buffer, secureTimerParams.secureTimer2);
-      if (temp_timer_buffer != NULL) {
-        *temp_timer_buffer++ = PH_PROPTO_7816_SFRAME_TIMER3;
-        *temp_timer_buffer++ = sizeof(secureTimerParams.secureTimer3);
-        temp_timer_buffer = phNxpEse_GgetTimerTlvBuffer(
-            temp_timer_buffer, secureTimerParams.secureTimer3);
-        if (temp_timer_buffer != NULL) {
-          if (secureTimerParams.secureTimer3 > 0) {
-            status = ESESTATUS_BUSY;
-          } else {
-            status = ESESTATUS_SUCCESS;
-          }
-        }
-      }
-    }
-  } else {
-    NXP_LOG_ESE_E("%s Invalid timer buffer ", __FUNCTION__);
-  }
-
-  NXP_LOG_ESE_D("%s Exit status = 0x%x", __FUNCTION__, status);
-  return status;
-}
-
-static unsigned char* phNxpEse_GgetTimerTlvBuffer(uint8_t* timer_buffer,
-                                                  unsigned int value) {
-  short int count = 0, shift = 3;
-  unsigned int mask = 0x000000FF;
-  if (GET_CHIP_OS_VERSION() != OS_VERSION_4_0) {
-    NXP_LOG_ESE_E("%s function not supported", __FUNCTION__);
-  } else {
-    NXP_LOG_ESE_D("value = %x \n", value);
-    for (count = 0; count < 4; count++) {
-      if (timer_buffer != NULL) {
-        *timer_buffer = (value >> (shift * 8) & mask);
-        NXP_LOG_ESE_D("*timer_buffer=0x%x shift=0x%x", *timer_buffer, shift);
-        timer_buffer++;
-        shift--;
-      } else {
-        break;
-      }
-    }
-  }
-  return timer_buffer;
-}
-
-/******************************************************************************
  * Function         phNxpEse_NotifySEWtxRequest
  *
  * Description      This function notifies SE hal service if it registers
diff --git a/snxxx/libese-spi/p73/pal/NxpTimer.cpp b/snxxx/libese-spi/p73/pal/NxpTimer.cpp
index 17274e7..d3d9023 100644
--- a/snxxx/libese-spi/p73/pal/NxpTimer.cpp
+++ b/snxxx/libese-spi/p73/pal/NxpTimer.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022 NXP
+ * Copyright 2022-2023 NXP
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
 #include <unistd.h>
 
 NxpTimer::NxpTimer(std::string tag) {
-  logtag = tag;
+  logtag = std::move(tag);
   is_running = false;
   start_ts = end_ts = 0;
 }
diff --git a/snxxx/libese-spi/p73/pal/phNxpEsePal.cpp b/snxxx/libese-spi/p73/pal/phNxpEsePal.cpp
old mode 100755
new mode 100644
index 1cf8927..1ff56d0
--- a/snxxx/libese-spi/p73/pal/phNxpEsePal.cpp
+++ b/snxxx/libese-spi/p73/pal/phNxpEsePal.cpp
@@ -205,7 +205,7 @@
 **
 ** Description      This function  suspends execution of the calling thread for
 **                  total_time usecs(max extra delay 1 usecs) with busy wait.
-**                  Use this only for short delays (less than 500 microseconds)
+**                  Use this only for short delays (less than 500 microsecs)
 **
 ** Returns          None
 **
diff --git a/snxxx/libese-spi/p73/pal/spi/EseSpiTransport.cpp b/snxxx/libese-spi/p73/pal/spi/EseSpiTransport.cpp
index 08ddda1..fa29656 100644
--- a/snxxx/libese-spi/p73/pal/spi/EseSpiTransport.cpp
+++ b/snxxx/libese-spi/p73/pal/spi/EseSpiTransport.cpp
@@ -45,6 +45,7 @@
 
 #define MAX_RETRY_CNT 10
 #define HAL_NFC_SPI_DWP_SYNC 21
+#define USE_COLD_RESET 0x00
 
 extern int omapi_status;
 
@@ -76,6 +77,7 @@
   return;
 }
 
+#ifdef NXP_BOOTTIME_UPDATE
 /*******************************************************************************
 **
 ** Function         phNxpEse_spiIoctl
@@ -117,6 +119,8 @@
 #endif
   return status;
 }
+#endif
+
 #if (NFC_NXP_ESE_VER == JCOP_VER_4_0)
 /*******************************************************************************
 **
@@ -190,6 +194,15 @@
     mConfigColdResetIntf = 0x01; /* Default interface is NFC HAL */
     NXP_LOG_ESE_D("mConfigColdResetIntf: Default value ");
   }
+  /* Read eSE GPIO reset config */
+  if (EseConfig::hasKey(NAME_NXP_ESE_GPIO_RESET)) {
+    mConfigGpioReset = EseConfig::getUnsigned(NAME_NXP_ESE_GPIO_RESET);
+    NXP_LOG_ESE_D("mConfigGpioReset value from config file = %ld",
+                  mConfigGpioReset);
+  } else {
+    mConfigGpioReset = USE_COLD_RESET;
+    NXP_LOG_ESE_D("mConfigGpioReset: Default value ");
+  }
   NXP_LOG_ESE_D("Opening port=%s\n", pConfig->pDevName);
 /* open port */
 retry:
@@ -383,20 +396,26 @@
     case phPalEse_e_ChipRst:
       if (GET_CHIP_OS_VERSION() != OS_VERSION_4_0) {
         if (level == 5) {              // SPI driver communication part
-          if (!mConfigColdResetIntf) { /* Call the driver IOCTL */
-            retioctl =
-                ioctl((intptr_t)pDevHandle, ESE_PERFORM_COLD_RESET, level);
+          if (!mConfigColdResetIntf) { // Call the driver IOCTL
+            unsigned int cmd = ESE_PERFORM_COLD_RESET;
+            if ((mConfigGpioReset == 0x01) &&
+                ((GET_CHIP_OS_VERSION() == OS_VERSION_8_9))) {
+              cmd = P61_SET_PWR;
+            }
+            retioctl = ioctl((intptr_t)pDevHandle, cmd, level);
             if (0x00 <= retioctl) {
               ret = ESESTATUS_SUCCESS;
             }
           } else {
-#if (NFC_NXP_ESE_VER == JCOP_VER_5_x)
-            // Nfc Driver communication part
-            pNfcAdapt.Initialize();
-            ret = pNfcAdapt.resetEse(level);
-#else
-            ret = ESESTATUS_SUCCESS;
-#endif
+            if ((NFC_NXP_ESE_VER == JCOP_VER_5_x) &&
+                (GET_CHIP_OS_VERSION() != OS_VERSION_8_9)) {
+              // Nfc Driver communication part
+              pNfcAdapt.Initialize();
+              ret = pNfcAdapt.resetEse(level);
+            } else {
+              NXP_LOG_ESE_E("%s: Not supported", __func__);
+              ret = ESESTATUS_SUCCESS;
+            }
           }
         } else {
           ret = ESESTATUS_SUCCESS;
diff --git a/snxxx/libese-spi/p73/pal/spi/EseSpiTransport.h b/snxxx/libese-spi/p73/pal/spi/EseSpiTransport.h
index 2d252c2..4dc87ee 100644
--- a/snxxx/libese-spi/p73/pal/spi/EseSpiTransport.h
+++ b/snxxx/libese-spi/p73/pal/spi/EseSpiTransport.h
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2020 NXP
+ *  Copyright 2020, 2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -30,5 +30,5 @@
 
  private:
   unsigned long int mConfigSofWrite, mConfigSpiWriteTimeout,
-      mConfigColdResetIntf;
+      mConfigColdResetIntf, mConfigGpioReset;
 };
\ No newline at end of file
diff --git a/snxxx/libese-spi/p73/spm/phNxpEse_Spm.cpp b/snxxx/libese-spi/p73/spm/phNxpEse_Spm.cpp
old mode 100755
new mode 100644
index b2c5558..ec92bfd
--- a/snxxx/libese-spi/p73/spm/phNxpEse_Spm.cpp
+++ b/snxxx/libese-spi/p73/spm/phNxpEse_Spm.cpp
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2018-2019,2022 NXP
+ *  Copyright 2018-2019, 2022-2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -201,69 +201,6 @@
 }
 
 /******************************************************************************
- * Function         phNxpEse_SPM_EnablePwr
- *
- * Description      This function request to the nfc i2c driver
- *                  to enable power to ese. This api should be called before
- *                  sending any apdu to ese.
- *
- * Returns          On Success ESESTATUS_SUCCESS else proper error code
- *
- ******************************************************************************/
-ESESTATUS phNxpEse_SPM_EnablePwr(void) {
-  int32_t ret = -1;
-  ESESTATUS wSpmStatus = ESESTATUS_SUCCESS;
-  spm_state_t current_spm_state = SPM_STATE_INVALID;
-  NXP_LOG_ESE_D("%s : phNxpEse_SPM_EnablePwr is set to  = 0x%d", __FUNCTION__,
-                0);
-  ret = phPalEse_ioctl(phPalEse_e_ChipRst, pEseDeviceHandle, 0);
-  if (ret < 0) {
-    NXP_LOG_ESE_E("%s : failed errno = 0x%x", __FUNCTION__, errno);
-    if (errno == -EBUSY) {
-      wSpmStatus = phNxpEse_SPM_GetState(&current_spm_state);
-      if (wSpmStatus != ESESTATUS_SUCCESS) {
-        NXP_LOG_ESE_E(" %s : phNxpEse_SPM_GetPwrState Failed", __FUNCTION__);
-        return wSpmStatus;
-      } else {
-        if (current_spm_state == SPM_STATE_DWNLD) {
-          wSpmStatus = ESESTATUS_DWNLD_BUSY;
-        } else {
-          wSpmStatus = ESESTATUS_BUSY;
-        }
-      }
-
-    } else {
-      wSpmStatus = ESESTATUS_FAILED;
-    }
-  }
-
-  return wSpmStatus;
-}
-
-/******************************************************************************
- * Function         phNxpEse_SPM_DisablePwr
- *
- * Description      This function request to the nfc i2c driver
- *                  to disable power to ese. This api should be called
- *                  once apdu exchange is done.
- *
- * Returns          On Success ESESTATUS_SUCCESS else proper error code
- *
- ******************************************************************************/
-ESESTATUS phNxpEse_SPM_DisablePwr(void) {
-  int32_t ret = -1;
-  ESESTATUS status = ESESTATUS_SUCCESS;
-  NXP_LOG_ESE_D("%s : phNxpEse_SPM_DisablePwr is set to  = 0x%d", __FUNCTION__,
-                1);
-  ret = phPalEse_ioctl(phPalEse_e_ChipRst, pEseDeviceHandle, 1);
-  if (ret < 0) {
-    NXP_LOG_ESE_E("%s : failed errno = 0x%x", __FUNCTION__, errno);
-    status = ESESTATUS_FAILED;
-  }
-
-  return status;
-}
-/******************************************************************************
  * Function         phNxpEse_SPM_SetPwrScheme
  *
  * Description      This function request to the nfc i2c driver
@@ -385,73 +322,6 @@
   return status;
 }
 
-/******************************************************************************
- * Function         phNxpEse_SPM_ResetPwr
- *
- * Description      This function request to the nfc i2c driver
- *                  to reset ese.
- *
- * Returns          On Success ESESTATUS_SUCCESS else proper error code
- *
- ******************************************************************************/
-ESESTATUS phNxpEse_SPM_ResetPwr(void) {
-  int32_t ret = -1;
-  ESESTATUS wSpmStatus = ESESTATUS_SUCCESS;
-  spm_state_t current_spm_state = SPM_STATE_INVALID;
-
-  /* reset the ese */
-  ret = phPalEse_ioctl(phPalEse_e_ChipRst, pEseDeviceHandle, 2);
-  if (ret < 0) {
-    NXP_LOG_ESE_E("%s : failed errno = 0x%x", __FUNCTION__, errno);
-    if (errno == -EBUSY || errno == EBUSY) {
-      wSpmStatus = phNxpEse_SPM_GetState(&current_spm_state);
-      if (wSpmStatus != ESESTATUS_SUCCESS) {
-        NXP_LOG_ESE_E(" %s : phNxpEse_SPM_GetPwrState Failed", __FUNCTION__);
-        return wSpmStatus;
-      } else {
-        if (current_spm_state == SPM_STATE_DWNLD) {
-          wSpmStatus = ESESTATUS_DWNLD_BUSY;
-        } else {
-          wSpmStatus = ESESTATUS_BUSY;
-        }
-      }
-
-    } else {
-      wSpmStatus = ESESTATUS_FAILED;
-    }
-  }
-
-  return wSpmStatus;
-}
-
-/*******************************************************************************
-**
-** Function         phTmlEse_get_ese_access
-**
-** Description
-**
-** Parameters       timeout - timeout to wait for ese access
-**
-** Returns          success or failure
-**
-*******************************************************************************/
-ESESTATUS phNxpEse_SPM_GetAccess(long timeout) {
-  ESESTATUS status = ESESTATUS_SUCCESS;
-  NXP_LOG_ESE_D("phTmlEse_get_ese_access(), timeout  %ld", timeout);
-#if ((NFC_NXP_ESE_VER == JCOP_VER_3_1) || (NFC_NXP_ESE_VER == JCOP_VER_3_2))
-  int ret = -1;
-
-  ret = phPalEse_ioctl(phPalEse_e_GetEseAccess, pEseDeviceHandle, timeout);
-  if (ret < 0) {
-    if (ret == -EBUSY)
-      status = ESESTATUS_BUSY;
-    else
-      status = ESESTATUS_FAILED;
-  }
-  NXP_LOG_ESE_D("phTmlEse_get_ese_access(), exit  %d", status);
-#endif
-  return status;
-}
 /*******************************************************************************
 **
 ** Function         phNxpEse_SPM_RelAccess
diff --git a/snxxx/libese-spi/p73/spm/phNxpEse_Spm.h b/snxxx/libese-spi/p73/spm/phNxpEse_Spm.h
index a65d991..1fb15ed 100644
--- a/snxxx/libese-spi/p73/spm/phNxpEse_Spm.h
+++ b/snxxx/libese-spi/p73/spm/phNxpEse_Spm.h
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2018-2019 NXP
+ *  Copyright 2018-2019, 2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -83,28 +83,6 @@
 
 /**
  * \ingroup SPI_Power_Management
- * \brief This function request to the nfc i2c driver
- *                  to enable power to ese. This api should be called before
- *                  sending any apdu to ese.
- *
- *
- * \retval       -On Success ESESTATUS_SUCCESS else proper error code
- */
-ESESTATUS phNxpEse_SPM_EnablePwr(void);
-
-/**
- * \ingroup SPI_Power_Management
- * \brief This function request to the nfc i2c driver
- *                  to disable power to ese. This api should be called
- *                  once apdu exchange is done.
- *
- *
- * \retval       -On Success ESESTATUS_SUCCESS else proper error code
- */
-ESESTATUS phNxpEse_SPM_DisablePwr(void);
-
-/**
- * \ingroup SPI_Power_Management
  * \brief This function gets the current power state of ESE
  * \param[in]    current_state       -input is of type spm_state_t.
  *
@@ -114,25 +92,6 @@
 
 /**
  * \ingroup SPI_Power_Management
- * \brief  This function request to the nfc i2c driver
- *                  to reset ese.
- *
- * \retval       -On Success ESESTATUS_SUCCESS else proper error code
- */
-ESESTATUS phNxpEse_SPM_ResetPwr(void);
-
-/**
- * \ingroup SPI_Power_Management
- * \brief  This function request to get access to eSE
- *
- * \param[in]    timeout - timeout to wait for ese access.
- *
- * \retval       -On Success ESESTATUS_SUCCESS else proper error code
- */
-ESESTATUS phNxpEse_SPM_GetAccess(long timeout);
-
-/**
- * \ingroup SPI_Power_Management
  * \brief  This function set the SPM power state
  *
  * \param[in]    arg - state value.
diff --git a/snxxx/libese-spi/p73/utils/config.cpp b/snxxx/libese-spi/p73/utils/config.cpp
index a470af8..79dc73a 100644
--- a/snxxx/libese-spi/p73/utils/config.cpp
+++ b/snxxx/libese-spi/p73/utils/config.cpp
@@ -15,9 +15,9 @@
  */
 /******************************************************************************
  *
- *  The original Work has been changed by NXP Semiconductors.
+ *  The original Work has been changed by NXP.
  *
- *  Copyright (C) 2019 NXP Semiconductors
+ *  Copyright 2019,2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -156,9 +156,3 @@
 unsigned ConfigFile::getUnsigned(const std::string& key) {
   return getValue(key).getUnsigned();
 }
-
-std::vector<uint8_t> ConfigFile::getBytes(const std::string& key) {
-  return getValue(key).getBytes();
-}
-
-void ConfigFile::clear() { values_.clear(); }
diff --git a/snxxx/libese-spi/p73/utils/config.h b/snxxx/libese-spi/p73/utils/config.h
index 115c7fa..7b37442 100644
--- a/snxxx/libese-spi/p73/utils/config.h
+++ b/snxxx/libese-spi/p73/utils/config.h
@@ -15,9 +15,9 @@
  */
 /******************************************************************************
  *
- *  The original Work has been changed by NXP Semiconductors.
+ *  The original Work has been changed by NXP.
  *
- *  Copyright (C) 2019 NXP Semiconductors
+ *  Copyright 2019,2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -65,9 +65,6 @@
   bool hasKey(const std::string& key);
   std::string getString(const std::string& key);
   unsigned getUnsigned(const std::string& key);
-  std::vector<uint8_t> getBytes(const std::string& key);
-
-  void clear();
 
  private:
   ConfigValue& getValue(const std::string& key);
diff --git a/snxxx/libese-spi/p73/utils/ese_config.cpp b/snxxx/libese-spi/p73/utils/ese_config.cpp
index 4a6b2cc..e90db57 100644
--- a/snxxx/libese-spi/p73/utils/ese_config.cpp
+++ b/snxxx/libese-spi/p73/utils/ese_config.cpp
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2018 NXP
+ *  Copyright 2018,2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -79,9 +79,3 @@
   if (hasKey(key)) return getUnsigned(key);
   return default_value;
 }
-
-std::vector<uint8_t> EseConfig::getBytes(const std::string& key) {
-  return getInstance().config_.getBytes(key);
-}
-
-void EseConfig::clear() { getInstance().config_.clear(); }
diff --git a/snxxx/libese-spi/p73/utils/ese_config.h b/snxxx/libese-spi/p73/utils/ese_config.h
old mode 100755
new mode 100644
index d5da308..e3d5c77
--- a/snxxx/libese-spi/p73/utils/ese_config.h
+++ b/snxxx/libese-spi/p73/utils/ese_config.h
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2018-2020,2022 NXP
+ *  Copyright 2018-2020,2022-2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -41,10 +41,10 @@
 #define NAME_NXP_VISO_DPD_ENABLED "NXP_VISO_DPD_ENABLED"
 #define NAME_NXP_NAD_POLL_RETRY_TIME "NXP_NAD_POLL_RETRY_TIME"
 #define NAME_RNACK_RETRY_DELAY "RNACK_RETRY_DELAY"
-#define NAME_NXP_P61_JCOP_DEFAULT_INTERFACE "NXP_P61_JCOP_DEFAULT_INTERFACE"
 #define NAME_NXP_ESE_IFSD_VALUE "NXP_ESE_IFSD_VALUE"
 #define NAME_NXP_EUICC_IFSD_VALUE "NXP_EUICC_IFSD_VALUE"
 #define NAME_NXP_P61_COLD_RESET_INTERFACE "NXP_P61_COLD_RESET_INTERFACE"
+#define NAME_NXP_ESE_GPIO_RESET "NXP_ESE_GPIO_RESET"
 #define NAME_NXP_OS_VERSION "NXP_OS_VERSION"
 #define NAME_NXP_WTX_NTF_COUNT "NXP_WTX_NTF_COUNT"
 #define NAME_NXP_OSU_MAX_WTX_COUNT "NXP_OSU_MAX_WTX_COUNT"
@@ -60,8 +60,6 @@
                                std::string default_value);
   static unsigned getUnsigned(const std::string& key);
   static unsigned getUnsigned(const std::string& key, unsigned default_value);
-  static std::vector<uint8_t> getBytes(const std::string& key);
-  static void clear();
 
  private:
   static EseConfig& getInstance();
diff --git a/snxxx/libese-spi/src/adaptation/NfcAdaptation.cpp b/snxxx/libese-spi/src/adaptation/NfcAdaptation.cpp
index 474fa10..241ffd6 100644
--- a/snxxx/libese-spi/src/adaptation/NfcAdaptation.cpp
+++ b/snxxx/libese-spi/src/adaptation/NfcAdaptation.cpp
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2018-2020,2022 NXP
+ *  Copyright 2018-2020,2022-2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -232,6 +232,7 @@
   return result;
 }
 
+#ifdef NXP_BOOTTIME_UPDATE
 /*******************************************************************************
 **
 ** Function:    NfcAdaptation::setEseUpdateState
@@ -270,7 +271,7 @@
 
   return result;
 }
-
+#endif
 /*******************************************************************************
 **
 ** Function:    ThreadCondVar::ThreadCondVar()
diff --git a/snxxx/libese-spi/src/include/NfcAdaptation.h b/snxxx/libese-spi/src/include/NfcAdaptation.h
index a87fa98..e5a49b9 100644
--- a/snxxx/libese-spi/src/include/NfcAdaptation.h
+++ b/snxxx/libese-spi/src/include/NfcAdaptation.h
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- *  Copyright 2020,2022 NXP
+ *  Copyright 2020,2022-2023 NXP
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -69,10 +69,12 @@
 class NfcAdaptation {
  public:
   virtual ~NfcAdaptation();
-  void Initialize();
   static NfcAdaptation& GetInstance();
   static ESESTATUS resetEse(uint64_t level);
+  void Initialize();
+#ifdef NXP_BOOTTIME_UPDATE
   static ESESTATUS setEseUpdateState(void* p_data);
+#endif
   ese_nxp_IoctlInOutData_t* mCurrentIoctlData;
 
  private: