summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2014-01-22 21:49:20 +0000
committerimp <imp@FreeBSD.org>2014-01-22 21:49:20 +0000
commit726f70df319d1cbe4210a081684136ef9d710066 (patch)
treef6b6798a56c93bab280c8f9d94d9c44c3455dfae
parent1fd4c56f7851448b89a76cf1617ae009049ba253 (diff)
downloadFreeBSD-src-726f70df319d1cbe4210a081684136ef9d710066.zip
FreeBSD-src-726f70df319d1cbe4210a081684136ef9d710066.tar.gz
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.
-rw-r--r--sys/arm/at91/uart_dev_at91usart.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/arm/at91/uart_dev_at91usart.c b/sys/arm/at91/uart_dev_at91usart.c
index 6ba7736..d16f239 100644
--- a/sys/arm/at91/uart_dev_at91usart.c
+++ b/sys/arm/at91/uart_dev_at91usart.c
@@ -276,6 +276,24 @@ at91_usart_putc(struct uart_bas *bas, int c)
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.
*/
OpenPOWER on IntegriCloud