Patchwork console/console.h cleanup

login
register
about
Submitter Stefan Reinauer
Date 2011-04-14 21:46:16
Message ID <20110414214615.GA16484@coreboot.org>
Download mbox | patch
Permalink /patch/2874/
State Superseded
Headers show

Comments

Stefan Reinauer - 2011-04-14 21:46:16
See patch
Peter Stuge - 2011-04-14 22:15:00
Stefan Reinauer wrote:
> - include usbdebug.c where appropriate
> - don't do ne2k_transmit()s without actual output
> 
> Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>

Acked-by: Peter Stuge <peter@stuge.se>
Stefan Reinauer - 2011-04-16 00:11:54
* Stefan Reinauer <stefan.reinauer@coreboot.org> [110414 23:46]:
> See patch
> 

> - include usbdebug.c where appropriate
> - don't do ne2k_transmit()s without actual output
> 
> Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>

Rudolf, you wrote some of the code initially. Can you please take a
look?
Stefan Reinauer - 2011-04-25 19:56:48
* Stefan Reinauer <stefan.reinauer@coreboot.org> [110416 02:11]:
> * Stefan Reinauer <stefan.reinauer@coreboot.org> [110414 23:46]:
> > See patch
> > 
> 
> > - include usbdebug.c where appropriate
> > - don't do ne2k_transmit()s without actual output
> > 
> > Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
> 
> Rudolf, you wrote some of the code initially. Can you please take a
> look?

ping?

Patch

- include usbdebug.c where appropriate
- don't do ne2k_transmit()s without actual output

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>

Index: src/include/console/console.h
===================================================================
--- src/include/console/console.h	(revision 6491)
+++ src/include/console/console.h	(working copy)
@@ -158,6 +158,9 @@ 
 #if CONFIG_CONSOLE_SERIAL8250
 #include "lib/uart8250.c"
 #endif
+#if CONFIG_USBDEBUG
+#include "lib/usbdebug.c"
+#endif
 #if CONFIG_CONSOLE_NE2K
 #include "lib/ne2k.c"
 #endif
@@ -167,6 +170,9 @@ 
 #if CONFIG_CONSOLE_SERIAL8250
 	uart8250_tx_byte(CONFIG_TTYS0_BASE, byte);
 #endif
+#if CONFIG_USBDEBUG
+	usbdebug_tx_byte(byte);
+#endif
 #if CONFIG_CONSOLE_NE2K
 	ne2k_append_data_byte(byte, CONFIG_CONSOLE_NE2K_IO_PORT);
 #endif
@@ -188,6 +194,9 @@ 
 #if CONFIG_CONSOLE_SERIAL8250
 		uart8250_tx_byte(CONFIG_TTYS0_BASE, byte);
 #endif
+#if CONFIG_USBDEBUG
+		usbdebug_tx_byte(byte);
+#endif
 #if CONFIG_CONSOLE_NE2K
 		ne2k_append_data_byte(byte, CONFIG_CONSOLE_NE2K_IO_PORT);
 		ne2k_transmit(CONFIG_CONSOLE_NE2K_IO_PORT);
@@ -200,10 +209,10 @@ 
 	if (console_loglevel >= loglevel) {
 		__console_tx_nibble((value >>  4U) & 0x0fU);
 		__console_tx_nibble(value & 0x0fU);
-	}
 #if CONFIG_CONSOLE_NE2K
 		ne2k_transmit(CONFIG_CONSOLE_NE2K_IO_PORT);
 #endif
+	}
 }
 
 static void __console_tx_hex16(int loglevel, unsigned short value)
@@ -213,10 +222,10 @@ 
 		__console_tx_nibble((value >>  8U) & 0x0fU);
 		__console_tx_nibble((value >>  4U) & 0x0fU);
 		__console_tx_nibble(value & 0x0fU);
-	}
 #if CONFIG_CONSOLE_NE2K
 		ne2k_transmit(CONFIG_CONSOLE_NE2K_IO_PORT);
 #endif
+	}
 }
 
 static void __console_tx_hex32(int loglevel, unsigned int value)
@@ -230,10 +239,10 @@ 
 		__console_tx_nibble((value >>  8U) & 0x0fU);
 		__console_tx_nibble((value >>  4U) & 0x0fU);
 		__console_tx_nibble(value & 0x0fU);
-	}
 #if CONFIG_CONSOLE_NE2K
 		ne2k_transmit(CONFIG_CONSOLE_NE2K_IO_PORT);
 #endif
+	}
 }
 
 static void __console_tx_string(int loglevel, const char *str)