debug("Authentication Done\r\n");
}
- if (encrypt_part_flag) {
+ if (encrypt_part_flag || signed_part_flag) {
debug("DECRYPTION \r\n");
part_dst_addr = part_load_addr;
part_img_len,
part_dst_addr,
part_data_len,
- bstype);
+ bstype,
+ encrypt_part_flag);
if (status != 0) {
printf("DECRYPTION_FAIL\r\n");
return -1;
* place it back the decrypted image into dstaddr.
*/
int zynq_decrypt_load(u32 srcaddr, u32 srclen, u32 dstaddr, u32 dstlen,
- u8 bstype)
+ u8 bstype, bool encrypt_part_flag)
{
u32 isr_status, ts;
return FPGA_FAIL;
}
- /* Check AES engine is enabled */
- if (!(readl(&devcfg_base->ctrl) & DEVCFG_CTRL_PCFG_AES_EN_MASK)) {
- printf("%s: AES engine is not enabled\n", __func__);
- return FPGA_FAIL;
+ if (encrypt_part_flag) {
+ /* Check AES engine is enabled */
+ if (!(readl(&devcfg_base->ctrl) &
+ DEVCFG_CTRL_PCFG_AES_EN_MASK)) {
+ printf("%s: AES engine is not enabled\n", __func__);
+ return FPGA_FAIL;
+ }
}
if (zynq_dma_xfer_init(bstype)) {
return FPGA_FAIL;
}
- writel((readl(&devcfg_base->ctrl) | DEVCFG_CTRL_PCAP_RATE_EN_MASK),
- &devcfg_base->ctrl);
+ if (encrypt_part_flag)
+ writel((readl(&devcfg_base->ctrl) |
+ DEVCFG_CTRL_PCAP_RATE_EN_MASK), &devcfg_base->ctrl);
debug("%s: Source = 0x%08X\n", __func__, (u32)srcaddr);
debug("%s: Size = %zu\n", __func__, srclen);
dstlen = roundup(dstlen, 4);
status = zynq_decrypt_load(srcaddr, srclen >> 2, dstaddr, dstlen >> 2,
- imgtype);
+ imgtype, true);
if (status != 0)
return -1;
#ifdef CONFIG_CMD_ZYNQ_AES
extern int zynq_decrypt_load(u32 srcaddr, u32 dstaddr, u32 srclen, u32 dstlen,
- u8 bstype);
+ u8 bstype, bool encrypt_part_flag);
#endif
#if defined(CONFIG_FPGA_ZYNQPL)
extern struct xilinx_fpga_op zynq_op;