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;
+}