[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8dd847c8-6380-4364-ba47-c6c014f0d23b@amd.com>
Date: Sun, 26 Jan 2025 11:50:38 -0800
From: Yidong Zhang <yidong.zhang@....com>
To: Xu Yilun <yilun.xu@...ux.intel.com>
CC: <linux-kernel@...r.kernel.org>, <linux-fpga@...r.kernel.org>,
<mdf@...nel.org>, <hao.wu@...el.com>, <yilun.xu@...el.com>,
<lizhi.hou@....com>, DMG Karthik <Karthik.DMG@....com>, Nishad Saraf
<nishads@....com>, Prapul Krishnamurthy <prapulk@....com>, Hayden Laccabue
<hayden.laccabue@....com>
Subject: Re: [PATCH V2 1/4] drivers/fpga/amd: Add new driver amd versal-pci
On 1/26/25 01:24, Xu Yilun wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
>> +static int versal_pci_program_axlf(struct versal_pci_device *vdev, char *data, size_t size)
>> +{
>> + const struct axlf *axlf = (struct axlf *)data;
>> + struct fpga_image_info *image_info;
>> + int ret;
>> +
>> + image_info = fpga_image_info_alloc(&vdev->pdev->dev);
>> + if (!image_info)
>> + return -ENOMEM;
>> +
>> + image_info->count = axlf->header.length;
>> + image_info->buf = (char *)axlf;
>> +
>> + ret = fpga_mgr_load(vdev->fdev->mgr, image_info);
>
> I see, but this is not working like this. fpga_mgr_load() is intended to be
> called by fpga_region, any reprogramming API should come from fpga_region,
> and fpga_region could provide uAPI for userspace reprogramming.
>
> If your driver act both as a fpga_mgr backend and a fpga_mgr kAPI user,
> then you don't have to bother using fpga framework at all.
The versal-pci is more like a util driver that handles requests from the
separate userPF driver.
Thanks,
David
>
> Thanks,
> Yilun
>
>> + if (ret) {
>> + vdev_err(vdev, "failed to load xclbin: %d", ret);
>> + goto exit;
>> + }
>> +
>> + vdev_info(vdev, "Downloaded axlf %pUb of size %zu Bytes", &axlf->header.uuid, size);
>> + uuid_copy(&vdev->xclbin_uuid, &axlf->header.uuid);
>> +
>> +exit:
>> + fpga_image_info_free(image_info);
>> +
>> + return ret;
>> +}
Powered by blists - more mailing lists