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 20b71b4 commit 7ec5ad6
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 @@ -94,7 +94,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 @@ -105,7 +105,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 @@ -649,8 +649,10 @@ static int lib_manager_store_library(struct lib_manager_dma_ext *dma_ext,
#if CONFIG_LIBRARY_AUTH_SUPPORT
ret = lib_manager_auth_proc(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 @@ -668,8 +670,10 @@ static int lib_manager_store_library(struct lib_manager_dma_ext *dma_ext,
#if CONFIG_LIBRARY_AUTH_SUPPORT
ret = lib_manager_auth_proc((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 7ec5ad6

Please sign in to comment.