From 6dd948323de0f31b413c9f19a905f1c145c9c456 Mon Sep 17 00:00:00 2001 From: Rob von Behren Date: Fri, 16 Sep 2011 15:05:25 -0700 Subject: Manual port of 6900b4 from gingerbread: Patch to add Secure Download Mechanism in the libnfc This patch permit to support secure download update and also to avoid locking states in case of download failures Bug: 5331837 Change-Id: Ia5b6d9baf57231b0193bbbe85c88c7df557017c6 --- inc/phNfcConfig.h | 9 ++++++++- inc/phNfcHalTypes.h | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/phNfcConfig.h b/inc/phNfcConfig.h index e7386d9..bcefaec 100644 --- a/inc/phNfcConfig.h +++ b/inc/phNfcConfig.h @@ -375,11 +375,15 @@ /**< Macro to Enable the Card Emulation Feature */ /* #define HOST_EMULATION */ +#define NXP_HAL_VERIFY_EEPROM_CRC 0x01U + /**< Macro to Enable the Download Mode Feature */ #define FW_DOWNLOAD /**< Macro to Enable the Firmware Download Timer */ -#define FW_DOWNLOAD_TIMER +/* 0x01U to use overall timeout */ +/* 0x02U to use per frame timeout */ +#define FW_DOWNLOAD_TIMER 0x02U /**< Macro to Verify the Firmware Download */ /* #define FW_DOWNLOAD_VERIFY */ @@ -388,6 +392,9 @@ #define NXP_FW_INTEGRITY_CHK 1 #endif +/* To specify the Maximum TX/RX Len */ +#define NXP_FW_MAX_TX_RX_LEN 0x200 + #define UICC_CONNECTIVITY_PATCH /* Work around to Delay the initiator activation */ diff --git a/inc/phNfcHalTypes.h b/inc/phNfcHalTypes.h index a242450..522df6d 100644 --- a/inc/phNfcHalTypes.h +++ b/inc/phNfcHalTypes.h @@ -47,6 +47,26 @@ #include #include +#ifndef NXP_HAL_MEM_INFO_SIZE +#define NXP_HAL_MEM_INFO_SIZE 0x01U +#endif + +#if (NXP_HAL_MEM_INFO_SIZE > 0x01) +#define NXP_FW_UPLOAD_PROGRESS 0x965AU +#define NXP_FW_UPLOAD_SUCCESS 0x0000U +#else +#define NXP_FW_UPLOAD_PROGRESS 0x5AU +#define NXP_FW_UPLOAD_SUCCESS 0x00U +#endif + + +typedef struct phHal_sMemInfo +{ + uint16_t fw_magic; + uint16_t fw_rfu; + uint32_t hal_version; +}phHal_sMemInfo_t; + /** \ingroup grp_hal_common * @@ -836,6 +856,7 @@ typedef enum phHal_Event { NFC_INFO_TXLDO_OVERCUR = 0x71U, NFC_INFO_MEM_VIOLATION = 0x73U, NFC_INFO_TEMP_OVERHEAT = 0x74U, + NFC_INFO_LLC_ERROR = 0x75U, /* NXP EVENTS */ NFC_EVT_MIFARE_ACCESS = 0x35, -- cgit v1.1