diff options
| author | Peng Fan <[email protected]> | 2023-06-15 18:09:14 +0800 |
|---|---|---|
| committer | Stefano Babic <[email protected]> | 2023-07-13 11:29:40 +0200 |
| commit | 1c3f5df2597b80d4dac635152fc5dd1a9c4150b9 (patch) | |
| tree | 7dce6c7cc60f37d6416b814a68fd467af161b949 /drivers | |
| parent | 78b4cf75307f4704881b7b7501721f27f2691f9f (diff) | |
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 <[email protected]>
Signed-off-by: Peng Fan <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/misc/imx_ele/ele_api.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/misc/imx_ele/ele_api.c b/drivers/misc/imx_ele/ele_api.c index 8a14cf6aa92..0c017734a49 100644 --- a/drivers/misc/imx_ele/ele_api.c +++ b/drivers/misc/imx_ele/ele_api.c @@ -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; |
