Date: Wed, 22 Jan 2014 21:49:20 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261040 - head/sys/arm/at91 Message-ID: <201401222149.s0MLnKmO079011@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401222149.s0MLnKmO079011>