diff options
| author | Janne Ylalehto <[email protected]> | 2022-08-16 15:45:25 +0300 |
|---|---|---|
| committer | Michal Simek <[email protected]> | 2022-09-12 12:03:17 +0200 |
| commit | cf5c48d102bd50eb24eb03ddd5cc1f0c33a3f57a (patch) | |
| tree | f13f6b92f8c74e0c903546881a864cd37e4d0295 | |
| parent | 7a0bc18b6309be421b7968ee70efb54c9e3d59dd (diff) | |
xilinx: zynqmp: Fix AES with a user provided key
The user provided key address was not flushed in struct aes because of
the flushing location in the function.
Signed-off-by: Janne Ylalehto <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michal Simek <[email protected]>
| -rw-r--r-- | board/xilinx/zynqmp/cmds.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/board/xilinx/zynqmp/cmds.c b/board/xilinx/zynqmp/cmds.c index 2ab9596248c..e20030ecda7 100644 --- a/board/xilinx/zynqmp/cmds.c +++ b/board/xilinx/zynqmp/cmds.c @@ -142,9 +142,6 @@ static int do_zynqmp_aes(struct cmd_tbl *cmdtp, int flag, int argc, aes->keysrc = hextoul(argv[6], NULL); aes->dstaddr = hextoul(argv[7], NULL); - flush_dcache_range((ulong)aes, (ulong)(aes) + - roundup(sizeof(struct aes), ARCH_DMA_MINALIGN)); - if (aes->srcaddr && aes->ivaddr && aes->dstaddr) { flush_dcache_range(aes->srcaddr, (aes->srcaddr + @@ -169,6 +166,9 @@ static int do_zynqmp_aes(struct cmd_tbl *cmdtp, int flag, int argc, ARCH_DMA_MINALIGN))); } + flush_dcache_range((ulong)aes, (ulong)(aes) + + roundup(sizeof(struct aes), ARCH_DMA_MINALIGN)); + ret = xilinx_pm_request(PM_SECURE_AES, upper_32_bits((ulong)aes), lower_32_bits((ulong)aes), 0, 0, ret_payload); if (ret || ret_payload[1]) |
