diff options
author | Tom Rini <trini@konsulko.com> | 2024-12-18 12:36:38 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-12-18 15:43:24 -0600 |
commit | 511b8dea970aab24f574ce230ac76089990df884 (patch) | |
tree | d1f0c22474fd0cd789c2d5d61096148e3970bd52 | |
parent | b6e1ac89dc0a9d9bba1b803d4577f434669ce44e (diff) | |
parent | 90856d695f2f34cf5eb74c90a8b3a6cfe4932356 (diff) |
Merge patch series "sandbox: repair compile and run-time for OF_EMBED case"
Evgeny Bachinin <EABachinin@salutedevices.com> says:
This patch-set repairs ability to use sandbox with CONFIG_OF_EMBED=y.
For now, to use OF_EMBED, the following must be done
1) sandbox64_defconfig should have:
```
-CONFIG_OF_LIVE=y
+CONFIG_OF_EMBED=y
```
2) On sandbox when CONFIG_OF_EMBED=y, the u-boot process can't start
due to:
```
Bloblist at b000 not found (err=-2)
initcall failed at call 000000000011829c (err=-2: No such file or \
directory)
### ERROR ### Please RESET the board ###
```
So, it is natural desire to disable CONFIG_BLOBLIST just to test
sandbox with OF_EMBED=y (disable it one way or another):
```
config SANDBOX
- select BLOBLIST
+ select BLOBLIST if SOME_NON_EXISTING_OPTION
```
3) As a result, having such changes (CONFIG_OF_EMBED=y &&
CONFIG_BLOBLIST=n) leads to the link & run-time errors, being fixed
by this patch series.
Link: https://lore.kernel.org/r/20241202-sandbox_repair_of_embed-v1-0-05aff4b0ccf7@salutedevices.com
[trini: The final patch is dropped as no longer relevant with Simon's
rework to that function which is now applied.]
-rw-r--r-- | include/bloblist.h | 7 | ||||
-rw-r--r-- | test/cmd_ut.c | 2 | ||||
-rw-r--r-- | test/lib/kconfig.c | 10 |
3 files changed, 15 insertions, 4 deletions
diff --git a/include/bloblist.h b/include/bloblist.h index ff32d3fecfd..f999391f74b 100644 --- a/include/bloblist.h +++ b/include/bloblist.h @@ -357,6 +357,7 @@ int bloblist_new(ulong addr, uint size, uint flags, uint align_log2); */ int bloblist_check(ulong addr, uint size); +#if CONFIG_IS_ENABLED(BLOBLIST) /** * bloblist_finish() - Set up the bloblist for the next U-Boot part * @@ -366,6 +367,12 @@ int bloblist_check(ulong addr, uint size); * Return: 0 */ int bloblist_finish(void); +#else +static inline int bloblist_finish(void) +{ + return 0; +} +#endif /* BLOBLIST */ /** * bloblist_get_stats() - Get information about the bloblist diff --git a/test/cmd_ut.c b/test/cmd_ut.c index 195b7ea50ac..a14dbf4ca5e 100644 --- a/test/cmd_ut.c +++ b/test/cmd_ut.c @@ -104,10 +104,12 @@ static struct cmd_tbl cmd_ut_sub[] = { "", ""), #endif #ifdef CONFIG_SANDBOX +#if CONFIG_IS_ENABLED(BLOBLIST) U_BOOT_CMD_MKENT(bloblist, CONFIG_SYS_MAXARGS, 1, do_ut_bloblist, "", ""), U_BOOT_CMD_MKENT(bootm, CONFIG_SYS_MAXARGS, 1, do_ut_bootm, "", ""), #endif +#endif #ifdef CONFIG_CMD_ADDRMAP U_BOOT_CMD_MKENT(addrmap, CONFIG_SYS_MAXARGS, 1, do_ut_addrmap, "", ""), #endif diff --git a/test/lib/kconfig.c b/test/lib/kconfig.c index 0c463bb794a..a3645abf946 100644 --- a/test/lib/kconfig.c +++ b/test/lib/kconfig.c @@ -21,10 +21,12 @@ static int lib_test_is_enabled(struct unit_test_state *uts) ut_asserteq(0, CONFIG_IS_ENABLED(OF_PLATDATA)); ut_asserteq(0, CONFIG_IS_ENABLED(_UNDEFINED)); - ut_asserteq(0xb000, - IF_ENABLED_INT(CONFIG_BLOBLIST_FIXED, CONFIG_BLOBLIST_ADDR)); - ut_asserteq(0xb000, - CONFIG_IF_ENABLED_INT(BLOBLIST_FIXED, BLOBLIST_ADDR)); + if (IS_ENABLED(CONFIG_BLOBLIST)) { + ut_asserteq(0xb000, IF_ENABLED_INT(CONFIG_BLOBLIST_FIXED, + CONFIG_BLOBLIST_ADDR)); + ut_asserteq(0xb000, CONFIG_IF_ENABLED_INT(BLOBLIST_FIXED, + BLOBLIST_ADDR)); + } /* * This fails if CONFIG_TEST_KCONFIG_ENABLE is not enabled, since the |