From owner-svn-src-head@FreeBSD.ORG Wed Jan 22 21:49:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 371527EF; Wed, 22 Jan 2014 21:49:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 239431716; Wed, 22 Jan 2014 21:49:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0MLnLmA079012; Wed, 22 Jan 2014 21:49:21 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0MLnKmO079011; Wed, 22 Jan 2014 21:49:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201401222149.s0MLnKmO079011@svn.freebsd.org> From: Warner Losh Date: Wed, 22 Jan 2014 21:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261040 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jan 2014 21:49:21 -0000 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. */