diff options
author | Jim Liu <jim.t90615@gmail.com> | 2023-06-13 15:45:54 +0800 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-07-14 12:52:18 -0400 |
commit | 178284a9cf63095f55830f2c10983169796e7de6 (patch) | |
tree | 4ea5bd6e20576744bc15845142d0ad67591cec6c /board/nuvoton | |
parent | 4eee55bf2c282fd89f3cc27557ceb52533ee3431 (diff) | |
download | u-boot-178284a9cf63095f55830f2c10983169796e7de6.tar.gz u-boot-178284a9cf63095f55830f2c10983169796e7de6.tar.bz2 u-boot-178284a9cf63095f55830f2c10983169796e7de6.zip |
board: nuvoton: add env setting for boot to linux
add console and mem env to boot to linux kernel
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Diffstat (limited to 'board/nuvoton')
-rw-r--r-- | board/nuvoton/poleg_evb/poleg_evb.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/board/nuvoton/poleg_evb/poleg_evb.c b/board/nuvoton/poleg_evb/poleg_evb.c index aef142a881..2052af6649 100644 --- a/board/nuvoton/poleg_evb/poleg_evb.c +++ b/board/nuvoton/poleg_evb/poleg_evb.c @@ -6,6 +6,7 @@ #include <common.h> #include <dm.h> +#include <env.h> #include <asm/io.h> #include <asm/arch/gcr.h> #include <asm/mach-types.h> @@ -19,6 +20,7 @@ int board_init(void) int dram_init(void) { + char value[32]; struct npcm_gcr *gcr = (struct npcm_gcr *)NPCM_GCR_BA; int ramsize = (readl(&gcr->intcr3) >> 8) & 0x7; @@ -44,5 +46,10 @@ int dram_init(void) break; } + if (gd->ram_size > 0) { + sprintf(value, "%ldM", (gd->ram_size / 0x100000)); + env_set("mem", value); + } + return 0; } |