Author: imp
Date: Wed Jan 22 21:49:20 2014
New Revision: 261040
URL: http://svnweb.freebsd.org/changeset/base/261040

Log:
  Implement support for early printf. You need to define SOCDEV_{PA,VA}
  as described in the comments for the eputc function in your config file.

Modified:
  head/sys/arm/at91/uart_dev_at91usart.c

Modified: head/sys/arm/at91/uart_dev_at91usart.c
==============================================================================
--- head/sys/arm/at91/uart_dev_at91usart.c      Wed Jan 22 21:23:58 2014        
(r261039)
+++ head/sys/arm/at91/uart_dev_at91usart.c      Wed Jan 22 21:49:20 2014        
(r261040)
@@ -276,6 +276,24 @@ at91_usart_putc(struct uart_bas *bas, in
        WR4(bas, USART_THR, c);
 }
 
+#ifdef EARLY_PRINTF
+/*
+ * Early printf support. This assumes that we have the SoC "system" devices
+ * mapped into AT91_BASE. To use this before we adjust the boostrap tables,
+ * You'll need to define SOCDEV_VA to be 0xdc000000 and SOCDEV_PA to be
+ * 0xfc000000 in your config file where you define EARLY_PRINTF
+ */
+volatile uint32_t *at91_dbgu = (volatile uint32_t *)(AT91_BASE + AT91_DBGU0);
+
+void
+eputc(int c)
+{
+       while (!(at91_dbgu[USART_CSR / 4] & USART_CSR_TXRDY))
+               continue;
+       at91_dbgu[USART_THR / 4] = c;
+}
+#endif
+
 /*
  * Check for a character available.
  */
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to