Skip to content

Commit

Permalink
drivers: entropy_cc310: Initialize at PRE_KERNEL_1
Browse files Browse the repository at this point in the history
This is a follow-up to commit 9e2ac5b.

Initialize the driver at the PRE_KERNEL_1 level, like Zephyr in-tree
entropy drivers, so that other modules that need an entropy driver can
initialize at PRE_KERNEL_2 (see e.g. rand32_xoroshiro128).

Ref: NCSIDB-420

Signed-off-by: Andrzej Głąbek <[email protected]>
  • Loading branch information
anangl committed Mar 29, 2021
1 parent 64d7da4 commit 9eb95f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/entropy/entropy_cc310.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,5 @@ static const struct entropy_driver_api entropy_cc3xx_rng_api = {
#endif

DEVICE_DT_DEFINE(CRYPTOCELL_NODE_ID, entropy_cc3xx_rng_init,
device_pm_control_nop, NULL, NULL, PRE_KERNEL_2,
device_pm_control_nop, NULL, NULL, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &entropy_cc3xx_rng_api);
2 changes: 1 addition & 1 deletion drivers/hw_cc310/hw_cc310.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static int hw_cc3xx_init(const struct device *dev)
}

/* Driver initalization done when mutex is not usable (pre kernel) */
SYS_INIT(hw_cc3xx_init_internal, PRE_KERNEL_2,
SYS_INIT(hw_cc3xx_init_internal, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

/* Driver initialization when mutex is usable (post kernel) */
Expand Down

0 comments on commit 9eb95f0

Please sign in to comment.