Hi Michael, On Mon, May 19, 2025 at 07:03:44AM +0000, Michael Graichen wrote: > This adds support to programm the PL part of the Zynq-7000 SoC, > It adds the 'zynq_fpga_manager' so we can use > > firmwareload -l > firmwareload -t zynq-fpga-manager /mnt/mmc0.0/design_1_wrapper.bit > > to programm the PL. > > + > + buf_aligned = dma_alloc_coherent(DMA_DEVICE_BROKEN, body_length, > DMA_ADDRESS_BROKEN); > + if (!buf_aligned) { > + status = -ENOBUFS; > + goto err_free; > + } > + > +#ifdef CONFIG_FIRMWARE_ZYNQMP_FPGA > + if (!(mgr->features & ZYNQMP_PM_FEATURE_SIZE_NOT_NEEDED)) { > + buf_size = dma_alloc_coherent(sizeof(*buf_size), > + DMA_ADDRESS_BROKEN); > + if (!buf_size) { > + status = -ENOBUFS; > + goto err_free; > + } > + *buf_size = body_length; > + } > + > + if (!(mgr->features & ZYNQMP_PM_FEATURE_BYTE_ORDER_IRREL) && > + byte_order == XILINX_BYTE_ORDER_BIN) > + copy_words_swapped((u32 *)buf_aligned, body, > + body_length / sizeof(u32)); > + else > + memcpy((u32 *)buf_aligned, body, body_length); > + > + addr = (u64)buf_aligned; > + > + /* we do not provide a header */ > + flags |= ZYNQMP_FPGA_BIT_ONLY_BIN; > + > + if (!(mgr->features & ZYNQMP_PM_FEATURE_SIZE_NOT_NEEDED) && buf_size) { > + status = mgr->eemi_ops->fpga_load(addr, > + (u32)(uintptr_t)buf_size, > + flags); > + dma_free_coherent(buf_size, 0, sizeof(*buf_size)); > + } else { > + status = mgr->eemi_ops->fpga_load(addr, (u32)(body_length), > + flags); > + } > +#endif > +#ifdef CONFIG_FIRMWARE_ZYNQ7000_FPGA
The ZYNQ7000 part should ideally be integrated into the existing driver using runtime decisions instead of compile time decisions. If that's not feasible please just drop everything inside CONFIG_FIRMWARE_ZYNQMP_FPGA and drop the #ifdef CONFIG_FIRMWARE_ZYNQ7000_FPGA. > + > +static struct of_device_id zynq_fpga_id_table[] = { > + { .compatible = "xlnx,zynqmp-pcap-fpga" }, > + { .compatible = "xlnx,zynq-devcfg-1.0" }, > + { /* sentinel */ } > +}; The compatible should then only match the part the driver actually supports. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |