+ const char *compatible;
+ int ret;
+ int devnum = 0;
+ int flags = 0;
+
+ debug("FPGA bitstream at: %x, size: %x\n",
+ (u32)fpga_image->load_addr, fpga_image->size);
+
+ compatible = fdt_getprop(ctx->fit, node, "compatible", NULL);
+ if (!compatible) {
+ warn_deprecated("'fpga' image without 'compatible' property");
+ } else {
+ if (CONFIG_IS_ENABLED(FPGA_LOAD_SECURE))
+ flags = fpga_compatible2flag(devnum, compatible);
+ if (strcmp(compatible, "u-boot,fpga-legacy"))
+ debug("Ignoring compatible = %s property\n",
+ compatible);
+ }
+
+ ret = fpga_load(devnum, (void *)fpga_image->load_addr,
+ fpga_image->size, BIT_FULL, flags);
+ if (ret) {
+ printf("%s: Cannot load the image to the FPGA\n", __func__);
+ return ret;
+ }
+
+ puts("FPGA image loaded from FIT\n");
+
+ return 0;
+}
+
+static int spl_fit_load_fpga(struct spl_fit_info *ctx,
+ struct spl_load_info *info, ulong sector)
+{
+ int node, ret;
+
+ struct spl_image_info fpga_image = {
+ .load_addr = 0,
+ };
+
+ node = spl_fit_get_image_node(ctx, "fpga", 0);
+ if (node < 0)
+ return node;
+
+ warn_deprecated("'fpga' property in config node. Use 'loadables'");
+
+ /* Load the image and set up the fpga_image structure */
+ ret = spl_load_fit_image(info, sector, ctx, node, &fpga_image);
+ if (ret) {
+ printf("%s: Cannot load the FPGA: %i\n", __func__, ret);
+ return ret;
+ }
+
+ return spl_fit_upload_fpga(ctx, node, &fpga_image);
+}
+
+static int spl_simple_fit_read(struct spl_fit_info *ctx,
+ struct spl_load_info *info, ulong sector,
+ const void *fit_header)
+{
+ unsigned long count, size;