quick-and-dirty QSPI read test
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 29 Mar 2022 12:45:32 +0000 (13:45 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 29 Mar 2022 12:45:32 +0000 (13:45 +0100)
coldboot/coldboot.c

index 16b7780fdf778257dea49e9e4d75d11ec88fb3e9..5017c39e5f61d65f8f52b541ba70bdfb179424f2 100644 (file)
@@ -68,6 +68,28 @@ int main(void) {
 
        puts("fw..");
 #if 1
+       volatile uint32_t *qspi = (uint32_t*)0x10000000;
+    // let's not, eh? writel(0xDEAF0123, (unsigned long)&(qspi[0]));
+    // tmp = readl((unsigned long)&(qspi[0]));
+    while (1) {
+        unsigned char c = getchar();
+        putchar(c);
+        if (c == 13) { // if CR send LF
+
+            // quick read
+            tmp = readl((unsigned long)&(qspi[1<<i]));
+            puts("read ");
+            uart_writeuint32(1<<i);
+            puts(" ");
+            uart_writeuint32(tmp);
+            putchar(10);
+            i++;
+        }
+    }
+
+    return 0;
+#endif
+#if 0
        volatile uint32_t *hyperram = (uint32_t*)0xa0000000;
     writel(0xDEAF0123, (unsigned long)&(hyperram[0]));
     tmp = readl((unsigned long)&(hyperram[0]));