litedram: only run sdram init at first boot

Subsequent boots can skip the dram configuration, it will already
be in a usable state.

Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
pull/409/head
Matt Johnston 11 months ago
parent 4bd45af739
commit 1874cad5b7

@ -285,10 +285,14 @@ uint64_t main(void)
try_flash = true;
}
printf("\n");
if (ftr & SYS_REG_INFO_HAS_DRAM) {
if (ftr & SYS_REG_INFO_HAS_DRAM && !ddrctrl_init_done_read()) {
printf("LiteDRAM built from LiteX %s\n", LITEX_GIT_SHA1);
sdram_init();
}

val = readq(SYSCON_BASE + SYS_REG_CTRL);
writeq(val & ~SYS_REG_CTRL_ALT_RESET, SYSCON_BASE + SYS_REG_CTRL);

if (ftr & SYS_REG_INFO_HAS_BRAM) {
printf("Booting from BRAM...\n");
return 0;

Loading…
Cancel
Save