make DRAM init conditional on whether it is detected through SYSCON
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 11 Apr 2022 15:35:26 +0000 (16:35 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 11 Apr 2022 15:35:26 +0000 (16:35 +0100)
coldboot/coldboot.c

index b3454cb1cd9d3ee0a8068a44d3c34a6c60fb103f..4f699a53f3d7c998fc4b0b5902cc791a8e703d63 100644 (file)
@@ -326,7 +326,9 @@ int main(void) {
     return 0;
 #endif
 
-    for (int persistence=0; persistence < 1000; persistence++) {
+    // init DRAM only if SYSCON says it exists (duh)
+    if (ftr & SYS_REG_INFO_HAS_DRAM)
+    {
         puts("DRAM init... ");
 
         struct gramCtx ctx;
@@ -471,9 +473,6 @@ int main(void) {
                 }
             }
         }
-        if (failcnt == 0) { // fiinally...
-            break;
-        }
     }
 #endif
        puts("done\n");