Skip to contentSkip to conversation

configs: visionfive2: Enable CONFIG_OF_BOARD_SETUP

PATCH New Shengyu Qu 1 participant 2 messages Sep 16, 2023 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Shengyu Qu

author
#1 lore raw

PATCH 1/2 configs: visionfive2: Enable CONFIG_OF_BOARD_SETUP

Enable CONFIG_OF_BOARD_SETUP, so we could use ft_board_setup() to fixup memory size passed to kernel.

---
 configs/starfive_visionfive2_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/starfive_visionfive2_defconfig +1 -0
index 2376dad538..4d1459a3c2 100644
@@ -36,6 +36,7 @@ CONFIG_SPL_OPENSBI_LOAD_ADDR=0x40000000
 CONFIG_ARCH_RV64I=y
 CONFIG_CMODEL_MEDANY=y
 CONFIG_RISCV_SMODE=y
+CONFIG_OF_BOARD_SETUP=y
 # CONFIG_OF_BOARD_FIXUP is not set
 CONFIG_FIT=y
 CONFIG_DISTRO_DEFAULTS=y
Signature · 1 line
2.42.0
author
#2 lore raw

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

In reply to a message not in the archive

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

---
 board/starfive/visionfive2/starfive_visionfive2.c | 7 +++++++
 1 file changed, 7 insertions(+)
board/starfive/visionfive2/starfive_visionfive2.c +7 -0
index 9847e0efdb..700b60ac74 100644
@@ -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);
+}
Signature · 1 line
2.42.0