From ed4ae7386257aa66455e330234e513d098a36f84 Mon Sep 17 00:00:00 2001 From: Alex Shumsky Date: Wed, 16 Oct 2024 13:02:03 +0300 Subject: rockchip: board: Increase rng-seed size to make it sufficient for modern Linux Increase rng-seed size to make Linux happy and initialize rng pool instantly. Linux 5.19+ requires 32 bytes of entropy to initialize random pool, but u-boot currently provides only 8 bytes. Linux 5.18 and probably some versions before it used to require 64 bytes. Bump min value to 64 bytes to be on a safe side. Boot with 8 byte rng-seed (Linux 6.11): # dmesg | grep crng [ 12.089286] random: crng init done Boot with 32 byte rng-seed (Linux 6.11): # dmesg | grep crng [ 0.000000] random: crng init done Linux source references: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/char/random.c?h=v5.19#n551 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/char/random.c?h=v5.18#n236 Signed-off-by: Alex Shumsky Fixes: d2048bafae40 ("rockchip: board: Add board_rng_seed() for all Rockchip devices") Reviewed-by: Dragan Simic Reviewed-by: Marek Vasut Reviewed-by: Quentin Schulz Reviewed-by: Kever Yang --- include/fdt_support.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/fdt_support.h b/include/fdt_support.h index 741e2360c22..9447a64e060 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -202,7 +202,8 @@ int ft_board_setup(void *blob, struct bd_info *bd); * * This function is called if CONFIG_BOARD_RNG_SEED is set, and must * be provided by the board. It should return, via @buf, some suitable - * seed value to pass to the kernel. + * seed value to pass to the kernel. Seed size could be set in a decimal + * environment variable rng_seed_size and it defaults to 64 bytes. * * @param buf A struct abuf for returning the seed and its size. * @return 0 if ok, negative on error. -- cgit v1.2.3