Lines Matching full:fpga
3 * FPGA Region - Device Tree support for FPGA programming under Linux
8 #include <linux/fpga/fpga-bridge.h>
9 #include <linux/fpga/fpga-mgr.h>
10 #include <linux/fpga/fpga-region.h>
20 { .compatible = "fpga-region", },
26 * of_fpga_region_find - find FPGA region
27 * @np: device node of FPGA Region
31 * Returns FPGA Region struct or NULL
39 * of_fpga_region_get_mgr - get reference for FPGA manager
40 * @np: device node of FPGA region
42 * Get FPGA Manager from "fpga-mgr" property or from ancestor region.
46 * Return: fpga manager struct or IS_ERR() condition containing error code.
55 if (of_device_is_compatible(np, "fpga-region")) { in of_fpga_region_get_mgr()
56 mgr_node = of_parse_phandle(np, "fpga-mgr", 0); in of_fpga_region_get_mgr()
73 * @region: FPGA region
76 * specified by "fpga-bridges" property. Note that the
107 br = of_parse_phandle(info->overlay, "fpga-bridges", 0); in of_fpga_region_get_bridges()
116 br = of_parse_phandle(np, "fpga-bridges", i); in of_fpga_region_get_bridges()
145 * If the overlay adds child FPGA regions, they are not allowed to have
148 * Return 0 for OK or -EINVAL if child FPGA region adds firmware-name.
172 pr_err("firmware-name not allowed in child FPGA region: %pOF", in child_regions_with_firmware()
181 * @region: FPGA region
182 * @overlay: overlay applied to the FPGA region
184 * Given an overlay applied to a FPGA region, parse the FPGA image specific
188 * NULL if overlay doesn't direct us to program the FPGA.
207 * Reject overlay if child FPGA Regions added in the overlay have in of_fpga_region_parse_ov()
208 * firmware-name property (would mean that an FPGA region that has in of_fpga_region_parse_ov()
209 * not been added to the live tree yet is doing FPGA programming). in of_fpga_region_parse_ov()
221 /* Read FPGA region properties from the overlay */ in of_fpga_region_parse_ov()
222 if (of_property_read_bool(overlay, "partial-fpga-config")) in of_fpga_region_parse_ov()
225 if (of_property_read_bool(overlay, "external-fpga-config")) in of_fpga_region_parse_ov()
228 if (of_property_read_bool(overlay, "encrypted-fpga-config")) in of_fpga_region_parse_ov()
248 /* If overlay is not programming the FPGA, don't need FPGA image info */ in of_fpga_region_parse_ov()
255 * If overlay informs us FPGA was externally programmed, specifying in of_fpga_region_parse_ov()
259 dev_err(dev, "error: specified firmware and external-fpga-config"); in of_fpga_region_parse_ov()
273 * @region: FPGA region that the overlay was applied to
276 * Called when an overlay targeted to a FPGA Region is about to be applied.
277 * Parses the overlay for properties that influence how the FPGA will be
278 * programmed and does some checking. If the checks pass, programs the FPGA.
295 /* If overlay doesn't program the FPGA, accept it anyway. */ in of_fpga_region_notify_pre_apply()
318 * @region: FPGA region that was targeted by the overlay that was removed
322 * FPGA region.
339 * This notifier handles programming a FPGA when a "firmware-name" property is
340 * added to a fpga-region.
342 * Returns NOTIFY_OK or error if FPGA programming fails.
403 /* Find the FPGA mgr specified by region or parent region. */ in of_fpga_region_probe()
421 dev_info(dev, "FPGA Region probed\n"); in of_fpga_region_probe()
445 .name = "of-fpga-region",
482 MODULE_DESCRIPTION("FPGA Region");