Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Oct 2013 21:33:06 +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: r256774 - head/sys/arm/freescale/imx
Message-ID:  <201310192133.r9JLX6JN010958@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Sat Oct 19 21:33:06 2013
New Revision: 256774
URL: http://svnweb.freebsd.org/changeset/base/256774

Log:
  Clock divisors 0-3 correspond to dividing by 1-4, so add 1 before dividing.

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

Modified: head/sys/arm/freescale/imx/imx51_ccm.c
==============================================================================
--- head/sys/arm/freescale/imx/imx51_ccm.c	Sat Oct 19 18:51:06 2013	(r256773)
+++ head/sys/arm/freescale/imx/imx51_ccm.c	Sat Oct 19 21:33:06 2013	(r256774)
@@ -278,8 +278,8 @@ imx51_get_clock(enum imx51_clock clk)
 	case IMX51CLK_MAIN_BUS_CLK:
 		freq = imx51_get_clock(IMX51CLK_MAIN_BUS_CLK_SRC);
 		cdcr = bus_read_4(ccm_softc->res[0], CCMC_CDCR);
-		return freq / (cdcr & CDCR_PERIPH_CLK_DVFS_PODF_MASK) >>
-			CDCR_PERIPH_CLK_DVFS_PODF_SHIFT;
+		return freq / (1 + ((cdcr & CDCR_PERIPH_CLK_DVFS_PODF_MASK) >>
+			CDCR_PERIPH_CLK_DVFS_PODF_SHIFT));
 	case IMX51CLK_AHB_CLK_ROOT:
 		freq = imx51_get_clock(IMX51CLK_MAIN_BUS_CLK);
 		cbcdr = bus_read_4(ccm_softc->res[0], CCMC_CBCDR);



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