From owner-svn-src-head@FreeBSD.ORG Wed Aug 21 04:20:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 63D4B953; Wed, 21 Aug 2013 04:20:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) 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 42D4022A3; Wed, 21 Aug 2013 04:20:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7L4KIvv051428; Wed, 21 Aug 2013 04:20:18 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7L4KHbE051426; Wed, 21 Aug 2013 04:20:17 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201308210420.r7L4KHbE051426@svn.freebsd.org> From: Ian Lepore Date: Wed, 21 Aug 2013 04:20:17 +0000 (UTC) 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 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.14 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, 21 Aug 2013 04:20:18 -0000 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,