diff mbox series

[U-Boot,v3,05/14] fit: Allow multiple images per property

Message ID 1504555943-12893-6-git-send-email-pantelis.antoniou@konsulko.com
State Accepted
Commit ad026adbcf0d719e736eb58a9059cbbebb2d2423
Delegated to: Simon Glass
Headers show
Series uboot overlays, FIT image & unittest | expand

Commit Message

Pantelis Antoniou Sept. 4, 2017, 8:12 p.m. UTC
As part of the fdt overlay support which need it, allow
a list of configurations per property.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
---
 common/image-fit.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

Comments

Simon Glass Sept. 9, 2017, 4:53 a.m. UTC | #1
On 4 September 2017 at 14:12, Pantelis Antoniou
<pantelis.antoniou@konsulko.com> wrote:
> As part of the fdt overlay support which need it, allow
> a list of configurations per property.
>
> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
> ---
>  common/image-fit.c | 18 +++++++++++++++---
>  1 file changed, 15 insertions(+), 3 deletions(-)

Acked-by: Simon Glass <sjg@chromium.org>
Simon Glass Sept. 15, 2017, 7:19 p.m. UTC | #2
On 4 September 2017 at 14:12, Pantelis Antoniou
<pantelis.antoniou@konsulko.com> wrote:
> As part of the fdt overlay support which need it, allow
> a list of configurations per property.
>
> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
> ---
>  common/image-fit.c | 18 +++++++++++++++---
>  1 file changed, 15 insertions(+), 3 deletions(-)

Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-fdt thanks!
diff mbox series

Patch

diff --git a/common/image-fit.c b/common/image-fit.c
index 109ecfa..74e5557 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1484,20 +1484,32 @@  int fit_conf_get_node(const void *fit, const char *conf_uname)
 	return noffset;
 }
 
-int fit_conf_get_prop_node(const void *fit, int noffset,
+int fit_conf_get_prop_node_count(const void *fit, int noffset,
 		const char *prop_name)
 {
-	char *uname;
+	return fdt_stringlist_count(fit, noffset, prop_name);
+}
+
+int fit_conf_get_prop_node_index(const void *fit, int noffset,
+		const char *prop_name, int index)
+{
+	const char *uname;
 	int len;
 
 	/* get kernel image unit name from configuration kernel property */
-	uname = (char *)fdt_getprop(fit, noffset, prop_name, &len);
+	uname = fdt_stringlist_get(fit, noffset, prop_name, index, &len);
 	if (uname == NULL)
 		return len;
 
 	return fit_image_get_node(fit, uname);
 }
 
+int fit_conf_get_prop_node(const void *fit, int noffset,
+		const char *prop_name)
+{
+	return fit_conf_get_prop_node_index(fit, noffset, prop_name, 0);
+}
+
 /**
  * fit_conf_print - prints out the FIT configuration details
  * @fit: pointer to the FIT format image header