]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/sa-lld.git/blobdiff - salld.h
drv: sa: Add USE_DKEK flag support
[keystone-rtos/sa-lld.git] / salld.h
diff --git a/salld.h b/salld.h
index 2930d5f9d9d758cdc9bd04924476849796b22781..ffe9022676c75e358d96fe14649a29ca932c9547 100644 (file)
--- a/salld.h
+++ b/salld.h
@@ -427,6 +427,12 @@ typedef int Sa_State_t;
  */
 #define sa_ERR_PKA_DOWNLOAD_FAIL        -30
 
+/**
+ *  @def  sa_ERR_ENGINE_STATE
+ *        The SA2UL engines are in an unexpected state
+ */
+#define sa_ERR_ENGINE_STATE             -31
+
 /**
  *  @def  sa_PKA_OP_IN_PROGRESS
  *        The current PKA operation is still in progress.
@@ -885,6 +891,19 @@ typedef struct {
  */
 #define sa_DM_CONFIG_USE_SECURE_CTX_FOR_NON_SECURE_CHANNEL  ((uint16_t) (0x0008U))
 
+/**
+ *  @def  sa_DM_CONFIG_USE_DKEK
+ *        Control Info -- 1: Set the USE_DKEK flag in the security context so
+ *                           that DKEK programmed by DMSC is loaded in-band
+ *                           instead of user-supplied key
+ *                        0: Do not set USE_DKEK flag. User supplies a key
+ *                           directly.
+ *
+ *  For devices that do not have SA2UL setting this bit would cause no action
+ *
+ */
+#define sa_DM_CONFIG_USE_DKEK  ((uint16_t) (0x0010U))
+
 
 /*@}*/
 /** @} */
@@ -1317,6 +1336,11 @@ typedef struct {
  *        Control Info -- Set: SALT available
  */
 #define sa_DATA_MODE_KEY_CTRL_SALT             0x0004 
+/**
+ *  @def  sa_DATA_MODE_KEY_USE_DKEK
+ *        Control Info -- Set: USE_DKEK field in security context
+ */
+#define sa_DATA_MODE_KEY_USE_DKEK              0x0008
 /*@}*/
 /** @} */
 
@@ -1523,7 +1547,7 @@ typedef struct {
  *  @ingroup salld_api_macros
  *  @brief  sa_SWINFO_UPDATE_DEST_INFO is used to update the destination information within swInfo[2] at @ref Sa_SWInfo_t
  *
- *  @note   this macro is not applicable for socs such as AM65XX that have second generation SA Ultra Lite (SA2_UL)
+ *  @note   this macro is not applicable for socs such as AM65XX or J721E that have second generation SA Ultra Lite (SA2_UL)
  *
  *  @details  The application may want to deliver output packets to different queues for load balance.
  *            This macro is used to update the destination queue and CPPI flow number in the Sa_SWInfo_t data structure 
@@ -2309,6 +2333,28 @@ typedef void* Sa_Handle;
 
 #define  sa_CONFIG_CTRL_BITMAP_SET_SCPTR_RANGE                0x0004
 
+/**
+ *  @def  sa_CONFIG_CTRL_BITMAP_LIMIT_ACCESS
+ *        Control Info -- 0: All SA2UL registers may be accessed
+ *                        1: Limit access to SA2UL registers which are reserved
+ *                           for use by DMSC firmware
+ *
+ *  @note This control bit is applicable to SA2UL only (for other generations it is don't care).
+ *        It is furthermore only necessary on High Secure (HS) device variants
+ *        when an application wishes to share access to the SA2UL instance which
+ *        is owned by DMSC firmware. DMSC prohibits read/write access to MMRA
+ *        region on this instance, so this bit has the following effect:
+ *
+ *        * Bypasses programming ENGINE_ENABLE register. DMSC sets all engines
+ *          to enabled at device boot. The driver can confirm engine status
+ *          through the ENGINE_STATUS register.
+ *
+ *        * Ignores the SET_SCPTR_RANGE control flag and bypasses any attempt to
+ *          access the SCPTR promote registers
+ */
+
+#define  sa_CONFIG_CTRL_BITMAP_LIMIT_ACCESS                   0x0008
+
 
 
 /*@}*/
@@ -2502,7 +2548,7 @@ typedef struct {
   void              *instPoolBaseAddr; /**< Base address of the global shared memory pool from which global 
                                             LLD instance & channel instance memory is allocated.*/ 
   void              *scPoolBaseAddr;   /**< Base address of the global shared memory pool from which SA
-                                             security context memory is allocated. This is a DMA\92able memory */
+                                             security context memory is allocated. This is a DMA-able memory */
   Sa_ScPtrRangeCfg_t scPtrRange;      /**< Security Context Buffer Range low and high address configuration */
   uint32_t           ctrlBitMap;      /**< Various configuration information as specified at @ref saConfigCtrlBit */                                                
 } Sa_Config_t;
@@ -4747,7 +4793,7 @@ static inline void sa_PSINFO_SET_IV(Sa_psInfo_t *x, uint32_t *iv, int ivSize)
  * 
  * In addition to the first-level check that the context fetch must pass is to satisfy
  * the external firewall module's check at the soc level configured by DMSC, the second-level check 
- * that SA2_UL does is to compare the incoming packet\92s security attributes 
+ * that SA2_UL does is to compare the incoming packet\92s security attributes 
  * against the attributes that are stored as part of the SCCTL inside the security context.
  * The following table summarizes the evaluation that will occur before a context is used for the packet
  * processing. The rightmost column shows the possible change in 'secure' attribute of the packet