move quick read/write test for hyperram in coldboot.c
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 19 Mar 2022 20:46:31 +0000 (20:46 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 19 Mar 2022 20:46:31 +0000 (20:46 +0000)
coldboot/coldboot.c

index 2f1374f20c1881266981b1f76e30a86602e45f89..24966707943acb5d890d3cb77e3194ec24aa289b 100644 (file)
@@ -66,7 +66,20 @@ int main(void) {
        console_init();
        //puts("Firmware launched...\n");
 
+       puts("fw..");
+#if 0
+       volatile uint32_t *hyperram = 0xa0000000;
+    // quick write/read
+    writel(0xDEAF0000, (unsigned long)&(hyperram[0]));
+    tmp = readl((unsigned long)&(hyperram[0]));
+       puts("read ");
+       uart_writeuint32(tmp);
+
+    return 0;
+#endif
+
        puts("DRAM init... ");
+
        struct gramCtx ctx;
        struct gramProfile profile = {
                .mode_registers = {
@@ -81,16 +94,6 @@ int main(void) {
                               (void*)DRAM_INIT_BASE); //0x00008000);
        puts("done\n");
 
-#if 0
-    // quick write/read
-    writel(0xDEAF0000, (unsigned long)&(ram[0]));
-    tmp = readl((unsigned long)&(ram[0]));
-       puts("read ");
-       uart_writeuint32(tmp);
-
-    return 0;
-#endif
-
 #if 1
        puts("Rdly\np0: ");
        for (size_t i = 0; i < 8; i++) {