Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Feb 2014 14:29:59 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r262244 - head/sys/arm/freescale/imx
Message-ID:  <201402201429.s1KETxk3090247@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Thu Feb 20 14:29:59 2014
New Revision: 262244
URL: http://svnweb.freebsd.org/changeset/base/262244

Log:
  Add early printf support, wrapped in #if 0 because it's only rarely needed.

Modified:
  head/sys/arm/freescale/imx/imx6_machdep.c

Modified: head/sys/arm/freescale/imx/imx6_machdep.c
==============================================================================
--- head/sys/arm/freescale/imx/imx6_machdep.c	Thu Feb 20 13:33:18 2014	(r262243)
+++ head/sys/arm/freescale/imx/imx6_machdep.c	Thu Feb 20 14:29:59 2014	(r262244)
@@ -190,3 +190,27 @@ u_int imx_soc_type()
 	return (IMXSOC_6Q);
 }
 
+/*
+ * Early putc routine for EARLY_PRINTF support.  To use, add to kernel config:
+ *   option SOCDEV_PA=0x02000000
+ *   option SOCDEV_VA=0x02000000
+ *   option EARLY_PRINTF
+ * Resist the temptation to change the #if 0 to #ifdef EARLY_PRINTF here. It
+ * makes sense now, but if multiple SOCs do that it will make early_putc another
+ * duplicate symbol to be eliminated on the path to a generic kernel.
+ */
+#if 0 
+static void 
+imx6_early_putc(int c)
+{
+	volatile uint32_t * UART_STAT_REG = (uint32_t *)0x02020098;
+	volatile uint32_t * UART_TX_REG   = (uint32_t *)0x02020040;
+	const uint32_t      UART_TXRDY    = (1 << 3);
+
+	while ((*UART_STAT_REG & UART_TXRDY) == 0)
+		continue;
+	*UART_TX_REG = c;
+}
+early_putc_t *early_putc = imx6_early_putc;
+#endif
+



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402201429.s1KETxk3090247>