From: Jim Liu Date: Tue, 23 Apr 2024 07:22:08 +0000 (+0800) Subject: Arm: npcm: fix npcm7xx boot to kernel error X-Git-Url: http://git.dujemihanovic.xyz/html/%7B%7B%20%28.OutputFormats.Get?a=commitdiff_plain;h=ceec9c9d291bf76ccc9338ded89e1b5156313db1;p=u-boot.git Arm: npcm: fix npcm7xx boot to kernel error Add mem and console env information and modify the wrong earlycon env. Signed-off-by: Jim Liu --- diff --git a/board/nuvoton/poleg_evb/poleg_evb.c b/board/nuvoton/poleg_evb/poleg_evb.c index 7421911a41..e69bca9503 100644 --- a/board/nuvoton/poleg_evb/poleg_evb.c +++ b/board/nuvoton/poleg_evb/poleg_evb.c @@ -21,7 +21,6 @@ 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; @@ -47,17 +46,31 @@ int dram_init(void) break; } - if (gd->ram_size > 0) { - sprintf(value, "%ldM", (gd->ram_size / 0x100000)); - env_set("mem", value); - } - return 0; } int last_stage_init(void) { - board_set_console(); + + char value[32]; + struct udevice *dev = gd->cur_serial_dev; + + if (gd->ram_size > 0) { + sprintf(value, "%ldM", (gd->ram_size / 0x100000)); + env_set("mem", value); + } + + if (dev && (dev->seq_ >= 0)) { + void *addr; + addr = dev_read_addr_ptr(dev); + if (addr) { + sprintf(value, "uart8250,mmio32,0x%x", (u32)addr); + env_set("earlycon", value); + } + sprintf(value, "ttyS%d,115200n8", dev->seq_); + env_set("console", value); + board_set_console(); + } return 0; } diff --git a/include/configs/poleg.h b/include/configs/poleg.h index 2a2d85c8ec..14ead163e7 100644 --- a/include/configs/poleg.h +++ b/include/configs/poleg.h @@ -30,9 +30,9 @@ "eth2addr=00:00:F7:A0:00:FE\0" \ "eth3addr=00:00:F7:A0:00:FF\0" \ "console=ttyS0,115200n8\0" \ - "earlycon=uart8250,mmio32,0xf0000000\0" \ + "earlycon=uart8250,mmio32,0xf0001000\0" \ "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} oops=panic panic=20\0" \ "sd_prog=fatload mmc 0 10000000 image-bmc; cp.b 10000000 80000000 ${filesize}\0" \ "sd_run=fatload mmc 0 10000000 image-bmc; bootm 10200000\0" \ "\0"