Explorar o código

fw, console: add flush function

Explicitly flush the console before reset instead of an arbitrary
delay.
H. Peter Anvin %!s(int64=3) %!d(string=hai) anos
pai
achega
dce6ed79e1
Modificáronse 9 ficheiros con 2694 adicións e 2685 borrados
  1. 1688 1686
      fpga/output_files/max80.jam
  2. BIN=BIN
      fpga/output_files/max80.jbc
  3. BIN=BIN
      fpga/output_files/max80.jic
  4. 1 1
      fpga/output_files/max80.map
  5. BIN=BIN
      fpga/output_files/max80.pof
  6. BIN=BIN
      fpga/output_files/max80.sof
  7. 997 997
      fw/boot.mif
  8. 7 0
      fw/console.h
  9. 1 1
      fw/hello.c

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1688 - 1686
fpga/output_files/max80.jam


BIN=BIN
fpga/output_files/max80.jbc


BIN=BIN
fpga/output_files/max80.jic


+ 1 - 1
fpga/output_files/max80.map

@@ -11,7 +11,7 @@ Quad-Serial configuration device dummy clock cycle: 8
 
 Notes:
 
-- Data checksum for this conversion is 0xF385C8C0
+- Data checksum for this conversion is 0xF385CAC4
 
 - All the addresses in this file are byte addresses
 

BIN=BIN
fpga/output_files/max80.pof


BIN=BIN
fpga/output_files/max80.sof


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 997 - 997
fw/boot.mif


+ 7 - 0
fw/console.h

@@ -2,6 +2,7 @@
 #define CONSOLE_H
 
 #include <stdarg.h>
+#include "io.h"
 
 void con_set_baudrate(uint32_t);
 void con_putc(char c);
@@ -9,4 +10,10 @@ void con_puts(const char *);
 void con_vprintf(const char *, va_list);
 void con_printf(const char *, ...);
 
+static inline void con_flush(void)
+{
+    while (!(CON_STATUS & 1))
+	/* wait */;
+}
+
 #endif /* CONSOLE_H */

+ 1 - 1
fw/hello.c

@@ -153,7 +153,7 @@ void main(void)
 
     udelay(4000000);
     con_puts("*** Doing reset ***\r\n\n");
-    udelay(100000);
+    con_flush();
     while ( 1 )
       RESET_CMD = 1;
 }

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio