[PATCH v1 2/2] board: visionfive2: Fixup memory size passed to kernel

Shengyu Qu wiagn233 at outlook.com
Sat Sep 16 21:36:33 CEST 2023


Use fdt_fixup_memory to make the memory size data from dtb match
the actual size.

Signed-off-by: Shengyu Qu <wiagn233 at outlook.com>
Tested-by: Milan P. Stanić <mps at arvanta.net>
---
 board/starfive/visionfive2/starfive_visionfive2.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/board/starfive/visionfive2/starfive_visionfive2.c b/board/starfive/visionfive2/starfive_visionfive2.c
index 9847e0efdb..700b60ac74 100644
--- a/board/starfive/visionfive2/starfive_visionfive2.c
+++ b/board/starfive/visionfive2/starfive_visionfive2.c
@@ -12,7 +12,9 @@
 #include <linux/bitops.h>
 #include <asm/arch-jh7110/eeprom.h>
 #include <env.h>
+#include <fdt_support.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 #define JH7110_L2_PREFETCHER_BASE_ADDR		0x2030000
 #define JH7110_L2_PREFETCHER_HART_OFFSET	0x2000
 
@@ -76,3 +78,8 @@ void *board_fdt_blob_setup(int *err)
 
 	return (ulong *)&_end;
 }
+
+int ft_board_setup(void *blob, struct bd_info *bd)
+{
+	return fdt_fixup_memory(blob, 0x40000000, gd->ram_size);
+}
-- 
2.42.0



More information about the U-Boot mailing list