From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 00E52C43334 for ; Wed, 22 Jun 2022 12:15:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:In-Reply-To: Date:References:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=J5ROrAKzIm5AvPnkJY64yvtXBUW0e/W9ahaj3EAdo5Y=; b=WWDB9w2R/HqaoY 2m+zBMQDuy9QRoUdw0H5I455jzj+Oh33/4qpm7iQ0VUNKUado+Y9s+7dtxaQlRgc9L/aO1XsuDlOv XAoIxel+J1w9ht2ocqAnPPQXbwoN8VUikeAvFN3fUcTaZTFI8gS4F3etZfrEX+6S+zylBuBAK1jFp OV0z1a+y3m/1VDYlFmWzWacn3m/TtGMqUmw46BEKVB7cE5sM6OZfee64JopjDx8B1C/NZLADTloS2 D2dDjGiAoShS42DeBCOsEr6FQ+kSkwlCwFamzj6qAzP/gaJEawCukGyAk3bBnOEJKlgnUzqn6HjbS FdMGlqd8bFuWO6sCBqIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3zFZ-00AJW0-3m; Wed, 22 Jun 2022 12:14:25 +0000 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3zFV-00AJVC-6k for linux-arm-kernel@lists.infradead.org; Wed, 22 Jun 2022 12:14:23 +0000 Received: (Authenticated sender: peter@korsgaard.com) by mail.gandi.net (Postfix) with ESMTPSA id 157A0C0004; Wed, 22 Jun 2022 12:14:07 +0000 (UTC) Received: from peko by dell.be.48ers.dk with local (Exim 4.94.2) (envelope-from ) id 1o3zFG-0099lr-Vg; Wed, 22 Jun 2022 14:14:06 +0200 From: Peter Korsgaard To: Nava kishore Manne Cc: , , , , , , , , , , , , , , , Subject: Re: [PATCH v2 2/3] firmware: xilinx: Add pm api function for PL readback References: <20220621092833.1057408-1-nava.manne@xilinx.com> <20220621092833.1057408-3-nava.manne@xilinx.com> Date: Wed, 22 Jun 2022 14:14:06 +0200 In-Reply-To: <20220621092833.1057408-3-nava.manne@xilinx.com> (Nava kishore Manne's message of "Tue, 21 Jun 2022 14:58:32 +0530") Message-ID: <87ilos520h.fsf@dell.be.48ers.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220622_051421_439504_6CEF96DA X-CRM114-Status: GOOD ( 18.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org >>>>> "Nava" == Nava kishore Manne writes: > Adds PM API for performing PL configuration readback. > It provides an interface to the pmufw to readback the > FPGA configuration registers as well as configuration > data. > For more detailed info related to the configuration > registers and configuration data refer ug570. > Signed-off-by: Nava kishore Manne > --- > Changes for v2: > - None. > drivers/firmware/xilinx/zynqmp.c | 33 ++++++++++++++++++++++++++++ > include/linux/firmware/xlnx-zynqmp.h | 14 ++++++++++++ > 2 files changed, 47 insertions(+) > diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c > index 7977a494a651..40b99299b662 100644 > --- a/drivers/firmware/xilinx/zynqmp.c > +++ b/drivers/firmware/xilinx/zynqmp.c > @@ -927,6 +927,39 @@ int zynqmp_pm_fpga_get_status(u32 *value) > } > EXPORT_SYMBOL_GPL(zynqmp_pm_fpga_get_status); > +/** > + * zynqmp_pm_fpga_read - Perform the fpga configuration readback > + * @reg_numframes: Configuration register offset (or) Number of frames to read An offset OR a length? That sounds odd. > + * @phys_address: Physical Address of the buffer > + * @readback_type: Type of fpga readback operation > + * 0 - FPGA configuration register readback > + * 1 - FPGA configuration data readback readback_type is a boolean, so how about calling it `bool data` or something like that? > + * @value: Value to read what is the relation between phys_address and this value output argument? > + * > + * This function provides access to xilfpga library to perform > + * fpga configuration readback. > + * > + * Return: Returns status, either success or error+reason > + */ > +int zynqmp_pm_fpga_read(const u32 reg_numframes, const phys_addr_t phys_address, > + bool readback_type, u32 *value) > +{ > + u32 ret_payload[PAYLOAD_ARG_CNT]; > + int ret; > + > + if (!value) > + return -EINVAL; > + > + ret = zynqmp_pm_invoke_fn(PM_FPGA_READ, reg_numframes, > + lower_32_bits(phys_address), > + upper_32_bits(phys_address), readback_type, You are adding PM_FPGA_READ_CONFIG_ defines, so how about using them, E.G. data ? PM_FPGA_READ_CONFIG_DATA : PM_FPGA_READ_CONFIG_REG -- Bye, Peter Korsgaard _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel