[PATCH v8 1/5] drivers: firmware: Add PDI load API support

Nava kishore Manne navam at xilinx.com
Thu Jul 8 04:40:26 PDT 2021


Hi Tom,

	Please fix my response inline.

> -----Original Message-----
> From: Tom Rix <trix at redhat.com>
> Sent: Wednesday, July 7, 2021 2:34 AM
> To: Nava kishore Manne <navam at xilinx.com>; robh+dt at kernel.org; Michal
> Simek <michals at xilinx.com>; mdf at kernel.org; arnd at arndb.de; Rajan Vaja
> <RAJANV at xilinx.com>; gregkh at linuxfoundation.org; Amit Sunil Dhamne
> <amitsuni at xlnx.xilinx.com>; Tejas Patel <tejasp at xlnx.xilinx.com>;
> zou_wei at huawei.com; Sai Krishna Potthuri <lakshmis at xilinx.com>; Ravi
> Patel <ravipate at xlnx.xilinx.com>; iwamatsu at nigauri.org; Jiaying Liang
> <jliang at xilinx.com>; devicetree at vger.kernel.org; linux-arm-
> kernel at lists.infradead.org; linux-kernel at vger.kernel.org; linux-
> fpga at vger.kernel.org; git <git at xilinx.com>; chinnikishore369 at gmail.com
> Subject: Re: [PATCH v8 1/5] drivers: firmware: Add PDI load API support
> 
> 
> On 6/26/21 8:52 AM, Nava kishore Manne wrote:
> > This patch adds load PDI API support to enable full/partial PDI
> > loading from linux. Programmable Device Image (PDI) is combination of
> > headers, images and bitstream files to be loaded.
> >
> > Signed-off-by: Nava kishore Manne <nava.manne at xilinx.com>
> > Reviewed-by: Moritz Fischer <mdf at kernel.org>
> > ---
> > Changes for v2:
> >                -Updated API Doc and commit msg.
> >                 No functional changes.
> >
> > Changes for v3:
> >                -None.
> >
> > Changes for v4:
> >                -Rebased the changes on linux-next.
> >                 No functional changes
> >
> > Changes for v5:
> >                -None.
> >
> > Changes for v6:
> >                -None.
> >
> > Changes for v7:
> >                -None.
> >
> > Changes for v8:
> >                 -None.
> >
> >   drivers/firmware/xilinx/zynqmp.c     | 17 +++++++++++++++++
> >   include/linux/firmware/xlnx-zynqmp.h | 10 ++++++++++
> >   2 files changed, 27 insertions(+)
> >
> > diff --git a/drivers/firmware/xilinx/zynqmp.c
> > b/drivers/firmware/xilinx/zynqmp.c
> > index 15b138326ecc..2db571da9ad8 100644
> > --- a/drivers/firmware/xilinx/zynqmp.c
> > +++ b/drivers/firmware/xilinx/zynqmp.c
> > @@ -1011,6 +1011,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
> > + * @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 9d1a5c175065..56b426fe020c 100644
> > --- a/include/linux/firmware/xlnx-zynqmp.h
> > +++ b/include/linux/firmware/xlnx-zynqmp.h
> > @@ -52,6 +52,10 @@
> >   #define	ZYNQMP_PM_CAPABILITY_WAKEUP	0x4U
> >   #define	ZYNQMP_PM_CAPABILITY_UNUSABLE	0x8U
> >
> > +/* Loader commands */
> > +#define PM_LOAD_PDI	0x701
> This should be defined in enum pm_api_id
> > +#define PDI_SRC_DDR	0xF
> 
> This is only used by versal_fpga_ops_write(), consider moving the #define to
> versal-fpga.c
> 

Yes, currently only versal_fpga_write() is using this #define but it’s a generic thing for Versal platform
That’s why we placed it here.

Regards,
Navakishore. 



More information about the linux-arm-kernel mailing list