Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4755293iog; Wed, 22 Jun 2022 05:21:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tsqCckXJKAmehASxDqps1drJB2MDr3rA0se0d/2JmGloJ3TWuS6s7f+224wepgiHREkTH5 X-Received: by 2002:a05:6402:3586:b0:42e:2a6a:218b with SMTP id y6-20020a056402358600b0042e2a6a218bmr3844449edc.208.1655900506067; Wed, 22 Jun 2022 05:21:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655900506; cv=none; d=google.com; s=arc-20160816; b=KLdJWqi5FgNO9Fp1k8cU6kQKMf12U6vlXNB5OIyiGJKCVpMfVxuGXyAFl/1HGk7foy DFzdYZdcZ9oUE4pqOIhuSh5GE/36lFB/ORQStmA6VzCNoGtz13RORhgG2uhcUCz5KJy0 opgAnRtaCWNN6xA/ye3iOdNzO0EnZHEiGFQhkUFqCxHwDHIpER2nWo/SOPddBotlZHFZ WjeoNjmyOEAS+dkVRDF5V/id30mEW374gAOcytGprS0dekt2744aK7zmEmPGoDN3xTe5 cUkPboYpTbq/6/pyhYSYRPCI58N0N6WSQziUwN0Zyu9EDLv256LqikhMpv2dlwS337JV vuMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from; bh=bEeYfZaydjCejm5oQOhbGlIKbujgqfD5RTMt4RBlvZY=; b=CV+7e/vdaeXVMEIXwIFBwLrv1hGMqSN8yydN+FULsak0ZnkagbYZgOmEFAKg5J0yRA 3BAz7UFEDD13rELEKI2AO+sZHJol2HvIEsCfUe1/ElWLwfB6exbzvDKYikEwlNxrSXR8 WaXDEFoBkJpw97zOtPtcbFm8dl2BDc8kTr68ldLZF+k9ONfoByde5nSB+kpPP4SPkj7n 2afxHaFVNUVfd5cUxUtZZJlMWjepWCwAFu4X+piUJhe6MPCEoFvPDeuxRLklOrBKpjgC 4i7gg/sGiV+VtbZwqyDWuqwEoyg/eHTbTQr3NbYGfQAiRjxWZnw066othGbb/mFLS6jc 2fhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp22-20020a170906c15600b006feb48d803csi20359087ejc.250.2022.06.22.05.21.19; Wed, 22 Jun 2022 05:21:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358301AbiFVMPa (ORCPT + 99 others); Wed, 22 Jun 2022 08:15:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358158AbiFVMOP (ORCPT ); Wed, 22 Jun 2022 08:14:15 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81A4118B20; Wed, 22 Jun 2022 05:14:13 -0700 (PDT) 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 Content-Type: text/plain X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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