#include <fdt_support.h>
#include <mapmem.h>
#include <asm/global_data.h>
+#include <dm/uclass.h>
#include <linux/libfdt.h>
#include <test/ut.h>
{
const char *env_bootargs = env_get("bootargs");
char fdt[8192];
+ struct udevice *dev;
ulong addr;
ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt), &addr));
/* Test add new chosen node without initrd */
ut_assertok(run_commandf("fdt chosen"));
ut_assertok(run_commandf("fdt print /chosen"));
- ut_assert_nextline("chosen {");
+ ut_assert(0 < console_record_readline(uts->actual_str,
+ sizeof(uts->actual_str)));
+ if (!strcmp("No RNG device", uts->actual_str))
+ ut_assert(0 < console_record_readline(uts->actual_str,
+ sizeof(uts->actual_str)));
+ ut_asserteq_str("chosen {", uts->actual_str);
ut_assert_nextlinen("\tu-boot,version = "); /* Ignore the version string */
if (env_bootargs)
ut_assert_nextline("\tbootargs = \"%s\";", env_bootargs);
- if (IS_ENABLED(CONFIG_DM_RNG) &&
+ if (!uclass_get_device(UCLASS_RNG, 0, &dev) &&
!IS_ENABLED(CONFIG_MEASURED_BOOT) &&
!IS_ENABLED(CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT))
ut_assert_nextlinen("\tkaslr-seed = ");
/* Test add new chosen node with initrd */
ut_assertok(run_commandf("fdt chosen 0x1234 0x5678"));
ut_assertok(run_commandf("fdt print /chosen"));
- ut_assert_nextline("chosen {");
+ ut_assert(0 < console_record_readline(uts->actual_str,
+ sizeof(uts->actual_str)));
+ if (!strcmp("No RNG device", uts->actual_str))
+ ut_assert(0 < console_record_readline(uts->actual_str,
+ sizeof(uts->actual_str)));
+ ut_asserteq_str("chosen {", uts->actual_str);
ut_assert_nextline("\tlinux,initrd-end = <0x%08x 0x%08x>;",
upper_32_bits(0x1234 + 0x5678 - 1),
lower_32_bits(0x1234 + 0x5678 - 1));
ut_assert_nextlinen("\tu-boot,version = "); /* Ignore the version string */
if (env_bootargs)
ut_assert_nextline("\tbootargs = \"%s\";", env_bootargs);
- if (IS_ENABLED(CONFIG_DM_RNG) &&
+ if (!uclass_get_device(UCLASS_RNG, 0, &dev) &&
!IS_ENABLED(CONFIG_MEASURED_BOOT) &&
!IS_ENABLED(CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT))
ut_assert_nextlinen("\tkaslr-seed = ");