diff options
author | thead_admin <occ_thead@service.alibaba.com> | 2023-12-24 02:32:03 +0000 |
---|---|---|
committer | Han Gao/Revy/Rabenda <rabenda.cn@gmail.com> | 2024-01-22 15:55:16 +0800 |
commit | abe41ba65eb27b7680aa59627501d68b90a8419a (patch) | |
tree | 57c08314c8a961834d87f4bfb7d07d287ebd8423 /common/fdt_support.c | |
parent | 3e564f9f0c0db3eaef002815596b0bb35063ecc7 (diff) |
Linux_SDK_V1.4.2
Signed-off-by: thead_admin <occ_thead@service.alibaba.com>
Diffstat (limited to 'common/fdt_support.c')
-rw-r--r-- | common/fdt_support.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/common/fdt_support.c b/common/fdt_support.c index a334e008..f1f2d1ea 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <abuf.h> #include <env.h> #include <mapmem.h> #include <stdio_dev.h> @@ -274,6 +275,7 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end) int fdt_chosen(void *fdt) { + struct abuf buf = {}; int nodeoffset; int err; char *str; /* used to set string properties */ @@ -289,6 +291,17 @@ int fdt_chosen(void *fdt) if (nodeoffset < 0) return nodeoffset; + if (IS_ENABLED(CONFIG_BOARD_RNG_SEED) && !board_rng_seed(&buf)) { + err = fdt_setprop(fdt, nodeoffset, "rng-seed", + abuf_data(&buf), abuf_size(&buf)); + abuf_uninit(&buf); + if (err < 0) { + printf("WARNING: could not set rng-seed %s.\n", + fdt_strerror(err)); + return err; + } + } + str = env_get("bootargs"); if (str) { err = fdt_setprop(fdt, nodeoffset, "bootargs", str, |