Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Aug 2013 04:20:17 +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: r254592 - in head/sys/arm/ti: . am335x
Message-ID:  <201308210420.r7L4KHbE051426@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Wed Aug 21 04:20:17 2013
New Revision: 254592
URL: http://svnweb.freebsd.org/changeset/base/254592

Log:
  Define the uart clocks so that they can be en/disabled at runtime.

Modified:
  head/sys/arm/ti/am335x/am335x_prcm.c
  head/sys/arm/ti/ti_prcm.h

Modified: head/sys/arm/ti/am335x/am335x_prcm.c
==============================================================================
--- head/sys/arm/ti/am335x/am335x_prcm.c	Wed Aug 21 04:10:24 2013	(r254591)
+++ head/sys/arm/ti/am335x/am335x_prcm.c	Wed Aug 21 04:20:17 2013	(r254592)
@@ -62,9 +62,14 @@ __FBSDID("$FreeBSD$");
 #define CM_PER_LCDC_CLKCTRL		(CM_PER + 0x018)
 #define CM_PER_USB0_CLKCTRL		(CM_PER + 0x01C)
 #define CM_PER_TPTC0_CLKCTRL		(CM_PER + 0x024)
+#define CM_PER_UART5_CLKCTRL		(CM_PER + 0x038)
 #define CM_PER_MMC0_CLKCTRL		(CM_PER + 0x03C)
 #define CM_PER_I2C2_CLKCTRL		(CM_PER + 0x044)
 #define CM_PER_I2C1_CLKCTRL		(CM_PER + 0x048)
+#define CM_PER_UART1_CLKCTRL		(CM_PER + 0x06C)
+#define CM_PER_UART2_CLKCTRL		(CM_PER + 0x070)
+#define CM_PER_UART3_CLKCTRL		(CM_PER + 0x074)
+#define CM_PER_UART4_CLKCTRL		(CM_PER + 0x078)
 #define CM_PER_TIMER7_CLKCTRL		(CM_PER + 0x07C)
 #define CM_PER_TIMER2_CLKCTRL		(CM_PER + 0x080)
 #define CM_PER_TIMER3_CLKCTRL		(CM_PER + 0x084)
@@ -146,6 +151,9 @@ static int am335x_clk_musb0_activate(str
 static int am335x_clk_lcdc_activate(struct ti_clock_dev *clkdev);
 static int am335x_clk_pruss_activate(struct ti_clock_dev *clkdev);
 
+#define AM335X_NOOP_CLOCK_DEV(i) \
+	{	.id = (i) }
+
 #define AM335X_GENERIC_CLOCK_DEV(i) \
 	{	.id = (i), \
 		.clk_activate = am335x_clk_generic_activate, \
@@ -217,6 +225,14 @@ struct ti_clock_dev ti_clk_devmap[] = {
 		.clk_get_source_freq = am335x_clk_get_arm_disp_freq,
 	},
 
+        /* UART.  Uart0 clock cannot be controlled. */
+	AM335X_NOOP_CLOCK_DEV(UART0_CLK),
+	AM335X_GENERIC_CLOCK_DEV(UART1_CLK),
+	AM335X_GENERIC_CLOCK_DEV(UART2_CLK),
+	AM335X_GENERIC_CLOCK_DEV(UART3_CLK),
+	AM335X_GENERIC_CLOCK_DEV(UART4_CLK),
+	AM335X_GENERIC_CLOCK_DEV(UART5_CLK),
+
 	/* DMTimer */
 	AM335X_GENERIC_CLOCK_DEV(DMTIMER2_CLK),
 	AM335X_GENERIC_CLOCK_DEV(DMTIMER3_CLK),
@@ -286,6 +302,14 @@ struct am335x_clk_details {
 
 static struct am335x_clk_details g_am335x_clk_details[] = {
 
+        /* UART. UART0 clock not controllable. */
+	_CLK_DETAIL(UART0_CLK, 0, 0),
+	_CLK_DETAIL(UART1_CLK, CM_PER_UART1_CLKCTRL, 0),
+	_CLK_DETAIL(UART2_CLK, CM_PER_UART2_CLKCTRL, 0),
+	_CLK_DETAIL(UART3_CLK, CM_PER_UART3_CLKCTRL, 0),
+	_CLK_DETAIL(UART4_CLK, CM_PER_UART4_CLKCTRL, 0),
+	_CLK_DETAIL(UART5_CLK, CM_PER_UART5_CLKCTRL, 0),
+
 	/* DMTimer modules */
 	_CLK_DETAIL(DMTIMER2_CLK, CM_PER_TIMER2_CLKCTRL, CLKSEL_TIMER2_CLK),
 	_CLK_DETAIL(DMTIMER3_CLK, CM_PER_TIMER3_CLKCTRL, CLKSEL_TIMER3_CLK),

Modified: head/sys/arm/ti/ti_prcm.h
==============================================================================
--- head/sys/arm/ti/ti_prcm.h	Wed Aug 21 04:10:24 2013	(r254591)
+++ head/sys/arm/ti/ti_prcm.h	Wed Aug 21 04:20:17 2013	(r254592)
@@ -81,10 +81,15 @@ typedef enum {
 	USBP2_HSIC_CLK,
 
 	/* UART modules */
-	UART1_CLK = 400,
+	UART0_CLK = 400,
+	UART1_CLK,
 	UART2_CLK,
 	UART3_CLK,
 	UART4_CLK,
+	UART5_CLK,
+	UART6_CLK,
+	UART7_CLK,
+	UART8_CLK,
 
 	/* General purpose timer modules */
 	GPTIMER1_CLK = 500,



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