浏览代码

fw, console: add flush function

Explicitly flush the console before reset instead of an arbitrary
delay.
H. Peter Anvin 3 年之前
父节点
当前提交
dce6ed79e1
共有 9 个文件被更改,包括 2694 次插入2685 次删除
  1. 1688 1686
      fpga/output_files/max80.jam
  2. 二进制
      fpga/output_files/max80.jbc
  3. 二进制
      fpga/output_files/max80.jic
  4. 1 1
      fpga/output_files/max80.map
  5. 二进制
      fpga/output_files/max80.pof
  6. 二进制
      fpga/output_files/max80.sof
  7. 997 997
      fw/boot.mif
  8. 7 0
      fw/console.h
  9. 1 1
      fw/hello.c

文件差异内容过多而无法显示
+ 1688 - 1686
fpga/output_files/max80.jam


二进制
fpga/output_files/max80.jbc


二进制
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
 

二进制
fpga/output_files/max80.pof


二进制
fpga/output_files/max80.sof


文件差异内容过多而无法显示
+ 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;
 }

部分文件因为文件数量过多而无法显示