Browse Source

board: starfive: visionfive2: add memory_addr and memory_size environment variable

In order to compatible visionfive2 board with different version,so the
memory size information read from eeprom. and save to environment
variable. The value which saved in environment variable  will be used
to update the memory node in dts.

Signed-off-by: Yanhong Wang <yanhong.wang@linux.starfivetech.com>
Yanhong Wang 1 year ago
parent
commit
d4cfd564c2
1 changed files with 7 additions and 0 deletions
  1. 7 0
      board/starfive/visionfive2/starfive_visionfive2.c

+ 7 - 0
board/starfive/visionfive2/starfive_visionfive2.c

@@ -346,6 +346,13 @@ int board_late_init(void)
 {
 	get_boot_mode();
 	jh7110_gmac_init(get_board_type());
+	/*
+	 * save the memory info by environment variable in u-boot,
+	 * It will used to update the memory configuration in dts,
+	 * which passed to kernel lately.
+	 */
+	env_set_hex("memory_addr", gd->ram_base);
+	env_set_hex("memory_size", gd->ram_size);
 
 	return 0;
 }