blob: bf39c5472ea9649ed286c86a3ff777da1f677370 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +05302/*
3 * (C) Copyright 2018 Xilinx, Inc.
Michal Simeka8c94362023-07-10 14:35:49 +02004 * Siva Durga Prasad Paladugu <siva.durga.prasad.paladugu@amd.com>>
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +05305 */
6
Simon Glassed38aef2020-05-10 11:40:03 -06007#include <command.h>
Simon Glass1d91ba72019-11-14 12:57:37 -07008#include <cpu_func.h>
Simon Glass313112a2019-08-01 09:46:46 -06009#include <env.h>
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +053010#include <malloc.h>
Siva Durga Prasad Paladugu8b75ad62018-09-06 16:34:44 +053011#include <memalign.h>
Tom Rinidec7ea02024-05-20 13:35:03 -060012#include <vsprintf.h>
Ibai Erkiagac8a3efa2019-09-27 11:37:01 +010013#include <zynqmp_firmware.h>
Tom Rinidec7ea02024-05-20 13:35:03 -060014#include <linux/errno.h>
Siva Durga Prasad Paladugu48eaa0c2018-10-05 15:09:05 +053015#include <asm/arch/hardware.h>
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +053016#include <asm/arch/sys_proto.h>
17#include <asm/io.h>
Christian Taedckec4c41a12023-07-25 09:26:58 +020018#include <mach/zynqmp_aes.h>
Siva Durga Prasad Paladugu8b75ad62018-09-06 16:34:44 +053019
Simon Glassed38aef2020-05-10 11:40:03 -060020static int do_zynqmp_verify_secure(struct cmd_tbl *cmdtp, int flag, int argc,
21 char *const argv[])
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +053022{
Vipul Kumar95a3f872018-07-11 15:18:28 +053023 u64 src_addr, addr;
24 u32 len, src_lo, src_hi;
25 u8 *key_ptr = NULL;
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +053026 int ret;
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +053027 u32 key_lo = 0;
28 u32 key_hi = 0;
29 u32 ret_payload[PAYLOAD_ARG_CNT];
Vipul Kumar95a3f872018-07-11 15:18:28 +053030
31 if (argc < 4)
32 return CMD_RET_USAGE;
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +053033
Vipul Kumar95a3f872018-07-11 15:18:28 +053034 src_addr = simple_strtoull(argv[2], NULL, 16);
Simon Glass3ff49ec2021-07-24 09:03:29 -060035 len = hextoul(argv[3], NULL);
Vipul Kumar95a3f872018-07-11 15:18:28 +053036
37 if (argc == 5)
38 key_ptr = (uint8_t *)(uintptr_t)simple_strtoull(argv[4],
39 NULL, 16);
40
41 if ((ulong)src_addr != ALIGN((ulong)src_addr,
42 CONFIG_SYS_CACHELINE_SIZE)) {
43 printf("Failed: source address not aligned:%lx\n",
44 (ulong)src_addr);
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +053045 return -EINVAL;
46 }
47
Vipul Kumar95a3f872018-07-11 15:18:28 +053048 src_lo = lower_32_bits((ulong)src_addr);
49 src_hi = upper_32_bits((ulong)src_addr);
50 flush_dcache_range((ulong)src_addr, (ulong)(src_addr + len));
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +053051
52 if (key_ptr) {
53 key_lo = lower_32_bits((ulong)key_ptr);
54 key_hi = upper_32_bits((ulong)key_ptr);
55 flush_dcache_range((ulong)key_ptr,
56 (ulong)(key_ptr + KEY_PTR_LEN));
57 }
58
Michal Simek4c3de372019-10-04 15:35:45 +020059 ret = xilinx_pm_request(PM_SECURE_IMAGE, src_lo, src_hi,
60 key_lo, key_hi, ret_payload);
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +053061 if (ret) {
62 printf("Failed: secure op status:0x%x\n", ret);
63 } else {
64 addr = (u64)ret_payload[1] << 32 | ret_payload[2];
65 printf("Verified image at 0x%llx\n", addr);
66 env_set_hex("zynqmp_verified_img_addr", addr);
67 }
68
69 return ret;
70}
71
Simon Glassed38aef2020-05-10 11:40:03 -060072static int do_zynqmp_mmio_read(struct cmd_tbl *cmdtp, int flag, int argc,
73 char *const argv[])
Vipul Kumar869ed8c2018-07-16 18:04:22 +053074{
75 u32 read_val, addr;
76 int ret;
77
78 if (argc != cmdtp->maxargs)
79 return CMD_RET_USAGE;
80
Simon Glass3ff49ec2021-07-24 09:03:29 -060081 addr = hextoul(argv[2], NULL);
Vipul Kumar869ed8c2018-07-16 18:04:22 +053082
83 ret = zynqmp_mmio_read(addr, &read_val);
84 if (!ret)
85 printf("mmio read value at 0x%x = 0x%x\n",
86 addr, read_val);
87 else
88 printf("Failed: mmio read\n");
89
90 return ret;
91}
92
Simon Glassed38aef2020-05-10 11:40:03 -060093static int do_zynqmp_mmio_write(struct cmd_tbl *cmdtp, int flag, int argc,
94 char *const argv[])
Vipul Kumar869ed8c2018-07-16 18:04:22 +053095{
96 u32 addr, mask, val;
97 int ret;
98
99 if (argc != cmdtp->maxargs)
100 return CMD_RET_USAGE;
101
Simon Glass3ff49ec2021-07-24 09:03:29 -0600102 addr = hextoul(argv[2], NULL);
103 mask = hextoul(argv[3], NULL);
104 val = hextoul(argv[4], NULL);
Vipul Kumar869ed8c2018-07-16 18:04:22 +0530105
106 ret = zynqmp_mmio_write(addr, mask, val);
107 if (ret != 0)
108 printf("Failed: mmio write\n");
109
110 return ret;
111}
112
Siva Durga Prasad Paladugu8b75ad62018-09-06 16:34:44 +0530113static int do_zynqmp_aes(struct cmd_tbl *cmdtp, int flag, int argc,
114 char * const argv[])
115{
Christian Taedckec4c41a12023-07-25 09:26:58 +0200116 ALLOC_CACHE_ALIGN_BUFFER(struct zynqmp_aes, aes, 1);
Siva Durga Prasad Paladugu8b75ad62018-09-06 16:34:44 +0530117
118 if (zynqmp_firmware_version() <= PMUFW_V1_0) {
119 puts("ERR: PMUFW v1.0 or less is detected\n");
120 puts("ERR: Encrypt/Decrypt feature is not supported\n");
121 puts("ERR: Please upgrade PMUFW\n");
122 return CMD_RET_FAILURE;
123 }
124
125 if (argc < cmdtp->maxargs - 1)
126 return CMD_RET_USAGE;
127
Simon Glass3ff49ec2021-07-24 09:03:29 -0600128 aes->srcaddr = hextoul(argv[2], NULL);
129 aes->ivaddr = hextoul(argv[3], NULL);
130 aes->len = hextoul(argv[4], NULL);
131 aes->op = hextoul(argv[5], NULL);
132 aes->keysrc = hextoul(argv[6], NULL);
133 aes->dstaddr = hextoul(argv[7], NULL);
Siva Durga Prasad Paladugu8b75ad62018-09-06 16:34:44 +0530134
Siva Durga Prasad Paladugu8b75ad62018-09-06 16:34:44 +0530135 if (aes->keysrc == 0) {
136 if (argc < cmdtp->maxargs)
137 return CMD_RET_USAGE;
138
Simon Glass3ff49ec2021-07-24 09:03:29 -0600139 aes->keyaddr = hextoul(argv[8], NULL);
Siva Durga Prasad Paladugu8b75ad62018-09-06 16:34:44 +0530140 }
141
Christian Taedckec4c41a12023-07-25 09:26:58 +0200142 return zynqmp_aes_operation(aes);
Siva Durga Prasad Paladugu8b75ad62018-09-06 16:34:44 +0530143}
144
Siva Durga Prasad Paladugu48eaa0c2018-10-05 15:09:05 +0530145#ifdef CONFIG_DEFINE_TCM_OCM_MMAP
Simon Glassed38aef2020-05-10 11:40:03 -0600146static int do_zynqmp_tcm_init(struct cmd_tbl *cmdtp, int flag, int argc,
147 char *const argv[])
Siva Durga Prasad Paladugu48eaa0c2018-10-05 15:09:05 +0530148{
149 u8 mode;
150
151 if (argc != cmdtp->maxargs)
152 return CMD_RET_USAGE;
153
Venkatesh Yadav Abbarapu5389fb52023-06-08 08:51:51 +0530154 if (strcmp(argv[2], "lockstep") && strcmp(argv[2], "split")) {
155 printf("mode param should be lockstep or split\n");
156 return CMD_RET_FAILURE;
157 }
158
Simon Glass3ff49ec2021-07-24 09:03:29 -0600159 mode = hextoul(argv[2], NULL);
Siva Durga Prasad Paladugu48eaa0c2018-10-05 15:09:05 +0530160 if (mode != TCM_LOCK && mode != TCM_SPLIT) {
161 printf("Mode should be either 0(lock)/1(split)\n");
162 return CMD_RET_FAILURE;
163 }
164
165 dcache_disable();
166 tcm_init(mode);
167 dcache_enable();
168
169 return CMD_RET_SUCCESS;
170}
171#endif
172
Michal Simekb0e4b232020-04-27 11:26:31 +0200173static int do_zynqmp_pmufw(struct cmd_tbl *cmdtp, int flag, int argc,
174 char * const argv[])
175{
176 u32 addr, size;
177
178 if (argc != cmdtp->maxargs)
179 return CMD_RET_USAGE;
180
Michal Simek07168c62022-01-14 13:25:38 +0100181 if (!strncmp(argv[2], "node", 4)) {
182 u32 id;
Michal Simek15dce442023-06-01 13:25:04 +0200183 int ret;
Michal Simek07168c62022-01-14 13:25:38 +0100184
185 if (!strncmp(argv[3], "close", 5))
186 return zynqmp_pmufw_config_close();
187
188 id = dectoul(argv[3], NULL);
Michal Simek43ced3c2023-06-01 12:32:36 +0200189 if (!id) {
190 printf("Incorrect ID passed\n");
191 return CMD_RET_USAGE;
192 }
Michal Simek07168c62022-01-14 13:25:38 +0100193
194 printf("Enable permission for node ID %d\n", id);
195
Michal Simek15dce442023-06-01 13:25:04 +0200196 ret = zynqmp_pmufw_node(id);
197 if (ret == -ENODEV)
198 ret = 0;
199
200 return ret;
Michal Simek07168c62022-01-14 13:25:38 +0100201 }
202
Simon Glass3ff49ec2021-07-24 09:03:29 -0600203 addr = hextoul(argv[2], NULL);
204 size = hextoul(argv[3], NULL);
Michal Simekb0e4b232020-04-27 11:26:31 +0200205
206 zynqmp_pmufw_load_config_object((const void *)(uintptr_t)addr,
207 (size_t)size);
208
209 return 0;
210}
211
T Karthik Reddy59ec6412019-01-07 17:05:10 +0530212static int do_zynqmp_rsa(struct cmd_tbl *cmdtp, int flag, int argc,
213 char * const argv[])
214{
215 u64 srcaddr, mod, exp;
216 u32 srclen, rsaop, size, ret_payload[PAYLOAD_ARG_CNT];
217 int ret;
218
219 if (argc != cmdtp->maxargs)
220 return CMD_RET_USAGE;
221
222 if (zynqmp_firmware_version() <= PMUFW_V1_0) {
223 puts("ERR: PMUFW v1.0 or less is detected\n");
224 puts("ERR: Encrypt/Decrypt feature is not supported\n");
225 puts("ERR: Please upgrade PMUFW\n");
226 return CMD_RET_FAILURE;
227 }
228
Simon Glass3ff49ec2021-07-24 09:03:29 -0600229 srcaddr = hextoul(argv[2], NULL);
230 srclen = hextoul(argv[3], NULL);
T Karthik Reddy59ec6412019-01-07 17:05:10 +0530231 if (srclen != RSA_KEY_SIZE) {
232 puts("ERR: srclen should be equal to 0x200(512 bytes)\n");
233 return CMD_RET_USAGE;
234 }
235
Simon Glass3ff49ec2021-07-24 09:03:29 -0600236 mod = hextoul(argv[4], NULL);
237 exp = hextoul(argv[5], NULL);
238 rsaop = hextoul(argv[6], NULL);
T Karthik Reddy59ec6412019-01-07 17:05:10 +0530239 if (!(rsaop == 0 || rsaop == 1)) {
240 puts("ERR: rsaop should be either 0 or 1\n");
241 return CMD_RET_USAGE;
242 }
243
244 memcpy((void *)srcaddr + srclen, (void *)mod, MODULUS_LEN);
245
246 /*
247 * For encryption we load public exponent (key size 4096-bits),
248 * for decryption we load private exponent (32-bits)
249 */
250 if (rsaop) {
251 memcpy((void *)srcaddr + srclen + MODULUS_LEN,
252 (void *)exp, PUB_EXPO_LEN);
253 size = srclen + MODULUS_LEN + PUB_EXPO_LEN;
254 } else {
255 memcpy((void *)srcaddr + srclen + MODULUS_LEN,
256 (void *)exp, PRIV_EXPO_LEN);
257 size = srclen + MODULUS_LEN + PRIV_EXPO_LEN;
258 }
259
260 flush_dcache_range((ulong)srcaddr,
261 (ulong)(srcaddr) + roundup(size, ARCH_DMA_MINALIGN));
262
263 ret = xilinx_pm_request(PM_SECURE_RSA, upper_32_bits((ulong)srcaddr),
264 lower_32_bits((ulong)srcaddr), srclen, rsaop,
265 ret_payload);
266 if (ret || ret_payload[1]) {
267 printf("Failed: RSA status:0x%x, errcode:0x%x\n",
268 ret, ret_payload[1]);
269 return CMD_RET_FAILURE;
270 }
271
272 return CMD_RET_SUCCESS;
273}
274
T Karthik Reddy89cbce92019-01-07 17:05:11 +0530275static int do_zynqmp_sha3(struct cmd_tbl *cmdtp, int flag,
276 int argc, char * const argv[])
277{
Michal Simekd5c37472020-10-20 08:29:25 +0200278 u64 srcaddr, hashaddr;
T Karthik Reddy89cbce92019-01-07 17:05:11 +0530279 u32 srclen, ret_payload[PAYLOAD_ARG_CNT];
280 int ret;
281
Michal Simekd5c37472020-10-20 08:29:25 +0200282 if (argc > cmdtp->maxargs || argc < (cmdtp->maxargs - 1))
T Karthik Reddy89cbce92019-01-07 17:05:11 +0530283 return CMD_RET_USAGE;
284
285 if (zynqmp_firmware_version() <= PMUFW_V1_0) {
286 puts("ERR: PMUFW v1.0 or less is detected\n");
287 puts("ERR: Encrypt/Decrypt feature is not supported\n");
288 puts("ERR: Please upgrade PMUFW\n");
289 return CMD_RET_FAILURE;
290 }
291
Simon Glass3ff49ec2021-07-24 09:03:29 -0600292 srcaddr = hextoul(argv[2], NULL);
293 srclen = hextoul(argv[3], NULL);
T Karthik Reddy89cbce92019-01-07 17:05:11 +0530294
Michal Simekd5c37472020-10-20 08:29:25 +0200295 if (argc == 5) {
Simon Glass3ff49ec2021-07-24 09:03:29 -0600296 hashaddr = hextoul(argv[4], NULL);
Michal Simekd5c37472020-10-20 08:29:25 +0200297 flush_dcache_range(hashaddr,
298 hashaddr + roundup(ZYNQMP_SHA3_SIZE,
299 ARCH_DMA_MINALIGN));
300 } else {
301 hashaddr = srcaddr;
302 }
303
T Karthik Reddy89cbce92019-01-07 17:05:11 +0530304 /* Check srcaddr or srclen != 0 */
305 if (!srcaddr || !srclen) {
306 puts("ERR: srcaddr & srclen should not be 0\n");
307 return CMD_RET_USAGE;
308 }
309
310 flush_dcache_range(srcaddr,
311 srcaddr + roundup(srclen, ARCH_DMA_MINALIGN));
312
313 ret = xilinx_pm_request(PM_SECURE_SHA, 0, 0, 0,
314 ZYNQMP_SHA3_INIT, ret_payload);
315 if (ret || ret_payload[1]) {
316 printf("Failed: SHA INIT status:0x%x, errcode:0x%x\n",
317 ret, ret_payload[1]);
318 return CMD_RET_FAILURE;
319 }
320
321 ret = xilinx_pm_request(PM_SECURE_SHA, upper_32_bits((ulong)srcaddr),
322 lower_32_bits((ulong)srcaddr),
323 srclen, ZYNQMP_SHA3_UPDATE, ret_payload);
324 if (ret || ret_payload[1]) {
325 printf("Failed: SHA UPDATE status:0x%x, errcode:0x%x\n",
326 ret, ret_payload[1]);
327 return CMD_RET_FAILURE;
328 }
329
Michal Simekd5c37472020-10-20 08:29:25 +0200330 ret = xilinx_pm_request(PM_SECURE_SHA, upper_32_bits((ulong)hashaddr),
331 lower_32_bits((ulong)hashaddr),
332 ZYNQMP_SHA3_SIZE, ZYNQMP_SHA3_FINAL,
333 ret_payload);
T Karthik Reddy89cbce92019-01-07 17:05:11 +0530334 if (ret || ret_payload[1]) {
335 printf("Failed: SHA FINAL status:0x%x, errcode:0x%x\n",
336 ret, ret_payload[1]);
337 return CMD_RET_FAILURE;
338 }
339
340 return CMD_RET_SUCCESS;
341}
342
Simon Glassed38aef2020-05-10 11:40:03 -0600343static struct cmd_tbl cmd_zynqmp_sub[] = {
Vipul Kumar95a3f872018-07-11 15:18:28 +0530344 U_BOOT_CMD_MKENT(secure, 5, 0, do_zynqmp_verify_secure, "", ""),
Michal Simekb0e4b232020-04-27 11:26:31 +0200345 U_BOOT_CMD_MKENT(pmufw, 4, 0, do_zynqmp_pmufw, "", ""),
Vipul Kumar869ed8c2018-07-16 18:04:22 +0530346 U_BOOT_CMD_MKENT(mmio_read, 3, 0, do_zynqmp_mmio_read, "", ""),
347 U_BOOT_CMD_MKENT(mmio_write, 5, 0, do_zynqmp_mmio_write, "", ""),
Siva Durga Prasad Paladugu8b75ad62018-09-06 16:34:44 +0530348 U_BOOT_CMD_MKENT(aes, 9, 0, do_zynqmp_aes, "", ""),
T Karthik Reddy59ec6412019-01-07 17:05:10 +0530349 U_BOOT_CMD_MKENT(rsa, 7, 0, do_zynqmp_rsa, "", ""),
Michal Simekd5c37472020-10-20 08:29:25 +0200350 U_BOOT_CMD_MKENT(sha3, 5, 0, do_zynqmp_sha3, "", ""),
Siva Durga Prasad Paladugu48eaa0c2018-10-05 15:09:05 +0530351#ifdef CONFIG_DEFINE_TCM_OCM_MMAP
352 U_BOOT_CMD_MKENT(tcminit, 3, 0, do_zynqmp_tcm_init, "", ""),
353#endif
Vipul Kumar95a3f872018-07-11 15:18:28 +0530354};
355
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +0530356/**
357 * do_zynqmp - Handle the "zynqmp" command-line command
358 * @cmdtp: Command data struct pointer
359 * @flag: Command flag
360 * @argc: Command-line argument count
361 * @argv: Array of command-line arguments
362 *
363 * Processes the zynqmp specific commands
364 *
365 * Return: return 0 on success and CMD_RET_USAGE incase of misuse and error
366 */
Simon Glassed38aef2020-05-10 11:40:03 -0600367static int do_zynqmp(struct cmd_tbl *cmdtp, int flag, int argc,
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +0530368 char *const argv[])
369{
Simon Glassed38aef2020-05-10 11:40:03 -0600370 struct cmd_tbl *c;
Michal Simek36556a02023-06-01 13:21:07 +0200371 int ret = CMD_RET_USAGE;
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +0530372
Vipul Kumar95a3f872018-07-11 15:18:28 +0530373 if (argc < 2)
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +0530374 return CMD_RET_USAGE;
375
Vipul Kumar95a3f872018-07-11 15:18:28 +0530376 c = find_cmd_tbl(argv[1], &cmd_zynqmp_sub[0],
377 ARRAY_SIZE(cmd_zynqmp_sub));
Vipul Kumar95a3f872018-07-11 15:18:28 +0530378 if (c)
Michal Simek36556a02023-06-01 13:21:07 +0200379 ret = c->cmd(c, flag, argc, argv);
380
381 return cmd_process_error(c, ret);
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +0530382}
383
384/***************************************************/
Tom Rini03f146c2023-10-07 15:13:08 -0400385U_BOOT_LONGHELP(zynqmp,
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +0530386 "secure src len [key_addr] - verifies secure images of $len bytes\n"
387 " long at address $src. Optional key_addr\n"
388 " can be specified if user key needs to\n"
Vipul Kumar869ed8c2018-07-16 18:04:22 +0530389 " be used for decryption\n"
390 "zynqmp mmio_read address - read from address\n"
391 "zynqmp mmio_write address mask value - write value after masking to\n"
Siva Durga Prasad Paladugu48eaa0c2018-10-05 15:09:05 +0530392 " address\n"
Siva Durga Prasad Paladugu8b75ad62018-09-06 16:34:44 +0530393 "zynqmp aes srcaddr ivaddr len aesop keysrc dstaddr [keyaddr] -\n"
394 " Encrypts or decrypts blob of data at src address and puts it\n"
395 " back to dstaddr using key and iv at keyaddr and ivaddr\n"
396 " respectively. keysrc value specifies from which source key\n"
397 " has to be used, it can be User/Device/PUF key. A value of 0\n"
398 " for KUP(user key),1 for DeviceKey and 2 for PUF key. The\n"
399 " aesop value specifies the operation which can be 0 for\n"
400 " decrypt and 1 for encrypt operation\n"
Siva Durga Prasad Paladugu48eaa0c2018-10-05 15:09:05 +0530401#ifdef CONFIG_DEFINE_TCM_OCM_MMAP
Michal Simek3a5642d2018-11-21 07:49:18 +0100402 "zynqmp tcminit mode - Initialize the TCM with zeros. TCM needs to be\n"
403 " initialized before accessing to avoid ECC\n"
404 " errors. mode specifies in which mode TCM has\n"
405 " to be initialized. Supported modes will be\n"
406 " lock(0)/split(1)\n"
Siva Durga Prasad Paladugu48eaa0c2018-10-05 15:09:05 +0530407#endif
Michal Simekb0e4b232020-04-27 11:26:31 +0200408 "zynqmp pmufw address size - load PMU FW configuration object\n"
Michal Simek43ced3c2023-06-01 12:32:36 +0200409 "zynqmp pmufw node <id> - load PMU FW configuration object, <id> in dec\n"
Michal Simek07168c62022-01-14 13:25:38 +0100410 "zynqmp pmufw node close - disable config object loading\n"
411 " node: keyword, id: NODE_ID in decimal format\n"
T Karthik Reddy59ec6412019-01-07 17:05:10 +0530412 "zynqmp rsa srcaddr srclen mod exp rsaop -\n"
413 " Performs RSA encryption and RSA decryption on blob of data\n"
414 " at srcaddr and puts it back in srcaddr using modulus and\n"
415 " public or private exponent\n"
416 " srclen : must be key size(4096 bits)\n"
417 " exp : private key exponent for RSA decryption(4096 bits)\n"
418 " public key exponent for RSA encryption(32 bits)\n"
419 " rsaop : 0 for RSA Decryption, 1 for RSA Encryption\n"
Michal Simekd5c37472020-10-20 08:29:25 +0200420 "zynqmp sha3 srcaddr srclen [key_addr] -\n"
T Karthik Reddy89cbce92019-01-07 17:05:11 +0530421 " Generates sha3 hash value for data blob at srcaddr and puts\n"
422 " 48 bytes hash value into srcaddr\n"
Michal Simekd5c37472020-10-20 08:29:25 +0200423 " Optional key_addr can be specified for saving sha3 hash value\n"
T Karthik Reddy89cbce92019-01-07 17:05:11 +0530424 " Note: srcaddr/srclen should not be 0\n"
Tom Rini03f146c2023-10-07 15:13:08 -0400425 );
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +0530426
427U_BOOT_CMD(
Siva Durga Prasad Paladugu8b75ad62018-09-06 16:34:44 +0530428 zynqmp, 9, 1, do_zynqmp,
Vipul Kumar95a3f872018-07-11 15:18:28 +0530429 "ZynqMP sub-system",
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +0530430 zynqmp_help_text
Simon Glass761d6022023-11-18 14:04:52 -0700431);