All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] SPL: FIT: Bring the SPL_LOAD_FIT path in line with documentation
@ 2021-03-29 17:05 Alexandru Gagniuc
  2021-03-29 17:05 ` [PATCH v2 1/7] spl: fit: Don't overwrite previous loadable if "load" is missing Alexandru Gagniuc
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Alexandru Gagniuc @ 2021-03-29 17:05 UTC (permalink / raw)
  To: u-boot

When I wrote commit 4afc4f37c70e ("doc: FIT image: Clarify format and
simplify syntax"), I did not expect it to go through without
objection. I didn't also write the code to go along with it. This
series fixes that by updating one of the three FIT code paths to be
compliant.

There are three code paths that deal with loading a FIT:
  * ( )'bootm' command
  * (x) SPL_LOAD_FIT
  * ( ) SPL_LOAD_FIT_FULL

This series deals with SPL_LOAD_FIT.

I chose not to fix every nook and cranny because nobody is using those
corner cases -- as evidenced by the lack of support. Known limitations
are documented and clearly visible in the Kconfig menu.

Changes since v1:
  - Replace NULL with 0 in comment for spl_load_fit_image().
  - Updated Kconfig description for SPL_LOAD_FIT (add "property" word)
  - Remove middle printf in warn_deprecated()
  - Add newline before return in spl_fit_upload_fpga()

Alexandru Gagniuc (7):
  spl: fit: Don't overwrite previous loadable if "load" is missing
  doc: FIT image: Introduce "u-boot,fpga-legacy" property
  spl: fit: Move FPGA loading code to separate functions
  spl: fit: Warn if FIT contains "fpga" property in config node
  spl: fit: Support loading FPGA images from list of "loadables"
  Kconfig: Document the limitations of the simple SPL_LOAD_FIT path
  doc: FIT image: Update FPGA example to make use of "loadables"

 common/Kconfig.boot                   |  10 +++
 common/spl/spl_fit.c                  | 113 ++++++++++++++++++++------
 doc/uImage.FIT/multi-with-fpga.its    |   3 +-
 doc/uImage.FIT/source_file_format.txt |   1 +
 4 files changed, 99 insertions(+), 28 deletions(-)

--
2.26.3

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2 1/7] spl: fit: Don't overwrite previous loadable if "load" is missing
  2021-03-29 17:05 [PATCH v2 0/7] SPL: FIT: Bring the SPL_LOAD_FIT path in line with documentation Alexandru Gagniuc
@ 2021-03-29 17:05 ` Alexandru Gagniuc
  2021-04-16 12:25   ` Tom Rini
  2021-03-29 17:05 ` [PATCH v2 2/7] doc: FIT image: Introduce "u-boot, fpga-legacy" property Alexandru Gagniuc
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Alexandru Gagniuc @ 2021-03-29 17:05 UTC (permalink / raw)
  To: u-boot

spl_load_fit_image() will try to load an image at the address given
in the "load" property. Absent such property, it uses

	image_info->load_addr

Correct use of this is demonstrated in spl_fit_append_fdt(), which
resets the 'load_addr' before each spl_load_fit_image() call.

On the other hand loading "loadables" loop in spl_load_simple_fit()
completely ignores this. It re-uses the same structure, but doesn't
reset load_addr. If loadable [i] does not have a "load" property, its
load address defaults to load_addr, which still contains the address
of loadable [i - 1].

A simple solution is to treat NULL as an invalid load address. The
caller can set load_addr = 0 to request an abort if the "load"
property is absent.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
 common/spl/spl_fit.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 75c8ff065b..57bcd2b9f1 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -223,7 +223,7 @@ static int get_aligned_image_size(struct spl_load_info *info, int data_size,
  * @image_info:	will be filled with information about the loaded image
  *		If the FIT node does not contain a "load" (address) property,
  *		the image gets loaded to the address pointed to by the
- *		load_addr member in this struct.
+ *		load_addr member in this struct, if load_addr is not 0
  *
  * Return:	0 on success or a negative error number.
  */
@@ -258,8 +258,14 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector,
 		debug("%s ", genimg_get_comp_name(image_comp));
 	}
 
