Sfoglia il codice sorgente

test_download(): verify that .dram.bss was properly cleared

H. Peter Anvin 3 anni fa
parent
commit
8933ef4824
6 ha cambiato i file con 5250 aggiunte e 5247 eliminazioni
  1. BIN
      fpga/output_files/max80.jbc
  2. BIN
      fpga/output_files/max80.jic
  3. BIN
      fpga/output_files/max80.pof
  4. BIN
      fpga/output_files/max80.sof
  5. 5238 5238
      fw/boot.mif
  6. 12 9
      fw/hello.c

BIN
fpga/output_files/max80.jbc


BIN
fpga/output_files/max80.jic


BIN
fpga/output_files/max80.pof


BIN
fpga/output_files/max80.sof


File diff suppressed because it is too large
+ 5238 - 5238
fw/boot.mif


+ 12 - 9
fw/hello.c

@@ -91,6 +91,8 @@ static void test_sdram(void)
 #endif
 }
 
+extern uint32_t __dram_bss_start[], __dram_bss_end[], __dram_bss_len[];
+
 #define TESTDATA_WORDS (128*1024)
 extern uint32_t testdata[TESTDATA_WORDS];
 
@@ -99,6 +101,7 @@ static void test_download(void)
     const unsigned int words = TESTDATA_WORDS;
     volatile uint32_t *p = testdata;
     unsigned int ok = words;
+    unsigned int bsslen;
     uint32_t val = 0x00001111;
     unsigned int ratelimit = ERROR_RATELIMIT;
 
@@ -130,6 +133,15 @@ static void test_download(void)
 	    con_putc('\n');
 	}
     }
+
+    bsslen = (size_t)__dram_bss_len >> 2;
+    ok = bsslen;
+    for (const uint32_t *p = __dram_bss_start; p < __dram_bss_end; p++) {
+	if (*p)
+	    ok--;
+    }
+
+    con_printf("SDRAM clear: %u/%u words OK\n", ok, bsslen);
 }
 
 /* Make sure we don't leave anything in SDRAM that could be a false negative */
@@ -195,8 +207,6 @@ static void init(void)
     read_rtc();
 }
 
-extern uint32_t __dram_bss_start[], __dram_bss_end[], __dram_bss_len[];
-
 static uint32_t romcopy_time[2];
 static unsigned int romcopy_state;
 IRQHANDLER(romcopy)
@@ -286,13 +296,6 @@ void main(void)
 
     test_download();
 
-    for (const uint32_t *p = __dram_bss_start; p < __dram_bss_end; p++) {
-	if (*p) {
-	    con_printf(".dram.bss not properly cleared\n");
-	    break;
-	}
-    }
-
     disk_init();
     test_sdram();
     scrub_sdram();

Some files were not shown because too many files changed in this diff