From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 03:52:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3F218735; Sun, 21 Jul 2013 03:52:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 21268D3; Sun, 21 Jul 2013 03:52:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L3qrRJ057023; Sun, 21 Jul 2013 03:52:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L3qqRS057016; Sun, 21 Jul 2013 03:52:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307210352.r6L3qqRS057016@svn.freebsd.org> From: Adrian Chadd Date: Sun, 21 Jul 2013 03:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253508 - head/sys/mips/atheros 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: Sun, 21 Jul 2013 03:52:53 -0000 Author: adrian Date: Sun Jul 21 03:52:52 2013 New Revision: 253508 URL: http://svnweb.freebsd.org/changeset/base/253508 Log: Initialise the watchdog and UART frequencies. For all pre-AR933x chips, the frequency is just the APB frequency. For the AR933x, the UART frequency is different but we just hacked around it. For the AR934x, there's a different PLL setting for these, so they have to be broken out. Modified: head/sys/mips/atheros/ar71xx_chip.c head/sys/mips/atheros/ar724x_chip.c head/sys/mips/atheros/ar91xx_chip.c head/sys/mips/atheros/ar933x_chip.c Modified: head/sys/mips/atheros/ar71xx_chip.c ============================================================================== --- head/sys/mips/atheros/ar71xx_chip.c Sun Jul 21 03:51:24 2013 (r253507) +++ head/sys/mips/atheros/ar71xx_chip.c Sun Jul 21 03:52:52 2013 (r253508) @@ -78,6 +78,8 @@ __FBSDID("$FreeBSD$"); uint32_t u_ar71xx_cpu_freq; uint32_t u_ar71xx_ahb_freq; uint32_t u_ar71xx_ddr_freq; +uint32_t u_ar71xx_uart_freq; +uint32_t u_ar71xx_wdt_freq; uint32_t u_ar71xx_refclk; static void @@ -107,6 +109,8 @@ ar71xx_chip_detect_sys_frequency(void) div = (((pll >> AR71XX_AHB_DIV_SHIFT) & AR71XX_AHB_DIV_MASK) + 1) * 2; u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div; } /* Modified: head/sys/mips/atheros/ar724x_chip.c ============================================================================== --- head/sys/mips/atheros/ar724x_chip.c Sun Jul 21 03:51:24 2013 (r253507) +++ head/sys/mips/atheros/ar724x_chip.c Sun Jul 21 03:52:52 2013 (r253508) @@ -90,6 +90,8 @@ ar724x_chip_detect_sys_frequency(void) div = (((pll >> AR724X_AHB_DIV_SHIFT) & AR724X_AHB_DIV_MASK) + 1) * 2; u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div; } static void Modified: head/sys/mips/atheros/ar91xx_chip.c ============================================================================== --- head/sys/mips/atheros/ar91xx_chip.c Sun Jul 21 03:51:24 2013 (r253507) +++ head/sys/mips/atheros/ar91xx_chip.c Sun Jul 21 03:52:52 2013 (r253508) @@ -84,6 +84,8 @@ ar91xx_chip_detect_sys_frequency(void) div = (((pll >> AR91XX_AHB_DIV_SHIFT) & AR91XX_AHB_DIV_MASK) + 1) * 2; u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div; } static void Modified: head/sys/mips/atheros/ar933x_chip.c ============================================================================== --- head/sys/mips/atheros/ar933x_chip.c Sun Jul 21 03:51:24 2013 (r253507) +++ head/sys/mips/atheros/ar933x_chip.c Sun Jul 21 03:52:52 2013 (r253508) @@ -114,6 +114,10 @@ ar933x_chip_detect_sys_frequency(void) AR933X_PLL_CLOCK_CTRL_AHB_DIV_MASK) + 1; u_ar71xx_ahb_freq = freq / t; } + + /* XXX uart should be the refclk, no? */ + u_ar71xx_uart_freq = u_ar71xx_ahb_freq; + u_ar71xx_wdt_freq = u_ar71xx_ahb_freq; } static void