summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorYanhong Wang <yanhong.wang@linux.starfivetech.com>2022-10-13 05:22:25 +0300
committerJianlong Huang <jianlong.huang@starfivetech.com>2022-11-03 11:31:42 +0300
commitd4cfd564c23afae9efeb44a12d6a2be50b17d912 (patch)
tree89b1b232693554c3735cc24b26a25ffde34c5cef /board
parente7083b7199dba53255c4b59ee55f767e071133af (diff)
downloadu-boot-d4cfd564c23afae9efeb44a12d6a2be50b17d912.tar.xz
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>
Diffstat (limited to 'board')
-rwxr-xr-xboard/starfive/visionfive2/starfive_visionfive2.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/board/starfive/visionfive2/starfive_visionfive2.c b/board/starfive/visionfive2/starfive_visionfive2.c
index 27e9ed7eb0..9aec9f4122 100755
--- a/board/starfive/visionfive2/starfive_visionfive2.c
+++ b/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;
}