All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] common: fit: Add weak board_fit_config_name_match
@ 2021-03-31 18:32 Sean Anderson
  2021-04-16 12:26 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Sean Anderson @ 2021-03-31 18:32 UTC (permalink / raw)
  To: u-boot

Several architectures had a default board_fit_config_name_match already;
this provides a generic weak version. We default to rejecting all configs.
This will use the FIT's default config, instead of the first config. This
may result in boot failures if there are multiple configurations and the
first config is *not* the default.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---

 arch/arm/cpu/armv8/fsl-layerscape/spl.c |  9 ---------
 arch/arm/mach-rockchip/spl.c            | 10 ----------
 common/common_fit.c                     |  5 +++++
 3 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
index d5131bcf4b..46e8af8ebd 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
@@ -139,13 +139,4 @@ int spl_start_uboot(void)
 	return 1;
 }
 #endif	/* CONFIG_SPL_OS_BOOT */
-#ifdef CONFIG_SPL_LOAD_FIT
-__weak int board_fit_config_name_match(const char *name)
-{
-	/* Just empty function now - can't decide what to choose */
-	debug("%s: %s\n", __func__, name);
-
-	return 0;
-}
-#endif
 #endif /* CONFIG_SPL_BUILD */
diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c
index 4b5c22dc13..02c40fb37e 100644
--- a/arch/arm/mach-rockchip/spl.c
+++ b/arch/arm/mach-rockchip/spl.c
@@ -151,13 +151,3 @@ void board_init_f(ulong dummy)
 #endif
 	preloader_console_init();
 }
-
-#ifdef CONFIG_SPL_LOAD_FIT
-int __weak board_fit_config_name_match(const char *name)
-{
-	/* Just empty function now - can't decide what to choose */
-	debug("%s: %s\n", __func__, name);
-
-	return 0;
-}
-#endif
diff --git a/common/common_fit.c b/common/common_fit.c
index 219674d467..cde2dc45e9 100644
--- a/common/common_fit.c
+++ b/common/common_fit.c
@@ -22,6 +22,11 @@ ulong fdt_getprop_u32(const void *fdt, int node, const char *prop)
 	return fdt32_to_cpu(*cell);
 }
 
+__weak int board_fit_config_name_match(const char *name)
+{
+	return -EINVAL;
+}
+
 /*
  * Iterate over all /configurations subnodes and call a platform specific
  * function to find the matching configuration.
-- 
2.25.1

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

* [PATCH] common: fit: Add weak board_fit_config_name_match
  2021-03-31 18:32 [PATCH] common: fit: Add weak board_fit_config_name_match Sean Anderson
@ 2021-04-16 12:26 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2021-04-16 12:26 UTC (permalink / raw)
  To: u-boot

On Wed, Mar 31, 2021 at 02:32:27PM -0400, Sean Anderson wrote:

> Several architectures had a default board_fit_config_name_match already;
> this provides a generic weak version. We default to rejecting all configs.
> This will use the FIT's default config, instead of the first config. This
> may result in boot failures if there are multiple configurations and the
> first config is *not* the default.
> 
> Signed-off-by: Sean Anderson <sean.anderson@seco.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/f308c00e/attachment.sig>

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31 18:32 [PATCH] common: fit: Add weak board_fit_config_name_match Sean Anderson
2021-04-16 12:26 ` 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.