summaryrefslogtreecommitdiff
path: root/board/xilinx
diff options
context:
space:
mode:
authorT Karthik Reddy <t.karthik.reddy@xilinx.com>2019-03-12 20:20:22 +0530
committerMichal Simek <michal.simek@xilinx.com>2020-06-24 13:07:58 +0200
commitb80a476faa3a36ea66a706cf985533792e1e185e (patch)
treee6005cbd295fe741918f3c7d2b8046db8bd74ca4 /board/xilinx
parentca0c0e07adf3c3baf3851fc17490a0160398c834 (diff)
fpga: zynqpl: Add zynq aes load & loadp commands
Added support for zynq aes load & loadp commands. Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com> Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'board/xilinx')
-rw-r--r--board/xilinx/zynq/cmds.c47
1 files changed, 35 insertions, 12 deletions
diff --git a/board/xilinx/zynq/cmds.c b/board/xilinx/zynq/cmds.c
index d5e7d70bdf..73e2b0eac7 100644
--- a/board/xilinx/zynq/cmds.c
+++ b/board/xilinx/zynq/cmds.c
@@ -444,18 +444,37 @@ static int zynq_decrypt_image(struct cmd_tbl *cmdtp, int flag, int argc,
if (argc < 5 && argc > cmdtp->maxargs)
return CMD_RET_USAGE;
- srcaddr = simple_strtoul(argv[2], &endp, 16);
- if (*argv[2] == 0 || *endp != 0)
- return CMD_RET_USAGE;
- srclen = simple_strtoul(argv[3], &endp, 16);
- if (*argv[3] == 0 || *endp != 0)
- return CMD_RET_USAGE;
- dstaddr = simple_strtoul(argv[4], &endp, 16);
- if (*argv[4] == 0 || *endp != 0)
- return CMD_RET_USAGE;
- dstlen = simple_strtoul(argv[5], &endp, 16);
- if (*argv[5] == 0 || *endp != 0)
- return CMD_RET_USAGE;
+ if (argc == 5) {
+ if (!strcmp("load", argv[2]))
+ imgtype = BIT_FULL;
+ else if (!strcmp("loadp", argv[2]))
+ imgtype = BIT_PARTIAL;
+ else
+ return CMD_RET_USAGE;
+
+ srcaddr = simple_strtoul(argv[3], &endp, 16);
+ if (*argv[3] == 0 || *endp != 0)
+ return CMD_RET_USAGE;
+ srclen = simple_strtoul(argv[4], &endp, 16);
+ if (*argv[4] == 0 || *endp != 0)
+ return CMD_RET_USAGE;
+
+ dstaddr = 0xFFFFFFFF;
+ dstlen = srclen;
+ } else {
+ srcaddr = simple_strtoul(argv[2], &endp, 16);
+ if (*argv[2] == 0 || *endp != 0)
+ return CMD_RET_USAGE;
+ srclen = simple_strtoul(argv[3], &endp, 16);
+ if (*argv[3] == 0 || *endp != 0)
+ return CMD_RET_USAGE;
+ dstaddr = simple_strtoul(argv[4], &endp, 16);
+ if (*argv[4] == 0 || *endp != 0)
+ return CMD_RET_USAGE;
+ dstlen = simple_strtoul(argv[5], &endp, 16);
+ if (*argv[5] == 0 || *endp != 0)
+ return CMD_RET_USAGE;
+ }
/*
* Roundup source and destination lengths to
@@ -520,6 +539,10 @@ static char zynq_help_text[] =
" - Decrypts the encrypted image present in source\n"
" address and places the decrypted image at\n"
" destination address\n"
+ "aes load <srcaddr> <srclen>\n"
+ "aes loadp <srcaddr> <srclen>\n"
+ " if operation type is load or loadp, it loads the encrypted\n"
+ " full or partial bitstream on to PL respectively.\n"
#endif
;
#endif