From patchwork Wed Mar 28 14:30:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 892243 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="I9iro8Ff"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40B9LS26bGz9s0b for ; Thu, 29 Mar 2018 01:31:42 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 79820C22125; Wed, 28 Mar 2018 14:30:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0B2D1C22133; Wed, 28 Mar 2018 14:30:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7480CC220A3; Wed, 28 Mar 2018 14:30:29 +0000 (UTC) Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by lists.denx.de (Postfix) with ESMTPS id 22BC0C220A1 for ; Wed, 28 Mar 2018 14:30:29 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id f14so2446931wre.8 for ; Wed, 28 Mar 2018 07:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=QzQnVTxw0FTwzFowWipL/RVwyCdKYnzIZBwqAjq8gC4=; b=I9iro8FfuR5kx1l5Tk6BS1KBNT5DltIAVFax/oiX/WtXwh9gTdEXwZNygMorJCeDEG z4E6ghLvS5jCzJQPPeVYnTYPCYlGq6DXxQ7/3p5O+WstZEaO/ZjatbRPwHrnAhe+HDU1 juqANRlBxpJL5D9f3t7dYYnCGZXJHZj2X79fnhSTKmfTYjD5mbIKRd01ZENpMf4PqvYK 6oBwOOISVuX3xBPRO4liekPAlGhk1zmjiYFNyy3Q1DYtm9B3IyrqagEPnlPrCgjwFgf6 39kqNyhnOrdVZCCOlI4OLAg9S6crDKZpXCbg17X0O/XFacO2bCJB5JN3ZJ44K1sOMgPW duJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=QzQnVTxw0FTwzFowWipL/RVwyCdKYnzIZBwqAjq8gC4=; b=hcV3WVYaA/M0dOuERsdd4hoZRrJG2FwzFpdHfnefVWxlP3TV1a7wdjRkzAHIKKyHqE 5eKLS4gPdtfIAE6KM+H6VO3Vv47d1292o4qJjgeaYOp0GtYqwu8L24Ry0iezRHOv9W6L XBS/foDwJj7KxJmhqP2xJtuDH+X2KN+JDAY+wqlkyOdpu3+oSwD+0l/CIaSPMr6Gxolf Ww6VCYAwTiDnE6zC5h/rGOLVR3ZAb4h9pkOBiEdo5uABSY9q0fA0Kq30557KaOeFv9Ma NPvMdACU3GAoQq871Yc0K3m5HmLr9LCodYA07xkFjUiWBt4yKPxiuipRvQziEIQLLOcG Tl9g== X-Gm-Message-State: AElRT7HgombZUha/PDtU2Io1E3/Gyq1UdnduX5lRLJaJs4MDRmE7LOIP ekNsZQvaEoe1oBqacfW6DDkmmYxD X-Google-Smtp-Source: AIpwx4/N/w67MeW+2YBS+ZJYKYbpU+jVyOK5FpA9J80+59Uus0crpJ/7yXjgrhh7/6ff6EZrPLgvEw== X-Received: by 10.223.178.87 with SMTP id y23mr3053754wra.95.1522247428607; Wed, 28 Mar 2018 07:30:28 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id v191sm4157063wmf.34.2018.03.28.07.30.27 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 28 Mar 2018 07:30:28 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de Date: Wed, 28 Mar 2018 16:30:23 +0200 Message-Id: <854d82c7acc2fd4f43c4d07698a03e00e56bbc84.1522247420.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Cc: Nava kishore Manne , Nitin Jain Subject: [U-Boot] [PATCH 1/3] fpga: zynqmp: Add support to get the PCAP status for fpga info command X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Nitin Jain This patch adds support for ZynqMP platform to print FPGA PCAP status for "fpga status" command. Signed-off-by: Nitin Jain Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- drivers/fpga/zynqmppl.c | 14 ++++++++++++++ include/zynqmppl.h | 1 + 2 files changed, 15 insertions(+) diff --git a/drivers/fpga/zynqmppl.c b/drivers/fpga/zynqmppl.c index 57a4e6c88e7a..80388ae7f2cf 100644 --- a/drivers/fpga/zynqmppl.c +++ b/drivers/fpga/zynqmppl.c @@ -224,6 +224,20 @@ static int zynqmp_load(xilinx_desc *desc, const void *buf, size_t bsize, return ret; } +static int zynqmp_pcap_info(xilinx_desc *desc) +{ + int ret; + u32 ret_payload[PAYLOAD_ARG_CNT]; + + ret = invoke_smc(ZYNQMP_SIP_SVC_PM_FPGA_STATUS, 0, 0, 0, + 0, ret_payload); + if (!ret) + printf("PCAP status\t0x%x\n", ret_payload[1]); + + return ret; +} + struct xilinx_fpga_op zynqmp_op = { .load = zynqmp_load, + .info = zynqmp_pcap_info, }; diff --git a/include/zynqmppl.h b/include/zynqmppl.h index 4c8c2f88f04c..8b3ce8ef7706 100644 --- a/include/zynqmppl.h +++ b/include/zynqmppl.h @@ -12,6 +12,7 @@ #define ZYNQMP_SIP_SVC_CSU_DMA_CHIPID 0xC2000018 #define ZYNQMP_SIP_SVC_PM_FPGA_LOAD 0xC2000016 +#define ZYNQMP_SIP_SVC_PM_FPGA_STATUS 0xC2000017 #define ZYNQMP_FPGA_OP_INIT (1 << 0) #define ZYNQMP_FPGA_OP_LOAD (1 << 1) #define ZYNQMP_FPGA_OP_DONE (1 << 2) From patchwork Wed Mar 28 14:30:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 892244 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="i1L0kiTz"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40B9Mn3HhBz9s0R for ; Thu, 29 Mar 2018 01:32:53 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id CF858C22150; Wed, 28 Mar 2018 14:31:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8ADE7C2215F; Wed, 28 Mar 2018 14:30:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 76A46C22131; Wed, 28 Mar 2018 14:30:33 +0000 (UTC) Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by lists.denx.de (Postfix) with ESMTPS id 879C7C220F7 for ; Wed, 28 Mar 2018 14:30:30 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id c24so2454609wrc.6 for ; Wed, 28 Mar 2018 07:30:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=SXzKbYuCvyaPUmrByt4jS/Gt4o+ziBZKV13mt4wxKMM=; b=i1L0kiTzGPzoQgzTPM+wKNh/VIobSrD7HEw6+Slg1NIjYmrY1JxlE3+WDwSTOehvYu xNCDeDjqkIKe7VNRfJ1hes6V7THmZVeTPukwqT6khcuWMFYIKqoFe67evi/1L2hfUiVA nZMimghy5C22zTgaABsqLAFYvSBhS2yKia0Lpy7/SFRNLfbOtsV+o+M9IL7CrsHCVSL4 Qfk6NEG72QaYrajdPeLoyQ1fBxnG2n+DospDG9DNO3m821URujgTEyVbDX91qsndH6Up viIiQqWZ4zT4QWmaSSo9gyXAEIChn+Fuw8FkhaxhHtrplKW3YQdlxZiwvJtOObOZo0Bz eOKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=SXzKbYuCvyaPUmrByt4jS/Gt4o+ziBZKV13mt4wxKMM=; b=OjHPglfKRbkB+f73LvrOzeyG7fMbdubnes9cZqTJgRqAPeplQ4AkZWnsYqBQEtVuFK WMLgMevYsay0Xht6M7sjeLqM+0LZ9MG3e4l82x9zhQAWl+rKOUomq34Eo9TxKmTOXPv7 d+SC/GOBVSvO4QSsS7h3rPKC5TVtg4NNnuy31QXNing3y6T4fANUTRNfJf9IoPftGiV1 hdf5eFcVGjTkT2kAb+YXGzoLrI12jSeqw/MoQanDcaiM2dLKed7/GHWLXqN4fwwZib/U 3jwhYZSlvvz3K/h9e46L8m4gncBhskBgVRbsULJVkwVTY49d3SiyVd+b+KatxBWkLdL/ sjxQ== X-Gm-Message-State: AElRT7HiJrj0uFA/WKU+6z2DXj3rgzzpL6dumpjDvks3QnTU5VdeF7hs B6M/ueMg50iQ9gVLf5VeFu1dnLjo X-Google-Smtp-Source: AIpwx4+MGMojaw/BlKV3OkRepnS3cuofitWORYJCQIP7VNvkarR8ikkEORI8k8uZ603iS+2xLiLQYg== X-Received: by 10.223.156.206 with SMTP id h14mr2940414wre.281.1522247430022; Wed, 28 Mar 2018 07:30:30 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id l73sm10951060wma.10.2018.03.28.07.30.29 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 28 Mar 2018 07:30:29 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de Date: Wed, 28 Mar 2018 16:30:24 +0200 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Cc: Nava kishore Manne , Nitin Jain , Joe Hershberger Subject: [U-Boot] [PATCH 2/3] fpga: zynqmp: Update zynqmp_load() as per latest xilfpga X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Siva Durga Prasad Paladugu Latest xilfpga expects to set BIT5 of flags for nonsecure bitsream and also expects length in bytes instead of words This patch does the same. Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek Reviewed-by: Joe Hershberger --- arch/arm/include/asm/arch-zynqmp/sys_proto.h | 2 ++ drivers/fpga/zynqmppl.c | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/arm/include/asm/arch-zynqmp/sys_proto.h b/arch/arm/include/asm/arch-zynqmp/sys_proto.h index ad3dc9aba50d..3daf0e81d80c 100644 --- a/arch/arm/include/asm/arch-zynqmp/sys_proto.h +++ b/arch/arm/include/asm/arch-zynqmp/sys_proto.h @@ -14,6 +14,8 @@ #define ZYNQMP_SIP_SVC_PM_SECURE_IMG_LOAD 0xC200002D #define KEY_PTR_LEN 32 +#define ZYNQMP_FPGA_BIT_NS 5 + enum { IDCODE, VERSION, diff --git a/drivers/fpga/zynqmppl.c b/drivers/fpga/zynqmppl.c index 80388ae7f2cf..aae0efc7348e 100644 --- a/drivers/fpga/zynqmppl.c +++ b/drivers/fpga/zynqmppl.c @@ -209,13 +209,9 @@ static int zynqmp_load(xilinx_desc *desc, const void *buf, size_t bsize, debug("%s called!\n", __func__); flush_dcache_range(bin_buf, bin_buf + bsize); - if (bsize % 4) - bsize = bsize / 4 + 1; - else - bsize = bsize / 4; - buf_lo = (u32)bin_buf; buf_hi = upper_32_bits(bin_buf); + bstype |= BIT(ZYNQMP_FPGA_BIT_NS); ret = invoke_smc(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo, buf_hi, bsize, bstype, ret_payload); if (ret) From patchwork Wed Mar 28 14:30:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 892245 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="rApwZOtE"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40B9N33k1Lz9s0b for ; Thu, 29 Mar 2018 01:33:07 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 19D16C2217F; Wed, 28 Mar 2018 14:31:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0762DC22119; Wed, 28 Mar 2018 14:30:48 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 759F8C220AC; Wed, 28 Mar 2018 14:30:35 +0000 (UTC) Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by lists.denx.de (Postfix) with ESMTPS id F2C9DC22132 for ; Wed, 28 Mar 2018 14:30:31 +0000 (UTC) Received: by mail-wr0-f194.google.com with SMTP id u11so2442376wri.12 for ; Wed, 28 Mar 2018 07:30:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=sB3Pwi+WDKNza1U7AtvMA/eDWuYUyrmn15BKaz8apo8=; b=rApwZOtE9MtFg0K9+fl7FeRjl6sdgiueXpZEsc8gF3luf9d0b/K6aFjYvCyjPM/4y1 340iRzwNabQLwlMOL6CGo4PiFP0LsaqKx0/BBVc9RE2cM4VpBF4IMDcpm4DeYmj2sLxe Czz1Y+KcOvfhLPHE7pS0aqZd0eT8MvHg1jjjZlal1Xy7gxrK03H8k8NSC1dPlnNWBG3x CaQIHV9zRRx9u2LhrOyyGZdwUu4nWYytZvLnvIyIFHhUlUomM03S44QnzXOxiShisJQe n8oEyoiwI8rYYXg8hm8k8SAl61nQkZG3AjDbecKYfBECA6m1L6tHYK3Cx8QewKi3QBrR DYDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=sB3Pwi+WDKNza1U7AtvMA/eDWuYUyrmn15BKaz8apo8=; b=mrE0A4sT4CwNnCpttaHuIas/HztaOYooC3ccZ456Ty5KrlP5rSlL8tfOETnu9rx+i2 pVWovSKI77uGsWcD2WjEikQwJsjwZoYBKNMgpaO5XTN1xrodH8cm1bXorRmEIMGK0QRU /kFeacIUU8VuEzPSYQGkZg56fP4+FpX08GAeXQUIfELx47/J5jhQrxnNnGgql+KBWQHQ 2s1g4GnEbh/KPMPgkGyjgOOvOKIfh2lfcCVBUByJzoiDH1g54iAwPc59vgG0shZ5y/N5 oD6BMM4E3LzSBkiX32yRWknvWRSkfckYJDN5qZlTJgIV/n+jzIfRlTCpyc8yHKm4Nx7+ LQAQ== X-Gm-Message-State: AElRT7EvxluqA0Z924bF3ibqB/k+dYkTZIe3EixwiTScqPecLL1stRcw ry04bisJwGEHaBOxFuTuUCvTBrzM X-Google-Smtp-Source: AIpwx4+uP3GYKADUVJv1T0HuWU1nFXLhDmGHcRjCJiEND+Ma4zW7cs3BcKYwuBIB8r8h86EAkyrdeA== X-Received: by 10.223.226.210 with SMTP id d18mr3059472wrj.192.1522247431467; Wed, 28 Mar 2018 07:30:31 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id q21sm3038788wra.24.2018.03.28.07.30.30 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 28 Mar 2018 07:30:30 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de Date: Wed, 28 Mar 2018 16:30:25 +0200 Message-Id: <21d84c6b62fc0b311e2773df939f22d6ee75878f.1522247420.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Cc: Nava kishore Manne , Nitin Jain Subject: [U-Boot] [PATCH 3/3] fpga: zynqmp: Fix the nonsecure bitstream loading issue X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Siva Durga Prasad Paladugu Xilfpga library expects the size of bitstream in a pointer but currenly we are passing the size as a value. This patch fixes this issue. Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Nava kishore Manne Signed-off-by: Michal Simek --- drivers/fpga/zynqmppl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/fpga/zynqmppl.c b/drivers/fpga/zynqmppl.c index aae0efc7348e..43e8b2520e35 100644 --- a/drivers/fpga/zynqmppl.c +++ b/drivers/fpga/zynqmppl.c @@ -11,6 +11,7 @@ #include #include #include +#include #define DUMMY_WORD 0xffffffff @@ -195,6 +196,7 @@ static int zynqmp_validate_bitstream(xilinx_desc *desc, const void *buf, static int zynqmp_load(xilinx_desc *desc, const void *buf, size_t bsize, bitstream_type bstype) { + ALLOC_CACHE_ALIGN_BUFFER(u32, bsizeptr, 1); u32 swap; ulong bin_buf; int ret; @@ -205,15 +207,17 @@ static int zynqmp_load(xilinx_desc *desc, const void *buf, size_t bsize, return FPGA_FAIL; bin_buf = zynqmp_align_dma_buffer((u32 *)buf, bsize, swap); + bsizeptr = (u32 *)&bsize; debug("%s called!\n", __func__); flush_dcache_range(bin_buf, bin_buf + bsize); + flush_dcache_range((ulong)bsizeptr, (ulong)bsizeptr + sizeof(size_t)); buf_lo = (u32)bin_buf; buf_hi = upper_32_bits(bin_buf); bstype |= BIT(ZYNQMP_FPGA_BIT_NS); - ret = invoke_smc(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo, buf_hi, bsize, - bstype, ret_payload); + ret = invoke_smc(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo, buf_hi, + (u32)(uintptr_t)bsizeptr, bstype, ret_payload); if (ret) debug("PL FPGA LOAD fail\n");