mirror of
https://github.com/smaeul/u-boot.git
synced 2025-11-06 15:00:22 +00:00
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>
This commit is contained in:
parent
e0a1c81cd8
commit
74435c7904
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <dm.h>
|
#include <dm.h>
|
||||||
|
#include <env.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <asm/arch/gcr.h>
|
#include <asm/arch/gcr.h>
|
||||||
#include <asm/mach-types.h>
|
#include <asm/mach-types.h>
|
||||||
@ -19,6 +20,7 @@ int board_init(void)
|
|||||||
|
|
||||||
int dram_init(void)
|
int dram_init(void)
|
||||||
{
|
{
|
||||||
|
char value[32];
|
||||||
struct npcm_gcr *gcr = (struct npcm_gcr *)NPCM_GCR_BA;
|
struct npcm_gcr *gcr = (struct npcm_gcr *)NPCM_GCR_BA;
|
||||||
|
|
||||||
int ramsize = (readl(&gcr->intcr3) >> 8) & 0x7;
|
int ramsize = (readl(&gcr->intcr3) >> 8) & 0x7;
|
||||||
@ -44,5 +46,10 @@ int dram_init(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gd->ram_size > 0) {
|
||||||
|
sprintf(value, "%ldM", (gd->ram_size / 0x100000));
|
||||||
|
env_set("mem", value);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,8 @@
|
|||||||
"eth1addr=00:00:F7:A0:00:FD\0" \
|
"eth1addr=00:00:F7:A0:00:FD\0" \
|
||||||
"eth2addr=00:00:F7:A0:00:FE\0" \
|
"eth2addr=00:00:F7:A0:00:FE\0" \
|
||||||
"eth3addr=00:00:F7:A0:00:FF\0" \
|
"eth3addr=00:00:F7:A0:00:FF\0" \
|
||||||
|
"console=ttyS0,115200n8\0" \
|
||||||
|
"earlycon=uart8250,mmio32,0xf0000000\0" \
|
||||||
"common_bootargs=setenv bootargs earlycon=${earlycon} root=/dev/ram " \
|
"common_bootargs=setenv bootargs earlycon=${earlycon} root=/dev/ram " \
|
||||||
"console=${console} mem=${mem} ramdisk_size=48000 basemac=${ethaddr}\0" \
|
"console=${console} mem=${mem} ramdisk_size=48000 basemac=${ethaddr}\0" \
|
||||||
"sd_prog=fatload mmc 0 10000000 image-bmc; cp.b 10000000 80000000 ${filesize}\0" \
|
"sd_prog=fatload mmc 0 10000000 image-bmc; cp.b 10000000 80000000 ${filesize}\0" \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user