1
0
Fork 0
mirror of https://github.com/u-boot/u-boot.git synced 2025-04-22 20:58:22 +00:00

imx: imx8ulp: start the ELE RNG at boot

On the imx8ulp A1 SoC, the ELE RNG needs to be manually started.

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
Peng Fan 2023-06-15 18:09:14 +08:00 committed by Stefano Babic
parent 78b4cf7530
commit 1c3f5df259
3 changed files with 36 additions and 0 deletions
arch/arm/include/asm/mach-imx
board/freescale/imx8ulp_evk
drivers/misc/imx_ele

View file

@ -149,4 +149,5 @@ int ele_get_fw_status(u32 *status, u32 *response);
int ele_release_m33_trout(void);
int ele_write_secure_fuse(ulong signed_msg_blk, u32 *response);
int ele_return_lifecycle_update(ulong signed_msg_blk, u32 *response);
int ele_start_rng(void);
#endif

View file

@ -123,6 +123,16 @@ void spl_board_init(void)
ret = ele_release_caam(0x7, &res);
if (ret)
printf("ele release caam failed %d, 0x%x\n", ret, res);
/*
* RNG start only available on the A1 soc revision.
* Check some JTAG register for the SoC revision.
*/
if (!is_soc_rev(CHIP_REV_1_0)) {
ret = ele_start_rng();
if (ret)
printf("Fail to start RNG: %d\n", ret);
}
}
void board_init_f(ulong dummy)

View file

@ -503,6 +503,31 @@ int ele_get_events(u32 *events, u32 *events_cnt, u32 *response)
return ret;
}
int ele_start_rng(void)
{
struct udevice *dev = gd->arch.ele_dev;
int size = sizeof(struct ele_msg);
struct ele_msg msg;
int ret;
if (!dev) {
printf("ele dev is not initialized\n");
return -ENODEV;
}
msg.version = ELE_VERSION;
msg.tag = ELE_CMD_TAG;
msg.size = 1;
msg.command = ELE_START_RNG;
ret = misc_call(dev, false, &msg, size, &msg, size);
if (ret)
printf("Error: %s: ret %d, response 0x%x\n",
__func__, ret, msg.data[0]);
return ret;
}
int ele_write_secure_fuse(ulong signed_msg_blk, u32 *response)
{
struct udevice *dev = gd->arch.ele_dev;