Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Apr 2014 21:06:44 +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: r264056 - in head/sys: arm/freescale/imx boot/fdt/dts/arm
Message-ID:  <201404022106.s32L6iMn076926@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Wed Apr  2 21:06:43 2014
New Revision: 264056
URL: http://svnweb.freebsd.org/changeset/base/264056

Log:
  Switch imx6 to using the mpcore per-cpu event timers, but continue to use
  the GPT timer, which is fixed-frequency, as a timecounter.

Modified:
  head/sys/arm/freescale/imx/files.imx6
  head/sys/arm/freescale/imx/imx6_anatop.c
  head/sys/arm/freescale/imx/imx6_machdep.c
  head/sys/boot/fdt/dts/arm/imx6.dtsi

Modified: head/sys/arm/freescale/imx/files.imx6
==============================================================================
--- head/sys/arm/freescale/imx/files.imx6	Wed Apr  2 20:18:17 2014	(r264055)
+++ head/sys/arm/freescale/imx/files.imx6	Wed Apr  2 21:06:43 2014	(r264056)
@@ -16,6 +16,7 @@ kern/kern_clocksource.c			standard
 arm/arm/gic.c				standard
 arm/arm/pl310.c				standard
 arm/arm/bus_space-v6.c			standard
+arm/arm/mpcore_timer.c			standard
 arm/freescale/fsl_ocotp.c		standard
 arm/freescale/imx/imx6_anatop.c		standard
 arm/freescale/imx/imx_common.c		standard

Modified: head/sys/arm/freescale/imx/imx6_anatop.c
==============================================================================
--- head/sys/arm/freescale/imx/imx6_anatop.c	Wed Apr  2 20:18:17 2014	(r264055)
+++ head/sys/arm/freescale/imx/imx6_anatop.c	Wed Apr  2 21:06:43 2014	(r264056)
@@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/bus.h>
 #include <machine/fdt.h>
 
+#include <arm/arm/mpcore_timervar.h>
 #include <arm/freescale/fsl_ocotpreg.h>
 #include <arm/freescale/fsl_ocotpvar.h>
 #include <arm/freescale/imx/imx6_anatopreg.h>
@@ -263,6 +264,8 @@ cpufreq_set_clock(struct imx6_anatop_sof
 
 	imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, 
 	    IMX6_ANALOG_CCM_PLL_ARM_BYPASS);
+
+	arm_tmr_change_frequency(sc->cpu_curhz / 2);
 }
 
 static void

Modified: head/sys/arm/freescale/imx/imx6_machdep.c
==============================================================================
--- head/sys/arm/freescale/imx/imx6_machdep.c	Wed Apr  2 20:18:17 2014	(r264055)
+++ head/sys/arm/freescale/imx/imx6_machdep.c	Wed Apr  2 21:06:43 2014	(r264056)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/devmap.h>
 #include <machine/machdep.h>
 
+#include <arm/arm/mpcore_timervar.h>
 #include <arm/freescale/imx/imx6_anatopreg.h>
 #include <arm/freescale/imx/imx6_anatopvar.h>
 #include <arm/freescale/imx/imx_machdep.h>
@@ -55,6 +56,8 @@ void
 initarm_early_init(void)
 {
 
+	/* Inform the MPCore timer driver that its clock is variable. */
+	arm_tmr_change_frequency(ARM_TMR_FREQUENCY_VARIES);
 }
 
 void

Modified: head/sys/boot/fdt/dts/arm/imx6.dtsi
==============================================================================
--- head/sys/boot/fdt/dts/arm/imx6.dtsi	Wed Apr  2 20:18:17 2014	(r264055)
+++ head/sys/boot/fdt/dts/arm/imx6.dtsi	Wed Apr  2 21:06:43 2014	(r264056)
@@ -71,6 +71,14 @@
 			       0x00a00100 0x00000100>;
 		};
 
+		mp_tmr0@00a00200 {
+			compatible = "arm,mpcore-timers";
+			reg = <0x00a00200 0x100
+			       0x00a00600 0x100>;
+			interrupts = <27 29>;
+			interrupt-parent = <&gic>;
+		};
+
 		l2-cache@00a02000 {
 			compatible = "arm,pl310-cache", "arm,pl310";
 			reg = <0xa02000 0x1000>;



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