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 X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7ED29C433E9 for ; Sat, 23 Jan 2021 23:36:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D72722D50 for ; Sat, 23 Jan 2021 23:36:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726448AbhAWXgH (ORCPT ); Sat, 23 Jan 2021 18:36:07 -0500 Received: from mail-pj1-f52.google.com ([209.85.216.52]:52758 "EHLO mail-pj1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726284AbhAWXft (ORCPT ); Sat, 23 Jan 2021 18:35:49 -0500 Received: by mail-pj1-f52.google.com with SMTP id kx7so6097928pjb.2; Sat, 23 Jan 2021 15:35:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=y8zqB2yoEzEnz4ItpJSnoy0J2SARkRZOXZyw/BOuwJ4=; b=jwUhQdyt827r6BWcQjoPRD3+RAc9Cik7gABIIM00zwwraDM6fcqx6gijnKs0BVHIhI 7MPXAe0p3NW8zj+YObfhBvB5l0GCS2bFbcwbyQyODsUBcTB3agse1icScQIQm0V9EE8/ g6Rr/YCgiecrFBqYUhAGJJkgEj5oO9bgjRBpNKNyQ+pwbyAva3P9X54VAmpnxTVRtCFb mIFsziCR9B2IuabSdkmQYH2tHESfmThGviLLrzWnQ+Gd5xRq8bzxSqHIhnMGCNrQUk05 HRuhXvnZJXdZ1VOiyFXg/x3oDaDG1zX9k3bSKYTbRQhUjJuZ/wzngicqX18UgVK1y4fU Nb9Q== X-Gm-Message-State: AOAM531LTAd4ySiNIwLvdSh9GuAFgbIToKPNGQgcrYscIXZodU6zYJVz q73oy6C6fj6rhi/IcEAtWPDc3Vd5Dy8= X-Google-Smtp-Source: ABdhPJz5Sy+oQHLjDwYPnabWkahWhvdFu/1JHZungRkDeU02nO0Ao7JXynLf5zWnRPTRQY+7uO5bdg== X-Received: by 2002:a17:90a:245:: with SMTP id t5mr13927912pje.89.1611444908682; Sat, 23 Jan 2021 15:35:08 -0800 (PST) Received: from localhost ([2601:647:5b00:1161:a4cc:eef9:fbc0:2781]) by smtp.gmail.com with ESMTPSA id p13sm13288095pju.20.2021.01.23.15.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jan 2021 15:35:07 -0800 (PST) Date: Sat, 23 Jan 2021 15:35:06 -0800 From: Moritz Fischer To: Nava kishore Manne Cc: mdf@kernel.org, trix@redhat.com, robh+dt@kernel.org, michal.simek@xilinx.com, linux-fpga@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, git@xilinx.com, chinnikishore369@gmail.com Subject: Re: [PATCH 1/3] drivers: firmware: Add Pdi load API support Message-ID: References: <20210118024318.9530-1-nava.manne@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210118024318.9530-1-nava.manne@xilinx.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 18, 2021 at 08:13:16AM +0530, Nava kishore Manne wrote: > This patch adds load pdi api support to enable pdi/partial loading from > linux. Programmable Device Image (PDI) is combination of headers, images > and bitstream files to be loaded. Partial PDI is partial set of image/ > images to be loaded. > > Signed-off-by: Nava kishore Manne > --- > drivers/firmware/xilinx/zynqmp.c | 17 +++++++++++++++++ > include/linux/firmware/xlnx-zynqmp.h | 9 +++++++++ > 2 files changed, 26 insertions(+) > > diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c > index 7eb9958662dd..a466225b9f9e 100644 > --- a/drivers/firmware/xilinx/zynqmp.c > +++ b/drivers/firmware/xilinx/zynqmp.c > @@ -897,6 +897,23 @@ int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, > } > EXPORT_SYMBOL_GPL(zynqmp_pm_set_requirement); > > +/** > + * zynqmp_pm_load_pdi - Load and process pdi Nit: Is it pdi or PDI. Pick one :) > + * @src: Source device where PDI is located > + * @address: Pdi src address > + * > + * This function provides support to load pdi from linux > + * > + * Return: Returns status, either success or error+reason > + */ > +int zynqmp_pm_load_pdi(const u32 src, const u64 address) > +{ > + return zynqmp_pm_invoke_fn(PM_LOAD_PDI, src, > + lower_32_bits(address), > + upper_32_bits(address), 0, NULL); > +} > +EXPORT_SYMBOL_GPL(zynqmp_pm_load_pdi); > + > /** > * zynqmp_pm_aes - Access AES hardware to encrypt/decrypt the data using > * AES-GCM core. > diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h > index 2a0da841c942..87114ee645b1 100644 > --- a/include/linux/firmware/xlnx-zynqmp.h > +++ b/include/linux/firmware/xlnx-zynqmp.h > @@ -52,6 +52,9 @@ > #define ZYNQMP_PM_CAPABILITY_WAKEUP 0x4U > #define ZYNQMP_PM_CAPABILITY_UNUSABLE 0x8U > > +/* Loader commands */ > +#define PM_LOAD_PDI 0x701 > + > /* > * Firmware FPGA Manager flags > * XILINX_ZYNQMP_PM_FPGA_FULL: FPGA full reconfiguration > @@ -354,6 +357,7 @@ int zynqmp_pm_write_pggs(u32 index, u32 value); > int zynqmp_pm_read_pggs(u32 index, u32 *value); > int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype); > int zynqmp_pm_set_boot_health_status(u32 value); > +int zynqmp_pm_load_pdi(const u32 src, const u64 address); > #else > static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void) > { > @@ -538,6 +542,11 @@ static inline int zynqmp_pm_set_boot_health_status(u32 value) > { > return -ENODEV; > } > + > +static inline int zynqmp_pm_load_pdi(const u32 src, const u64 address) > +{ > + return -ENODEV; > +} > #endif > > #endif /* __FIRMWARE_ZYNQMP_H__ */ > -- > 2.18.0 > 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 X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8A6CC433E0 for ; Sat, 23 Jan 2021 23:37:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7C50522BEA for ; Sat, 23 Jan 2021 23:37:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C50522BEA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PVzdpoDK9ip87mwaeBgEOF0zQX0TwwSG1jVVbSyBr+U=; b=OmavUqLNRTvdyhhNWuRgdZIbj aH3HgAk5OBj2aCH4vyh7HGDO9O5lZfF+rY7ZENxK7wR30ZeSg4XM6UuEfJ08ar8KH6tBmGNrYLMB4 3vGGCXmRWCSAINvo1g8c1ACtNYyR5k52ta5Z/17Kw2xMguLaUJotzSUd6ak0An1Zn08qgBzOeyfaQ FJbpGKEaZKHmaJ/S79Q42PrBOcH0C7tp7CVj5GJKnxPaT7Q/+6P3zxPj2iBBK+mPc/cGoqVKwrccK 1xxVui40Z3Ae7h5f0zhhVAqgZUSKCjftgBwdiuPWaOlwRwEqNV0gAg+Ea01ca7wMKzT3PfcEs7Zhg igWB/OCvA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l3SR1-0000ry-AH; Sat, 23 Jan 2021 23:35:16 +0000 Received: from mail-pl1-f180.google.com ([209.85.214.180]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l3SQv-0000rF-Sl for linux-arm-kernel@lists.infradead.org; Sat, 23 Jan 2021 23:35:11 +0000 Received: by mail-pl1-f180.google.com with SMTP id q2so2627791plk.4 for ; Sat, 23 Jan 2021 15:35:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=y8zqB2yoEzEnz4ItpJSnoy0J2SARkRZOXZyw/BOuwJ4=; b=Oo849A8ul7AaXZS6NkJsJmMQBNCi0xAml2W496/z278bPsL6VbP6i4XAHg8nDOV1L+ mYXjbrxURfpddB/Fo67XiT7oOvJ5zPUMGsehFYkGs4Y02RR3ve4SNnSzlfTBLdooFS5L 1Te+QfNI5F5STmse3EZgZ4lGxSpe7+n2VkLLxfpfLHiLegHeXhkoGa6+D0cqDus5NH+j e3pXyJEpQw0vSM+j1Pw3cfvBtKhC2BNUPvoIZptt+6Ai0LGDJY6VKiKUZdGNaqWACr8a RAfkzBg+cfmPSJjWX+t79aMFDlwK/juDeNtmHoSgstqWxy4FbTihKdPHJdMpGkrSYSM4 SOYw== X-Gm-Message-State: AOAM530FUhCnEKRzwJKt/evxaq6Gq1exapT9o8BVMBNInvuKr8Fr/B2j gLo31r3GLiAxQiRvotTcsdo= X-Google-Smtp-Source: ABdhPJz5Sy+oQHLjDwYPnabWkahWhvdFu/1JHZungRkDeU02nO0Ao7JXynLf5zWnRPTRQY+7uO5bdg== X-Received: by 2002:a17:90a:245:: with SMTP id t5mr13927912pje.89.1611444908682; Sat, 23 Jan 2021 15:35:08 -0800 (PST) Received: from localhost ([2601:647:5b00:1161:a4cc:eef9:fbc0:2781]) by smtp.gmail.com with ESMTPSA id p13sm13288095pju.20.2021.01.23.15.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jan 2021 15:35:07 -0800 (PST) Date: Sat, 23 Jan 2021 15:35:06 -0800 From: Moritz Fischer To: Nava kishore Manne Subject: Re: [PATCH 1/3] drivers: firmware: Add Pdi load API support Message-ID: References: <20210118024318.9530-1-nava.manne@xilinx.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210118024318.9530-1-nava.manne@xilinx.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210123_183510_218952_B066DA5E X-CRM114-Status: GOOD ( 21.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, trix@redhat.com, linux-fpga@vger.kernel.org, michal.simek@xilinx.com, linux-kernel@vger.kernel.org, robh+dt@kernel.org, mdf@kernel.org, git@xilinx.com, linux-arm-kernel@lists.infradead.org, chinnikishore369@gmail.com 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 On Mon, Jan 18, 2021 at 08:13:16AM +0530, Nava kishore Manne wrote: > This patch adds load pdi api support to enable pdi/partial loading from > linux. Programmable Device Image (PDI) is combination of headers, images > and bitstream files to be loaded. Partial PDI is partial set of image/ > images to be loaded. > > Signed-off-by: Nava kishore Manne > --- > drivers/firmware/xilinx/zynqmp.c | 17 +++++++++++++++++ > include/linux/firmware/xlnx-zynqmp.h | 9 +++++++++ > 2 files changed, 26 insertions(+) > > diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c > index 7eb9958662dd..a466225b9f9e 100644 > --- a/drivers/firmware/xilinx/zynqmp.c > +++ b/drivers/firmware/xilinx/zynqmp.c > @@ -897,6 +897,23 @@ int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, > } > EXPORT_SYMBOL_GPL(zynqmp_pm_set_requirement); > > +/** > + * zynqmp_pm_load_pdi - Load and process pdi Nit: Is it pdi or PDI. Pick one :) > + * @src: Source device where PDI is located > + * @address: Pdi src address > + * > + * This function provides support to load pdi from linux > + * > + * Return: Returns status, either success or error+reason > + */ > +int zynqmp_pm_load_pdi(const u32 src, const u64 address) > +{ > + return zynqmp_pm_invoke_fn(PM_LOAD_PDI, src, > + lower_32_bits(address), > + upper_32_bits(address), 0, NULL); > +} > +EXPORT_SYMBOL_GPL(zynqmp_pm_load_pdi); > + > /** > * zynqmp_pm_aes - Access AES hardware to encrypt/decrypt the data using > * AES-GCM core. > diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h > index 2a0da841c942..87114ee645b1 100644 > --- a/include/linux/firmware/xlnx-zynqmp.h > +++ b/include/linux/firmware/xlnx-zynqmp.h > @@ -52,6 +52,9 @@ > #define ZYNQMP_PM_CAPABILITY_WAKEUP 0x4U > #define ZYNQMP_PM_CAPABILITY_UNUSABLE 0x8U > > +/* Loader commands */ > +#define PM_LOAD_PDI 0x701 > + > /* > * Firmware FPGA Manager flags > * XILINX_ZYNQMP_PM_FPGA_FULL: FPGA full reconfiguration > @@ -354,6 +357,7 @@ int zynqmp_pm_write_pggs(u32 index, u32 value); > int zynqmp_pm_read_pggs(u32 index, u32 *value); > int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype); > int zynqmp_pm_set_boot_health_status(u32 value); > +int zynqmp_pm_load_pdi(const u32 src, const u64 address); > #else > static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void) > { > @@ -538,6 +542,11 @@ static inline int zynqmp_pm_set_boot_health_status(u32 value) > { > return -ENODEV; > } > + > +static inline int zynqmp_pm_load_pdi(const u32 src, const u64 address) > +{ > + return -ENODEV; > +} > #endif > > #endif /* __FIRMWARE_ZYNQMP_H__ */ > -- > 2.18.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel