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.]
This commit is contained in:
Tom Rini
2024-12-18 12:36:38 -06:00
3 changed files with 15 additions and 4 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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