Skip to content

Commit 633f39c

Browse files
stgloorioustpambor
authored andcommitted
platform: stm: fix bl2 without hardware accelerator
Add #ifdef to make sure crypto_hw_accelerator* functions are not called if CRYPTO_HW_ACCELERATOR is disabled. Change-Id: I76ee3ca377caea1d3ad663c86bd3d5d187c2995d Signed-off-by: Stefan Gloor <[email protected]> (cherry picked from commit cc180f1d00a3ec755c922d6addd338dfd46aa7ca) Signed-off-by: Tim Pambor <[email protected]>
1 parent 3e12b0c commit 633f39c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

platform/ext/target/stm/common/stm32h5xx/bl2/boot_hal_bl2.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,9 @@ void boot_platform_start_next_image(struct boot_arm_vector_table *vector)
384384
#ifdef BL2_DATA
385385
TFM_BL2_CopySharedData();
386386
#endif
387+
#ifdef CRYPTO_HW_ACCELERATOR
387388
(void)crypto_hw_accelerator_finish();
388-
389+
#endif
389390

390391
RNG_DeInit();
391392

@@ -596,10 +597,12 @@ int32_t boot_platform_init(void)
596597
BOOT_LOG_ERR("Error while initializing RNG Ip");
597598
Error_Handler();
598599
}
600+
#ifdef CRYPTO_HW_ACCELERATOR
599601
if (crypto_hw_accelerator_init()){
600602
BOOT_LOG_ERR("Error while initializing HW accelerator Ip");
601603
Error_Handler();
602604
}
605+
#endif
603606
/* Start HW randomization */
604607
fih_delay_init();
605608
/* Apply Run time Protection */

platform/ext/target/stm/common/stm32u5xx/bl2/boot_hal_bl2.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,9 @@ void boot_platform_start_next_image(struct boot_arm_vector_table *vector)
400400
#ifdef BL2_DATA
401401
TFM_BL2_CopySharedData();
402402
#endif
403+
#ifdef CRYPTO_HW_ACCELERATOR
403404
(void)crypto_hw_accelerator_finish();
404-
405+
#endif
405406

406407
RNG_DeInit();
407408

@@ -612,10 +613,12 @@ int32_t boot_platform_init(void)
612613
BOOT_LOG_ERR("Error while initializing RNG Ip");
613614
Error_Handler();
614615
}
616+
#ifdef CRYPTO_HW_ACCELERATOR
615617
if (crypto_hw_accelerator_init()){
616618
BOOT_LOG_ERR("Error while initializing HW accelerator Ip");
617619
Error_Handler();
618620
}
621+
#endif
619622
/* Start HW randomization */
620623
fih_delay_init();
621624
/* Apply Run time Protection */

0 commit comments

Comments
 (0)