Skip to content

Commit

Permalink
lnl: conf: Enable library authentication on LNL
Browse files Browse the repository at this point in the history
This enables library authentication on LNL platforms.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
  • Loading branch information
jxstelter committed Jan 17, 2024
1 parent b20267f commit a0e476d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/boards/intel_adsp_ace20_lnl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ CONFIG_DMA=y
CONFIG_DMA_INTEL_ADSP_GPDMA=n
CONFIG_INTEL_MODULES=y
CONFIG_LIBRARY_MANAGER=y
CONFIG_LIBRARY_AUTH_SUPPORT=y
CONFIG_INTEL_ADSP_TIMER=y
CONFIG_MM_DRV_INTEL_ADSP_TLB_REMAP_UNUSED_RAM=y
CONFIG_AMS=y
Expand Down
12 changes: 8 additions & 4 deletions src/library_manager/lib_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ static int lib_manager_auth_proc(const void *buffer_data,

if (ret != 0) {
tr_err(&lib_manager_tr, "lib_manager_auth_proc() failed with error: %d", ret);
return -EACCES;
return -ENOTSUP;
}

/* The auth_api_busy() will timeouts internally in case of failure */
Expand All @@ -108,7 +108,7 @@ static int lib_manager_auth_proc(const void *buffer_data,

if (ret != AUTH_IMAGE_TRUSTED) {
tr_err(&lib_manager_tr, "lib_manager_auth_proc() Untrasted library!");
return -ENOTSUP;
return -EACCES;
}

if (phase == AUTH_PHASE_LAST)
Expand Down Expand Up @@ -653,8 +653,10 @@ static int lib_manager_store_library(struct lib_manager_dma_ext *dma_ext,
/* AUTH_PHASE_FIRST - checks library manifest only. */
ret = lib_manager_auth_proc((__sparse_force void *)man_buffer,
MAN_MAX_SIZE_V1_8, AUTH_PHASE_FIRST);
if (ret < 0)
if (ret < 0) {
rfree((__sparse_force void *)library_base_address);
return ret;
}
#endif /* CONFIG_LIBRARY_AUTH_SUPPORT */

/* Copy data from temp_mft_buf to destination memory (pointed by library_base_address) */
Expand All @@ -673,8 +675,10 @@ static int lib_manager_store_library(struct lib_manager_dma_ext *dma_ext,
/* AUTH_PHASE_LAST - do final library authentication checks */
ret = lib_manager_auth_proc((__sparse_force void *)library_base_address,
preload_size - MAN_MAX_SIZE_V1_8, AUTH_PHASE_LAST);
if (ret < 0)
if (ret < 0) {
rfree((__sparse_force void *)library_base_address);
return ret;
}
#endif /* CONFIG_LIBRARY_AUTH_SUPPORT */

/* Now update sof context with new library */
Expand Down

0 comments on commit a0e476d

Please sign in to comment.