-	if (fit_image_get_load(fit, node, &load_addr))
+	if (fit_image_get_load(fit, node, &load_addr)) {
+		if (!image_info->load_addr) {
+			printf("Can't load %s: No load address and no buffer\n",
+			       fit_get_name(fit, node, NULL));
+			return -ENOBUFS;
+		}
 		load_addr = image_info->load_addr;
+	}
 
 	if (!fit_image_get_data_position(fit, node, &offset)) {
 		external_data = true;
@@ -697,6 +703,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
 		if (firmware_node == node)
 			continue;
 
+		image_info.load_addr = 0;
 		ret = spl_load_fit_image(info, sector, &ctx, node, &image_info);
 		if (ret < 0) {
 			printf("%s: can't load image loadables index %d (ret = %d)\n",
-- 
2.26.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 2/7] doc: FIT image: Introduce "u-boot, fpga-legacy" property
  2021-03-29 17:05 [PATCH v2 0/7] SPL: FIT: Bring the SPL_LOAD_FIT path in line with documentation Alexandru Gagniuc
  2021-03-29 17:05 ` [PATCH v2 1/7] spl: fit: Don't overwrite previous loadable if "load" is missing Alexandru Gagniuc
@ 2021-03-29 17:05 ` Alexandru Gagniuc
  2021-04-16 12:25   ` Tom Rini
  2021-03-29 17:05 ` [PATCH v2 3/7] spl: fit: Move FPGA loading code to separate functions Alexandru Gagniuc
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Alexandru Gagniuc @ 2021-03-29 17:05 UTC (permalink / raw)
  To: u-boot

Commit 4afc4f37c70e ("doc: FIT image: Clarify format and simplify
syntax") introduced a "compatible" property for loadable images.
It did not define its contents. Use "u-boot,fpga-legacy" compatible
string to specify that fpga_load() should be used to load the image.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
---
 doc/uImage.FIT/source_file_format.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/uImage.FIT/source_file_format.txt b/doc/uImage.FIT/source_file_format.txt
index 00ed3ebe93..f93ac6d1c7 100644
--- a/doc/uImage.FIT/source_file_format.txt
+++ b/doc/uImage.FIT/source_file_format.txt
@@ -184,6 +184,7 @@ the '/images' node should have the following layout:
     Mandatory for types: "firmware", and "kernel".
   - compatible : compatible method for loading image.
     Mandatory for types: "fpga", and images that do not specify a load address.
+    To use the generic fpga loading routine, use "u-boot,fpga-legacy".
 
   Optional nodes:
   - hash-1 : Each hash sub-node represents separate hash or checksum
-- 
2.26.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 3/7] spl: fit: Move FPGA loading code to separate functions
  2021-03-29 17:05 [PATCH v2 0/7] SPL: FIT: Bring the SPL_LOAD_FIT path in line with documentation Alexandru Gagniuc
  2021-03-29 17:05 ` [PATCH v2 1/7] spl: fit: Don't overwrite previous loadable if "load" is missing Alexandru Gagniuc
  2021-03-29 17:05 ` [PATCH v2 2/7] doc: FIT image: Introduce "u-boot, fpga-legacy" property Alexandru Gagniuc
@ 2021-03-29 17:05 ` Alexandru Gagniuc
  2021-04-16 12:25   ` Tom Rini
  2021-03-29 17:05 ` [PATCH v2 4/7] spl: fit: Warn if FIT contains "fpga" property in config node Alexandru Gagniuc
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Alexandru Gagniuc @ 2021-03-29 17:05 UTC (permalink / raw)
  To: u-boot

The FPGA loading code in spl_simple_fit_read() can easily be separated
from the rest of the logic. It is split into two functions instead of
one because spl_fit_upload_fpga() is used in a subsequent patch.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
 common/spl/spl_fit.c | 70 ++++++++++++++++++++++++++++----------------
 1 file changed, 45 insertions(+), 25 deletions(-)

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 57bcd2b9f1..6e9d9808b3 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -526,6 +526,49 @@ __weak bool spl_load_simple_fit_skip_processing(void)
 	return false;
 }
 
+static int spl_fit_upload_fpga(struct spl_fit_info *ctx, int node,
+			       struct spl_image_info *fpga_image)
+{
+	int ret;
+
+	debug("FPGA bitstream at: %x, size: %x\n",
+	      (u32)fpga_image->load_addr, fpga_image->size);
+
+	ret = fpga_load(0, (void *)fpga_image->load_addr, fpga_image->size,
+			BIT_FULL);
+	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;
+
+	/* 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)
@@ -609,31 +652,8 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
 	if (ret < 0)
 		return ret;
 
-#ifdef CONFIG_SPL_FPGA
-	node = spl_fit_get_image_node(&ctx, "fpga", 0);
-	if (node >= 0) {
-		/* Load the image and set up the spl_image structure */
-		ret = spl_load_fit_image(info, sector, &ctx, node, spl_image);
-		if (ret) {
-			printf("%s: Cannot load the FPGA: %i\n", __func__, ret);
-			return ret;
-		}
-
-		debug("FPGA bitstream at: %x, size: %x\n",
-		      (u32)spl_image->load_addr, spl_image->size);
-
-		ret = fpga_load(0, (const void *)spl_image->load_addr,
-				spl_image->size, BIT_FULL);
-		if (ret) {
-			printf("%s: Cannot load the image to the FPGA\n",
-			       __func__);
-			return ret;
-		}
-
-		puts("FPGA image loaded from FIT\n");
-		node = -1;
-	}
-#endif
+	if (IS_ENABLED(CONFIG_SPL_FPGA))
+		spl_fit_load_fpga(&ctx, info, sector);
 
 	/*
 	 * Find the U-Boot image using the following search order:
-- 
2.26.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 4/7] spl: fit: Warn if FIT contains "fpga" property in config node
  2021-03-29 17:05 [PATCH v2 0/7] SPL: FIT: Bring the SPL_LOAD_FIT path in line with documentation Alexandru Gagniuc
                   ` (2 preceding siblings ...)
  2021-03-29 17:05 ` [PATCH v2 3/7] spl: fit: Move FPGA loading code to separate functions Alexandru Gagniuc
@ 2021-03-29 17:05 ` Alexandru Gagniuc
  2021-04-16 12:25   ` Tom Rini
  2021-03-29 17:05 ` [PATCH v2 5/7] spl: fit: Support loading FPGA images from list of "loadables" Alexandru Gagniuc
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Alexandru Gagniuc @ 2021-03-29 17:05 UTC (permalink / raw)
  To: u-boot

Commit 4afc4f37c70e ("doc: FIT image: Clarify format and simplify
syntax") requires that FPGA images be referenced through the
"loadables" in the config node. This means that "fpga" properties in
config nodes are deprecated.

Given that there are likely FIT images which use "fpga", let's not
break those right away. Print a warning message that such use is
deprecated, and give users a couple of releases to update their

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
---
 common/spl/spl_fit.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 6e9d9808b3..1a6c4a0ea2 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -526,6 +526,12 @@ __weak bool spl_load_simple_fit_skip_processing(void)
 	return false;
 }
 
+static void warn_deprecated(const char *msg)
+{
+	printf("DEPRECATED: %s\n", msg);
+	printf("\tSee doc/uImage.FIT/source_file_format.txt\n");
+}
+
 static int spl_fit_upload_fpga(struct spl_fit_info *ctx, int node,
 			       struct spl_image_info *fpga_image)
 {
@@ -559,6 +565,8 @@ static int spl_fit_load_fpga(struct spl_fit_info *ctx,
 	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) {
-- 
2.26.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 5/7] spl: fit: Support loading FPGA images from list of "loadables"
  2021-03-29 17:05 [PATCH v2 0/7] SPL: FIT: Bring the SPL_LOAD_FIT path in line with documentation Alexandru Gagniuc
                   ` (3 preceding siblings ...)
  2021-03-29 17:05 ` [PATCH v2 4/7] spl: fit: Warn if FIT contains "fpga" property in config node Alexandru Gagniuc
@ 2021-03-29 17:05 ` Alexandru Gagniuc
  2021-04-16 12:25   ` Tom Rini
  2021-03-29 17:05 ` [PATCH v2 6/7] Kconfig: Document the limitations of the simple SPL_LOAD_FIT path Alexandru Gagniuc
  2021-03-29 17:05 ` [PATCH v2 7/7] doc: FIT image: Update FPGA example to make use of "loadables" Alexandru Gagniuc
  6 siblings, 1 reply; 15+ messages in thread
From: Alexandru Gagniuc @ 2021-03-29 17:05 UTC (permalink / raw)
  To: u-boot

Commit 4afc4f37c70e ("doc: FIT image: Clarify format and simplify
syntax") and delegated FPGA images to be added via the list of
"loadables" in lieu of the "fpga" property. Now actually implement
this in code.

Note that the "compatible" property is ignored for the time being, as
implementing "compatible" loading is beyond the scope of this change.
However, "u-boot,fpga-legacy" is accepted without warning.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
---
 common/spl/spl_fit.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 1a6c4a0ea2..9945ee1d7f 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -477,6 +477,20 @@ static int spl_fit_record_loadable(const struct spl_fit_info *ctx, int index,
 	return ret;
 }
 
+static int spl_fit_image_is_fpga(const void *fit, int node)
+{
+	const char *type;
+
+	if (!IS_ENABLED(CONFIG_SPL_FPGA))
+		return 0;
+
+	type = fdt_getprop(fit, node, FIT_TYPE_PROP, NULL);
+	if (!type)
+		return 0;
+
+	return !strcmp(type, "fpga");
+}
+
 static int spl_fit_image_get_os(const void *fit, int noffset, uint8_t *os)
 {
 	if (!CONFIG_IS_ENABLED(FIT_IMAGE_TINY) || CONFIG_IS_ENABLED(OS_BOOT))
@@ -535,11 +549,18 @@ static void warn_deprecated(const char *msg)
 static int spl_fit_upload_fpga(struct spl_fit_info *ctx, int node,
 			       struct spl_image_info *fpga_image)
 {
+	const char *compatible;
 	int ret;
 
 	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 (strcmp(compatible, "u-boot,fpga-legacy"))
+		printf("Ignoring compatible = %s property\n", compatible);
+
 	ret = fpga_load(0, (void *)fpga_image->load_addr, fpga_image->size,
 			BIT_FULL);
 	if (ret) {
@@ -739,6 +760,9 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
 			return ret;
 		}
 
+		if (spl_fit_image_is_fpga(ctx.fit, node))
+			spl_fit_upload_fpga(&ctx, node, &image_info);
+
 		if (!spl_fit_image_get_os(ctx.fit, node, &os_type))
 			debug("Loadable is %s\n", genimg_get_os_name(os_type));
 
-- 
2.26.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 6/7] Kconfig: Document the limitations of the simple SPL_LOAD_FIT path
  2021-03-29 17:05 [PATCH v2 0/7] SPL: FIT: Bring the SPL_LOAD_FIT path in line with documentation Alexandru Gagniuc
                   ` (4 preceding siblings ...)
  2021-03-29 17:05 ` [PATCH v2 5/7] spl: fit: Support loading FPGA images from list of "loadables" Alexandru Gagniuc
@ 2021-03-29 17:05 ` Alexandru Gagniuc
  2021-04-16 12:25   ` Tom Rini
  2021-03-29 17:05 ` [PATCH v2 7/7] doc: FIT image: Update FPGA example to make use of "loadables" Alexandru Gagniuc
  6 siblings, 1 reply; 15+ messages in thread
From: Alexandru Gagniuc @ 2021-03-29 17:05 UTC (permalink / raw)
  To: u-boot

The "simple" SPL_LOAD_FIT path is the most compliant with the format
documented in doc/uImage.FIT/source_file_format.txt. The other two
paths to load a FIT are SPL_LOAD_FIT_FULL and the "bootm" command.

Since the Kconfig menu is the most likely place for a new user to see
these options, it seems like the most logical candidate to document
the limitations. This documents the _known_ issues, and is not
intended to be a complete list of all follies.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
 common/Kconfig.boot | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/common/Kconfig.boot b/common/Kconfig.boot
index 9c335f4f8c..5a18d62d78 100644
--- a/common/Kconfig.boot
+++ b/common/Kconfig.boot
@@ -202,6 +202,16 @@ config SPL_LOAD_FIT
 	  particular it can handle selecting from multiple device tree
 	  and passing the correct one to U-Boot.
 
+	  This path has the following limitations:
+
+	  1. "loadables" images, other than FTDs, which do not have a "load"
+	     property will not be loaded. This limitation also applies to FPGA
+	     images with the correct "compatible" string.
+	  2. For FPGA images, only the "compatible" = "u-boot,fpga-legacy"
+	     loading method is supported.
+	  3. FDTs are only loaded for images with an "os" property of "u-boot".
+	     "linux" images are also supported with Falcon boot mode.
+
 config SPL_LOAD_FIT_ADDRESS
 	hex "load address of fit image"
 	depends on SPL_LOAD_FIT
-- 
2.26.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 7/7] doc: FIT image: Update FPGA example to make use of "loadables"
  2021-03-29 17:05 [PATCH v2 0/7] SPL: FIT: Bring the SPL_LOAD_FIT path in line with documentation Alexandru Gagniuc
                   ` (5 preceding siblings ...)
  2021-03-29 17:05 ` [PATCH v2 6/7] Kconfig: Document the limitations of the simple SPL_LOAD_FIT path Alexandru Gagniuc
@ 2021-03-29 17:05 ` Alexandru Gagniuc
  2021-04-16 12:25   ` Tom Rini
  6 siblings, 1 reply; 15+ messages in thread
From: Alexandru Gagniuc @ 2021-03-29 17:05 UTC (permalink / raw)
  To: u-boot

The new correct way to load an FPGA image is to declare it in the list
of "loadables". multi-with-fpga.its used the now deprecated "fpga"
property. Since this example most likely intended to use u-boot's
generic FPGA loading code, compatible = "u-boot,fpga-legacy" is also
appropriate here.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
 doc/uImage.FIT/multi-with-fpga.its | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/uImage.FIT/multi-with-fpga.its b/doc/uImage.FIT/multi-with-fpga.its
index 47ee5760c4..021cbc7cf4 100644
--- a/doc/uImage.FIT/multi-with-fpga.its
+++ b/doc/uImage.FIT/multi-with-fpga.its
@@ -29,6 +29,7 @@
 			arch = "arm";
 			compression = "none";
 			load = <0x30000000>;
+			compatible = "u-boot,fpga-legacy"
 			hash-1 {
 				algo = "md5";
 			};
@@ -61,7 +62,7 @@
 			description = "Linux with fpga";
 			kernel = "linux_kernel";
 			fdt = "fdt-1";
-			fpga = "fpga";
+			loadables = "fpga";
 		};
 	};
 };
-- 
2.26.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 1/7] spl: fit: Don't overwrite previous loadable if "load" is missing
  2021-03-29 17:05 ` [PATCH v2 1/7] spl: fit: Don't overwrite previous loadable if "load" is missing Alexandru Gagniuc
@ 2021-04-16 12:25   ` Tom Rini
  0 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2021-04-16 12:25 UTC (permalink / raw)
  To: u-boot

On Mon, Mar 29, 2021 at 12:05:10PM -0500, Alexandru Gagniuc wrote:

> spl_load_fit_image() will try to load an image at the address given
> in the "load" property. Absent such property, it uses
> 
> 	image_info->load_addr
> 
> Correct use of this is demonstrated in spl_fit_append_fdt(), which
> resets the 'load_addr' before each spl_load_fit_image() call.
> 
> On the other hand loading "loadables" loop in spl_load_simple_fit()
> completely ignores this. It re-uses the same structure, but doesn't
> reset load_addr. If loadable [i] does not have a "load" property, its
> load address defaults to load_addr, which still contains the address
> of loadable [i - 1].
> 
> A simple solution is to treat NULL as an invalid load address. The
> caller can set load_addr = 0 to request an abort if the "load"
> property is absent.
> 
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210416/d3c0d1aa/attachment.sig>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2 2/7] doc: FIT image: Introduce "u-boot, fpga-legacy" property
  2021-03-29 17:05 ` [PATCH v2 2/7] doc: FIT image: Introduce "u-boot, fpga-legacy" property Alexandru Gagniuc
@ 2021-04-16 12:25   ` Tom Rini
  0 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2021-04-16 12:25 UTC (permalink / raw)
  To: u-boot

On Mon, Mar 29, 2021 at 12:05:11PM -0500, Alexandru Gagniuc wrote:

> Commit 4afc4f37c70e ("doc: FIT image: Clarify format and simplify
> syntax") introduced a "compatible" property for loadable images.
> It did not define its contents. Use "u-boot,fpga-legacy" compatible
> string to specify that fpga_load() should be used to load the image.
> 
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210416/ba4cea2a/attachment.sig>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2 3/7] spl: fit: Move FPGA loading code to separate functions
  2021-03-29 17:05 ` [PATCH v2 3/7] spl: fit: Move FPGA loading code to separate functions Alexandru Gagniuc
@ 2021-04-16 12:25   ` Tom Rini
  0 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2021-04-16 12:25 UTC (permalink / raw)
  To: u-boot

On Mon, Mar 29, 2021 at 12:05:12PM -0500, Alexandru Gagniuc wrote:

> The FPGA loading code in spl_simple_fit_read() can easily be separated
> from the rest of the logic. It is split into two functions instead of
> one because spl_fit_upload_fpga() is used in a subsequent patch.
> 
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210416/06a332d3/attachment.sig>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2 4/7] spl: fit: Warn if FIT contains "fpga" property in config node
  2021-03-29 17:05 ` [PATCH v2 4/7] spl: fit: Warn if FIT contains "fpga" property in config node Alexandru Gagniuc
@ 2021-04-16 12:25   ` Tom Rini
  0 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2021-04-16 12:25 UTC (permalink / raw)
  To: u-boot

On Mon, Mar 29, 2021 at 12:05:13PM -0500, Alexandru Gagniuc wrote:

> Commit 4afc4f37c70e ("doc: FIT image: Clarify format and simplify
> syntax") requires that FPGA images be referenced through the
> "loadables" in the config node. This means that "fpga" properties in
> config nodes are deprecated.
> 
> Given that there are likely FIT images which use "fpga", let's not
> break those right away. Print a warning message that such use is
> deprecated, and give users a couple of releases to update their
> 
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210416/9ae7e247/attachment.sig>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2 5/7] spl: fit: Support loading FPGA images from list of "loadables"
  2021-03-29 17:05 ` [PATCH v2 5/7] spl: fit: Support loading FPGA images from list of "loadables" Alexandru Gagniuc
@ 2021-04-16 12:25   ` Tom Rini
  0 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2021-04-16 12:25 UTC (permalink / raw)
  To: u-boot

On Mon, Mar 29, 2021 at 12:05:14PM -0500, Alexandru Gagniuc wrote:

> Commit 4afc4f37c70e ("doc: FIT image: Clarify format and simplify
> syntax") and delegated FPGA images to be added via the list of
> "loadables" in lieu of the "fpga" property. Now actually implement
> this in code.
> 
> Note that the "compatible" property is ignored for the time being, as
> implementing "compatible" loading is beyond the scope of this change.
> However, "u-boot,fpga-legacy" is accepted without warning.
> 
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210416/e09da121/attachment.sig>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2 6/7] Kconfig: Document the limitations of the simple SPL_LOAD_FIT path
  2021-03-29 17:05 ` [PATCH v2 6/7] Kconfig: Document the limitations of the simple SPL_LOAD_FIT path Alexandru Gagniuc
@ 2021-04-16 12:25   ` Tom Rini
  0 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2021-04-16 12:25 UTC (permalink / raw)
  To: u-boot

On Mon, Mar 29, 2021 at 12:05:15PM -0500, Alexandru Gagniuc wrote:

> The "simple" SPL_LOAD_FIT path is the most compliant with the format
> documented in doc/uImage.FIT/source_file_format.txt. The other two
> paths to load a FIT are SPL_LOAD_FIT_FULL and the "bootm" command.
> 
> Since the Kconfig menu is the most likely place for a new user to see
> these options, it seems like the most logical candidate to document
> the limitations. This documents the _known_ issues, and is not
> intended to be a complete list of all follies.
> 
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210416/50b26e76/attachment.sig>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2 7/7] doc: FIT image: Update FPGA example to make use of "loadables"
  2021-03-29 17:05 ` [PATCH v2 7/7] doc: FIT image: Update FPGA example to make use of "loadables" Alexandru Gagniuc
@ 2021-04-16 12:25   ` Tom Rini
  0 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2021-04-16 12:25 UTC (permalink / raw)
  To: u-boot

On Mon, Mar 29, 2021 at 12:05:16PM -0500, Alexandru Gagniuc wrote:

> The new correct way to load an FPGA image is to declare it in the list
> of "loadables". multi-with-fpga.its used the now deprecated "fpga"
> property. Since this example most likely intended to use u-boot's
> generic FPGA loading code, compatible = "u-boot,fpga-legacy" is also
> appropriate here.
> 
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210416/a8f08965/attachment.sig>

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-04-16 12:25 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29 17:05 [PATCH v2 0/7] SPL: FIT: Bring the SPL_LOAD_FIT path in line with documentation Alexandru Gagniuc
2021-03-29 17:05 ` [PATCH v2 1/7] spl: fit: Don't overwrite previous loadable if "load" is missing Alexandru Gagniuc
2021-04-16 12:25   ` Tom Rini
2021-03-29 17:05 ` [PATCH v2 2/7] doc: FIT image: Introduce "u-boot, fpga-legacy" property Alexandru Gagniuc
2021-04-16 12:25   ` Tom Rini
2021-03-29 17:05 ` [PATCH v2 3/7] spl: fit: Move FPGA loading code to separate functions Alexandru Gagniuc
2021-04-16 12:25   ` Tom Rini
2021-03-29 17:05 ` [PATCH v2 4/7] spl: fit: Warn if FIT contains "fpga" property in config node Alexandru Gagniuc
2021-04-16 12:25   ` Tom Rini
2021-03-29 17:05 ` [PATCH v2 5/7] spl: fit: Support loading FPGA images from list of "loadables" Alexandru Gagniuc
2021-04-16 12:25   ` Tom Rini
2021-03-29 17:05 ` [PATCH v2 6/7] Kconfig: Document the limitations of the simple SPL_LOAD_FIT path Alexandru Gagniuc
2021-04-16 12:25   ` Tom Rini
2021-03-29 17:05 ` [PATCH v2 7/7] doc: FIT image: Update FPGA example to make use of "loadables" Alexandru Gagniuc
2021-04-16 12:25   ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.