All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerhard Sittig <gsi-ynQEQJNshbs@public.gmane.org>
To: linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Anatolij Gustschin <agust-ynQEQJNshbs@public.gmane.org>,
	Mike Turquette
	<mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Cc: Detlev Zundel <dzu-ynQEQJNshbs@public.gmane.org>,
	Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>,
	Mauro Carvalho Chehab
	<m.chehab-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Subject: [PATCH v2 17/24] powerpc/mpc512x: improve DIU related clock setup
Date: Thu, 18 Jul 2013 22:20:51 +0200	[thread overview]
Message-ID: <1374178858-8683-3-git-send-email-gsi@denx.de> (raw)
In-Reply-To: <1374166855-7280-1-git-send-email-gsi-ynQEQJNshbs@public.gmane.org>

adapt the DIU clock initialization to the COMMON_CLK approach: device
tree based clock lookup, prepare and unprepare for clocks, work with
frequencies not dividers, call the appropriate clk_*() routines and
don't access CCM registers, remove the pre-enable workaround in the
platform's clock driver

the "best clock" determination now completely relies on the platform's
clock driver to pick a frequency close to what the caller requests, and
merely checks whether the desired frequency was met (is acceptable since
it meets the tolerance of the monitor) -- this approach shall succeed
upon first try in the usual case, will test a few less desirable yet
acceptable frequencies in edge cases, and will fallback to "best effort"
if none of the previously tried frequencies pass the test

Signed-off-by: Gerhard Sittig <gsi-ynQEQJNshbs@public.gmane.org>
---
 arch/powerpc/platforms/512x/clock-commonclk.c |    1 -
 arch/powerpc/platforms/512x/mpc512x_shared.c  |  165 +++++++++++++------------
 2 files changed, 88 insertions(+), 78 deletions(-)

diff --git a/arch/powerpc/platforms/512x/clock-commonclk.c b/arch/powerpc/platforms/512x/clock-commonclk.c
index 99d197d..b8963b7 100644
--- a/arch/powerpc/platforms/512x/clock-commonclk.c
+++ b/arch/powerpc/platforms/512x/clock-commonclk.c
@@ -692,7 +692,6 @@ static void mpc512x_clk_setup_clock_tree(int busfreq)
 	/* some are not yet acquired by their respective drivers */
 	clk_prepare_enable(clks[MPC512x_CLK_PSC3_MCLK]);/* serial console */
 	clk_prepare_enable(clks[MPC512x_CLK_FEC]);	/* network, NFS */
-	clk_prepare_enable(clks[MPC512x_CLK_DIU]);	/* display */
 	clk_prepare_enable(clks[MPC512x_CLK_I2C]);
 	/*
 	 * some have their individual clock subtree with separate clock
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c
index a82a41b..3381eea 100644
--- a/arch/powerpc/platforms/512x/mpc512x_shared.c
+++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
@@ -12,6 +12,7 @@
  * (at your option) any later version.
  */
 
+#include <linux/clk.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
 #include <linux/irq.h>
@@ -70,98 +71,108 @@ struct fsl_diu_shared_fb {
 	bool		in_use;
 };
 
-#define DIU_DIV_MASK	0x000000ff
+/* receives a pixel clock spec in pico seconds, adjusts the DIU clock rate */
 void mpc512x_set_pixel_clock(unsigned int pixclock)
 {
-	unsigned long bestval, bestfreq, speed, busfreq;
-	unsigned long minpixclock, maxpixclock, pixval;
-	struct mpc512x_ccm __iomem *ccm;
 	struct device_node *np;
-	u32 temp;
-	long err;
-	int i;
+	struct clk *clk_diu;
+	unsigned long epsilon, minpixclock, maxpixclock;
+	unsigned long offset, want, got, delta;
 
-	np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-clock");
+	/* lookup and enable the DIU clock */
+	np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-diu");
 	if (!np) {
-		pr_err("Can't find clock control module.\n");
+		pr_err("Could not find DIU device tree node.\n");
 		return;
 	}
-
-	ccm = of_iomap(np, 0);
+	clk_diu = of_clk_get_by_name(np, "per");
 	of_node_put(np);
-	if (!ccm) {
-		pr_err("Can't map clock control module reg.\n");
+	if (IS_ERR(clk_diu)) {
+		pr_err("Could not lookup DIU clock.\n");
 		return;
 	}
-
-	np = of_find_node_by_type(NULL, "cpu");
-	if (np) {
-		const unsigned int *prop =
-			of_get_property(np, "bus-frequency", NULL);
-
-		of_node_put(np);
-		if (prop) {
-			busfreq = *prop;
-		} else {
-			pr_err("Can't get bus-frequency property\n");
-			return;
-		}
-	} else {
-		pr_err("Can't find 'cpu' node.\n");
+	if (clk_prepare_enable(clk_diu)) {
+		pr_err("Could not enable DIU clock.\n");
 		return;
 	}
 
-	/* Pixel Clock configuration */
-	pr_debug("DIU: Bus Frequency = %lu\n", busfreq);
-	speed = busfreq * 4; /* DIU_DIV ratio is 4 * CSB_CLK / DIU_CLK */
-
-	/* Calculate the pixel clock with the smallest error */
-	/* calculate the following in steps to avoid overflow */
-	pr_debug("DIU pixclock in ps - %d\n", pixclock);
-	temp = (1000000000 / pixclock) * 1000;
-	pixclock = temp;
-	pr_debug("DIU pixclock freq - %u\n", pixclock);
-
-	temp = temp / 20; /* pixclock * 0.05 */
-	pr_debug("deviation = %d\n", temp);
-	minpixclock = pixclock - temp;
-	maxpixclock = pixclock + temp;
-	pr_debug("DIU minpixclock - %lu\n", minpixclock);
-	pr_debug("DIU maxpixclock - %lu\n", maxpixclock);
-	pixval = speed/pixclock;
-	pr_debug("DIU pixval = %lu\n", pixval);
-
-	err = LONG_MAX;
-	bestval = pixval;
-	pr_debug("DIU bestval = %lu\n", bestval);
-
-	bestfreq = 0;
-	for (i = -1; i <= 1; i++) {
-		temp = speed / (pixval+i);
-		pr_debug("DIU test pixval i=%d, pixval=%lu, temp freq. = %u\n",
-			i, pixval, temp);
-		if ((temp < minpixclock) || (temp > maxpixclock))
-			pr_debug("DIU exceeds monitor range (%lu to %lu)\n",
-				minpixclock, maxpixclock);
-		else if (abs(temp - pixclock) < err) {
-			pr_debug("Entered the else if block %d\n", i);
-			err = abs(temp - pixclock);
-			bestval = pixval + i;
-			bestfreq = temp;
-		}
+	/*
+	 * convert the picoseconds spec into the desired clock rate,
+	 * determine the acceptable clock range for the monitor (+/- 5%),
+	 * do the calculation in steps to avoid integer overflow
+	 */
+	pr_debug("DIU pixclock in ps - %u\n", pixclock);
+	pixclock = (1000000000 / pixclock) * 1000;
+	pr_debug("DIU pixclock freq  - %u\n", pixclock);
+	epsilon = pixclock / 20; /* pixclock * 0.05 */
+	pr_debug("DIU deviation      - %lu\n", epsilon);
+	minpixclock = pixclock - epsilon;
+	maxpixclock = pixclock + epsilon;
+	pr_debug("DIU minpixclock    - %lu\n", minpixclock);
+	pr_debug("DIU maxpixclock    - %lu\n", maxpixclock);
+
+	/*
+	 * check whether the DIU supports the desired pixel clock
+	 *
+	 * - simply request the desired clock and see what the
+	 *   platform's clock driver will make of it, assuming that it
+	 *   will setup the best approximation of the requested value
+	 * - try other candidate frequencies in the order of decreasing
+	 *   preference (i.e. with increasing distance from the desired
+	 *   pixel clock, and checking the lower frequency before the
+	 *   higher frequency to not overload the hardware) until the
+	 *   first match is found -- any potential subsequent match
+	 *   would only be as good as the former match or typically
+	 *   would be less preferrable
+	 *
+	 * the offset increment of pixelclock divided by 64 is an
+	 * arbitrary choice -- it's simple to calculate, in the typical
+	 * case we expect the first check to succeed already, in the
+	 * worst case seven frequencies get tested (the exact center and
+	 * three more values each to the left and to the right) before
+	 * the 5% tolerance window is exceeded, resulting in fast enough
+	 * execution yet high enough probability of finding a suitable
+	 * value, while the error rate will be in the order of single
+	 * percents
+	 */
+	for (offset = 0; offset <= epsilon; offset += pixclock / 64) {
+		want = pixclock - offset;
+		pr_debug("DIU checking clock - %lu\n", want);
+		clk_set_rate(clk_diu, want);
+		got = clk_get_rate(clk_diu);
+		delta = abs(pixclock - got);
+		if (delta < epsilon)
+			break;
+		if (!offset)
+			continue;
+		want = pixclock + offset;
+		pr_debug("DIU checking clock - %lu\n", want);
+		clk_set_rate(clk_diu, want);
+		got = clk_get_rate(clk_diu);
+		delta = abs(pixclock - got);
+		if (delta < epsilon)
+			break;
 	}
+	if (offset <= epsilon) {
+		pr_debug("DIU clock accepted - %lu\n", want);
+		pr_debug("DIU pixclock want %u, got %lu, delta %lu, eps %lu\n",
+			 pixclock, got, delta, epsilon);
+		return;
+	}
+	pr_warn("DIU pixclock auto search unsuccessful\n");
 
-	pr_debug("DIU chose = %lx\n", bestval);
-	pr_debug("DIU error = %ld\n NomPixClk ", err);
-	pr_debug("DIU: Best Freq = %lx\n", bestfreq);
-	/* Modify DIU_DIV in CCM SCFR1 */
-	temp = in_be32(&ccm->scfr1);
-	pr_debug("DIU: Current value of SCFR1: 0x%08x\n", temp);
-	temp &= ~DIU_DIV_MASK;
-	temp |= (bestval & DIU_DIV_MASK);
-	out_be32(&ccm->scfr1, temp);
-	pr_debug("DIU: Modified value of SCFR1: 0x%08x\n", temp);
-	iounmap(ccm);
+	/*
+	 * what is the most appropriate action to take when the search
+	 * for an available pixel clock which is acceptable to the
+	 * monitor has failed?  disable the DIU (clock) or just provide
+	 * a "best effort"?  we go with the latter
+	 */
+	pr_warn("DIU pixclock best effort fallback (backend's choice)\n");
+	clk_set_rate(clk_diu, pixclock);
+	got = clk_get_rate(clk_diu);
+	delta = abs(pixclock - got);
+	pr_debug("DIU pixclock want %u, got %lu, delta %lu, eps %lu\n",
+		 pixclock, got, delta, epsilon);
 }
 
 enum fsl_diu_monitor_port
-- 
1.7.10.4

WARNING: multiple messages have this Message-ID (diff)
From: Gerhard Sittig <gsi@denx.de>
To: linuxppc-dev@lists.ozlabs.org, Anatolij Gustschin <agust@denx.de>,
	Mike Turquette <mturquette@linaro.org>,
	linux-arm-kernel@lists.infradead.org,
	devicetree-discuss@lists.ozlabs.org
Cc: Detlev Zundel <dzu@denx.de>, Wolfram Sang <wsa@the-dreams.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Gerhard Sittig <gsi@denx.de>,
	Rob Herring <rob.herring@calxeda.com>,
	Mark Brown <broonie@kernel.org>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	David Woodhouse <dwmw2@infradead.org>,
	Wolfgang Grandegger <wg@grandegger.com>,
	Mauro Carvalho Chehab <m.chehab@samsung.com>
Subject: [PATCH v2 17/24] powerpc/mpc512x: improve DIU related clock setup
Date: Thu, 18 Jul 2013 22:20:51 +0200	[thread overview]
Message-ID: <1374178858-8683-3-git-send-email-gsi@denx.de> (raw)
In-Reply-To: <1374166855-7280-1-git-send-email-gsi@denx.de>

adapt the DIU clock initialization to the COMMON_CLK approach: device
tree based clock lookup, prepare and unprepare for clocks, work with
frequencies not dividers, call the appropriate clk_*() routines and
don't access CCM registers, remove the pre-enable workaround in the
platform's clock driver

the "best clock" determination now completely relies on the platform's
clock driver to pick a frequency close to what the caller requests, and
merely checks whether the desired frequency was met (is acceptable since
it meets the tolerance of the monitor) -- this approach shall succeed
upon first try in the usual case, will test a few less desirable yet
acceptable frequencies in edge cases, and will fallback to "best effort"
if none of the previously tried frequencies pass the test

Signed-off-by: Gerhard Sittig <gsi@denx.de>
---
 arch/powerpc/platforms/512x/clock-commonclk.c |    1 -
 arch/powerpc/platforms/512x/mpc512x_shared.c  |  165 +++++++++++++------------
 2 files changed, 88 insertions(+), 78 deletions(-)

diff --git a/arch/powerpc/platforms/512x/clock-commonclk.c b/arch/powerpc/platforms/512x/clock-commonclk.c
index 99d197d..b8963b7 100644
--- a/arch/powerpc/platforms/512x/clock-commonclk.c
+++ b/arch/powerpc/platforms/512x/clock-commonclk.c
@@ -692,7 +692,6 @@ static void mpc512x_clk_setup_clock_tree(int busfreq)
 	/* some are not yet acquired by their respective drivers */
 	clk_prepare_enable(clks[MPC512x_CLK_PSC3_MCLK]);/* serial console */
 	clk_prepare_enable(clks[MPC512x_CLK_FEC]);	/* network, NFS */
-	clk_prepare_enable(clks[MPC512x_CLK_DIU]);	/* display */
 	clk_prepare_enable(clks[MPC512x_CLK_I2C]);
 	/*
 	 * some have their individual clock subtree with separate clock
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c
index a82a41b..3381eea 100644
--- a/arch/powerpc/platforms/512x/mpc512x_shared.c
+++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
@@ -12,6 +12,7 @@
  * (at your option) any later version.
  */
 
+#include <linux/clk.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
 #include <linux/irq.h>
@@ -70,98 +71,108 @@ struct fsl_diu_shared_fb {
 	bool		in_use;
 };
 
-#define DIU_DIV_MASK	0x000000ff
+/* receives a pixel clock spec in pico seconds, adjusts the DIU clock rate */
 void mpc512x_set_pixel_clock(unsigned int pixclock)
 {
-	unsigned long bestval, bestfreq, speed, busfreq;
-	unsigned long minpixclock, maxpixclock, pixval;
-	struct mpc512x_ccm __iomem *ccm;
 	struct device_node *np;
-	u32 temp;
-	long err;
-	int i;
+	struct clk *clk_diu;
+	unsigned long epsilon, minpixclock, maxpixclock;
+	unsigned long offset, want, got, delta;
 
-	np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-clock");
+	/* lookup and enable the DIU clock */
+	np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-diu");
 	if (!np) {
-		pr_err("Can't find clock control module.\n");
+		pr_err("Could not find DIU device tree node.\n");
 		return;
 	}
-
-	ccm = of_iomap(np, 0);
+	clk_diu = of_clk_get_by_name(np, "per");
 	of_node_put(np);
-	if (!ccm) {
-		pr_err("Can't map clock control module reg.\n");
+	if (IS_ERR(clk_diu)) {
+		pr_err("Could not lookup DIU clock.\n");
 		return;
 	}
-
-	np = of_find_node_by_type(NULL, "cpu");
-	if (np) {
-		const unsigned int *prop =
-			of_get_property(np, "bus-frequency", NULL);
-
-		of_node_put(np);
-		if (prop) {
-			busfreq = *prop;
-		} else {
-			pr_err("Can't get bus-frequency property\n");
-			return;
-		}
-	} else {
-		pr_err("Can't find 'cpu' node.\n");
+	if (clk_prepare_enable(clk_diu)) {
+		pr_err("Could not enable DIU clock.\n");
 		return;
 	}
 
-	/* Pixel Clock configuration */
-	pr_debug("DIU: Bus Frequency = %lu\n", busfreq);
-	speed = busfreq * 4; /* DIU_DIV ratio is 4 * CSB_CLK / DIU_CLK */
-
-	/* Calculate the pixel clock with the smallest error */
-	/* calculate the following in steps to avoid overflow */
-	pr_debug("DIU pixclock in ps - %d\n", pixclock);
-	temp = (1000000000 / pixclock) * 1000;
-	pixclock = temp;
-	pr_debug("DIU pixclock freq - %u\n", pixclock);
-
-	temp = temp / 20; /* pixclock * 0.05 */
-	pr_debug("deviation = %d\n", temp);
-	minpixclock = pixclock - temp;
-	maxpixclock = pixclock + temp;
-	pr_debug("DIU minpixclock - %lu\n", minpixclock);
-	pr_debug("DIU maxpixclock - %lu\n", maxpixclock);
-	pixval = speed/pixclock;
-	pr_debug("DIU pixval = %lu\n", pixval);
-
-	err = LONG_MAX;
-	bestval = pixval;
-	pr_debug("DIU bestval = %lu\n", bestval);
-
-	bestfreq = 0;
-	for (i = -1; i <= 1; i++) {
-		temp = speed / (pixval+i);
-		pr_debug("DIU test pixval i=%d, pixval=%lu, temp freq. = %u\n",
-			i, pixval, temp);
-		if ((temp < minpixclock) || (temp > maxpixclock))
-			pr_debug("DIU exceeds monitor range (%lu to %lu)\n",
-				minpixclock, maxpixclock);
-		else if (abs(temp - pixclock) < err) {
-			pr_debug("Entered the else if block %d\n", i);
-			err = abs(temp - pixclock);
-			bestval = pixval + i;
-			bestfreq = temp;
-		}
+	/*
+	 * convert the picoseconds spec into the desired clock rate,
+	 * determine the acceptable clock range for the monitor (+/- 5%),
+	 * do the calculation in steps to avoid integer overflow
+	 */
+	pr_debug("DIU pixclock in ps - %u\n", pixclock);
+	pixclock = (1000000000 / pixclock) * 1000;
+	pr_debug("DIU pixclock freq  - %u\n", pixclock);
+	epsilon = pixclock / 20; /* pixclock * 0.05 */
+	pr_debug("DIU deviation      - %lu\n", epsilon);
+	minpixclock = pixclock - epsilon;
+	maxpixclock = pixclock + epsilon;
+	pr_debug("DIU minpixclock    - %lu\n", minpixclock);
+	pr_debug("DIU maxpixclock    - %lu\n", maxpixclock);
+
+	/*
+	 * check whether the DIU supports the desired pixel clock
+	 *
+	 * - simply request the desired clock and see what the
+	 *   platform's clock driver will make of it, assuming that it
+	 *   will setup the best approximation of the requested value
+	 * - try other candidate frequencies in the order of decreasing
+	 *   preference (i.e. with increasing distance from the desired
+	 *   pixel clock, and checking the lower frequency before the
+	 *   higher frequency to not overload the hardware) until the
+	 *   first match is found -- any potential subsequent match
+	 *   would only be as good as the former match or typically
+	 *   would be less preferrable
+	 *
+	 * the offset increment of pixelclock divided by 64 is an
+	 * arbitrary choice -- it's simple to calculate, in the typical
+	 * case we expect the first check to succeed already, in the
+	 * worst case seven frequencies get tested (the exact center and
+	 * three more values each to the left and to the right) before
+	 * the 5% tolerance window is exceeded, resulting in fast enough
+	 * execution yet high enough probability of finding a suitable
+	 * value, while the error rate will be in the order of single
+	 * percents
+	 */
+	for (offset = 0; offset <= epsilon; offset += pixclock / 64) {
+		want = pixclock - offset;
+		pr_debug("DIU checking clock - %lu\n", want);
+		clk_set_rate(clk_diu, want);
+		got = clk_get_rate(clk_diu);
+		delta = abs(pixclock - got);
+		if (delta < epsilon)
+			break;
+		if (!offset)
+			continue;
+		want = pixclock + offset;
+		pr_debug("DIU checking clock - %lu\n", want);
+		clk_set_rate(clk_diu, want);
+		got = clk_get_rate(clk_diu);
+		delta = abs(pixclock - got);
+		if (delta < epsilon)
+			break;
 	}
+	if (offset <= epsilon) {
+		pr_debug("DIU clock accepted - %lu\n", want);
+		pr_debug("DIU pixclock want %u, got %lu, delta %lu, eps %lu\n",
+			 pixclock, got, delta, epsilon);
+		return;
+	}
+	pr_warn("DIU pixclock auto search unsuccessful\n");
 
-	pr_debug("DIU chose = %lx\n", bestval);
-	pr_debug("DIU error = %ld\n NomPixClk ", err);
-	pr_debug("DIU: Best Freq = %lx\n", bestfreq);
-	/* Modify DIU_DIV in CCM SCFR1 */
-	temp = in_be32(&ccm->scfr1);
-	pr_debug("DIU: Current value of SCFR1: 0x%08x\n", temp);
-	temp &= ~DIU_DIV_MASK;
-	temp |= (bestval & DIU_DIV_MASK);
-	out_be32(&ccm->scfr1, temp);
-	pr_debug("DIU: Modified value of SCFR1: 0x%08x\n", temp);
-	iounmap(ccm);
+	/*
+	 * what is the most appropriate action to take when the search
+	 * for an available pixel clock which is acceptable to the
+	 * monitor has failed?  disable the DIU (clock) or just provide
+	 * a "best effort"?  we go with the latter
+	 */
+	pr_warn("DIU pixclock best effort fallback (backend's choice)\n");
+	clk_set_rate(clk_diu, pixclock);
+	got = clk_get_rate(clk_diu);
+	delta = abs(pixclock - got);
+	pr_debug("DIU pixclock want %u, got %lu, delta %lu, eps %lu\n",
+		 pixclock, got, delta, epsilon);
 }
 
 enum fsl_diu_monitor_port
-- 
1.7.10.4

WARNING: multiple messages have this Message-ID (diff)
From: gsi@denx.de (Gerhard Sittig)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 17/24] powerpc/mpc512x: improve DIU related clock setup
Date: Thu, 18 Jul 2013 22:20:51 +0200	[thread overview]
Message-ID: <1374178858-8683-3-git-send-email-gsi@denx.de> (raw)
In-Reply-To: <1374166855-7280-1-git-send-email-gsi@denx.de>

adapt the DIU clock initialization to the COMMON_CLK approach: device
tree based clock lookup, prepare and unprepare for clocks, work with
frequencies not dividers, call the appropriate clk_*() routines and
don't access CCM registers, remove the pre-enable workaround in the
platform's clock driver

the "best clock" determination now completely relies on the platform's
clock driver to pick a frequency close to what the caller requests, and
merely checks whether the desired frequency was met (is acceptable since
it meets the tolerance of the monitor) -- this approach shall succeed
upon first try in the usual case, will test a few less desirable yet
acceptable frequencies in edge cases, and will fallback to "best effort"
if none of the previously tried frequencies pass the test

Signed-off-by: Gerhard Sittig <gsi@denx.de>
---
 arch/powerpc/platforms/512x/clock-commonclk.c |    1 -
 arch/powerpc/platforms/512x/mpc512x_shared.c  |  165 +++++++++++++------------
 2 files changed, 88 insertions(+), 78 deletions(-)

diff --git a/arch/powerpc/platforms/512x/clock-commonclk.c b/arch/powerpc/platforms/512x/clock-commonclk.c
index 99d197d..b8963b7 100644
--- a/arch/powerpc/platforms/512x/clock-commonclk.c
+++ b/arch/powerpc/platforms/512x/clock-commonclk.c
@@ -692,7 +692,6 @@ static void mpc512x_clk_setup_clock_tree(int busfreq)
 	/* some are not yet acquired by their respective drivers */
 	clk_prepare_enable(clks[MPC512x_CLK_PSC3_MCLK]);/* serial console */
 	clk_prepare_enable(clks[MPC512x_CLK_FEC]);	/* network, NFS */
-	clk_prepare_enable(clks[MPC512x_CLK_DIU]);	/* display */
 	clk_prepare_enable(clks[MPC512x_CLK_I2C]);
 	/*
 	 * some have their individual clock subtree with separate clock
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c
index a82a41b..3381eea 100644
--- a/arch/powerpc/platforms/512x/mpc512x_shared.c
+++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
@@ -12,6 +12,7 @@
  * (at your option) any later version.
  */
 
+#include <linux/clk.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
 #include <linux/irq.h>
@@ -70,98 +71,108 @@ struct fsl_diu_shared_fb {
 	bool		in_use;
 };
 
-#define DIU_DIV_MASK	0x000000ff
+/* receives a pixel clock spec in pico seconds, adjusts the DIU clock rate */
 void mpc512x_set_pixel_clock(unsigned int pixclock)
 {
-	unsigned long bestval, bestfreq, speed, busfreq;
-	unsigned long minpixclock, maxpixclock, pixval;
-	struct mpc512x_ccm __iomem *ccm;
 	struct device_node *np;
-	u32 temp;
-	long err;
-	int i;
+	struct clk *clk_diu;
+	unsigned long epsilon, minpixclock, maxpixclock;
+	unsigned long offset, want, got, delta;
 
-	np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-clock");
+	/* lookup and enable the DIU clock */
+	np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-diu");
 	if (!np) {
-		pr_err("Can't find clock control module.\n");
+		pr_err("Could not find DIU device tree node.\n");
 		return;
 	}
-
-	ccm = of_iomap(np, 0);
+	clk_diu = of_clk_get_by_name(np, "per");
 	of_node_put(np);
-	if (!ccm) {
-		pr_err("Can't map clock control module reg.\n");
+	if (IS_ERR(clk_diu)) {
+		pr_err("Could not lookup DIU clock.\n");
 		return;
 	}
-
-	np = of_find_node_by_type(NULL, "cpu");
-	if (np) {
-		const unsigned int *prop =
-			of_get_property(np, "bus-frequency", NULL);
-
-		of_node_put(np);
-		if (prop) {
-			busfreq = *prop;
-		} else {
-			pr_err("Can't get bus-frequency property\n");
-			return;
-		}
-	} else {
-		pr_err("Can't find 'cpu' node.\n");
+	if (clk_prepare_enable(clk_diu)) {
+		pr_err("Could not enable DIU clock.\n");
 		return;
 	}
 
-	/* Pixel Clock configuration */
-	pr_debug("DIU: Bus Frequency = %lu\n", busfreq);
-	speed = busfreq * 4; /* DIU_DIV ratio is 4 * CSB_CLK / DIU_CLK */
-
-	/* Calculate the pixel clock with the smallest error */
-	/* calculate the following in steps to avoid overflow */
-	pr_debug("DIU pixclock in ps - %d\n", pixclock);
-	temp = (1000000000 / pixclock) * 1000;
-	pixclock = temp;
-	pr_debug("DIU pixclock freq - %u\n", pixclock);
-
-	temp = temp / 20; /* pixclock * 0.05 */
-	pr_debug("deviation = %d\n", temp);
-	minpixclock = pixclock - temp;
-	maxpixclock = pixclock + temp;
-	pr_debug("DIU minpixclock - %lu\n", minpixclock);
-	pr_debug("DIU maxpixclock - %lu\n", maxpixclock);
-	pixval = speed/pixclock;
-	pr_debug("DIU pixval = %lu\n", pixval);
-
-	err = LONG_MAX;
-	bestval = pixval;
-	pr_debug("DIU bestval = %lu\n", bestval);
-
-	bestfreq = 0;
-	for (i = -1; i <= 1; i++) {
-		temp = speed / (pixval+i);
-		pr_debug("DIU test pixval i=%d, pixval=%lu, temp freq. = %u\n",
-			i, pixval, temp);
-		if ((temp < minpixclock) || (temp > maxpixclock))
-			pr_debug("DIU exceeds monitor range (%lu to %lu)\n",
-				minpixclock, maxpixclock);
-		else if (abs(temp - pixclock) < err) {
-			pr_debug("Entered the else if block %d\n", i);
-			err = abs(temp - pixclock);
-			bestval = pixval + i;
-			bestfreq = temp;
-		}
+	/*
+	 * convert the picoseconds spec into the desired clock rate,
+	 * determine the acceptable clock range for the monitor (+/- 5%),
+	 * do the calculation in steps to avoid integer overflow
+	 */
+	pr_debug("DIU pixclock in ps - %u\n", pixclock);
+	pixclock = (1000000000 / pixclock) * 1000;
+	pr_debug("DIU pixclock freq  - %u\n", pixclock);
+	epsilon = pixclock / 20; /* pixclock * 0.05 */
+	pr_debug("DIU deviation      - %lu\n", epsilon);
+	minpixclock = pixclock - epsilon;
+	maxpixclock = pixclock + epsilon;
+	pr_debug("DIU minpixclock    - %lu\n", minpixclock);
+	pr_debug("DIU maxpixclock    - %lu\n", maxpixclock);
+
+	/*
+	 * check whether the DIU supports the desired pixel clock
+	 *
+	 * - simply request the desired clock and see what the
+	 *   platform's clock driver will make of it, assuming that it
+	 *   will setup the best approximation of the requested value
+	 * - try other candidate frequencies in the order of decreasing
+	 *   preference (i.e. with increasing distance from the desired
+	 *   pixel clock, and checking the lower frequency before the
+	 *   higher frequency to not overload the hardware) until the
+	 *   first match is found -- any potential subsequent match
+	 *   would only be as good as the former match or typically
+	 *   would be less preferrable
+	 *
+	 * the offset increment of pixelclock divided by 64 is an
+	 * arbitrary choice -- it's simple to calculate, in the typical
+	 * case we expect the first check to succeed already, in the
+	 * worst case seven frequencies get tested (the exact center and
+	 * three more values each to the left and to the right) before
+	 * the 5% tolerance window is exceeded, resulting in fast enough
+	 * execution yet high enough probability of finding a suitable
+	 * value, while the error rate will be in the order of single
+	 * percents
+	 */
+	for (offset = 0; offset <= epsilon; offset += pixclock / 64) {
+		want = pixclock - offset;
+		pr_debug("DIU checking clock - %lu\n", want);
+		clk_set_rate(clk_diu, want);
+		got = clk_get_rate(clk_diu);
+		delta = abs(pixclock - got);
+		if (delta < epsilon)
+			break;
+		if (!offset)
+			continue;
+		want = pixclock + offset;
+		pr_debug("DIU checking clock - %lu\n", want);
+		clk_set_rate(clk_diu, want);
+		got = clk_get_rate(clk_diu);
+		delta = abs(pixclock - got);
+		if (delta < epsilon)
+			break;
 	}
+	if (offset <= epsilon) {
+		pr_debug("DIU clock accepted - %lu\n", want);
+		pr_debug("DIU pixclock want %u, got %lu, delta %lu, eps %lu\n",
+			 pixclock, got, delta, epsilon);
+		return;
+	}
+	pr_warn("DIU pixclock auto search unsuccessful\n");
 
-	pr_debug("DIU chose = %lx\n", bestval);
-	pr_debug("DIU error = %ld\n NomPixClk ", err);
-	pr_debug("DIU: Best Freq = %lx\n", bestfreq);
-	/* Modify DIU_DIV in CCM SCFR1 */
-	temp = in_be32(&ccm->scfr1);
-	pr_debug("DIU: Current value of SCFR1: 0x%08x\n", temp);
-	temp &= ~DIU_DIV_MASK;
-	temp |= (bestval & DIU_DIV_MASK);
-	out_be32(&ccm->scfr1, temp);
-	pr_debug("DIU: Modified value of SCFR1: 0x%08x\n", temp);
-	iounmap(ccm);
+	/*
+	 * what is the most appropriate action to take when the search
+	 * for an available pixel clock which is acceptable to the
+	 * monitor has failed?  disable the DIU (clock) or just provide
+	 * a "best effort"?  we go with the latter
+	 */
+	pr_warn("DIU pixclock best effort fallback (backend's choice)\n");
+	clk_set_rate(clk_diu, pixclock);
+	got = clk_get_rate(clk_diu);
+	delta = abs(pixclock - got);
+	pr_debug("DIU pixclock want %u, got %lu, delta %lu, eps %lu\n",
+		 pixclock, got, delta, epsilon);
 }
 
 enum fsl_diu_monitor_port
-- 
1.7.10.4

  parent reply	other threads:[~2013-07-18 20:20 UTC|newest]

Thread overview: 432+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-15 18:47 [PATCH v1 00/24] add COMMON_CLK support for PowerPC MPC512x Gerhard Sittig
2013-07-15 18:47 ` Gerhard Sittig
2013-07-15 18:47 ` [PATCH v1 02/24] serial: mpc512x: prepare clocks before enabling them Gerhard Sittig
2013-07-15 18:47   ` Gerhard Sittig
2013-07-15 18:47 ` [PATCH v1 03/24] mtd: mpc5121_nfc: " Gerhard Sittig
2013-07-15 18:47   ` Gerhard Sittig
2013-07-15 18:47   ` Gerhard Sittig
2013-07-15 18:47 ` [PATCH v1 04/24] powerpc: mpc512x: array decl for MCLK registers in CCM Gerhard Sittig
2013-07-15 18:47   ` Gerhard Sittig
2013-07-15 18:47   ` Gerhard Sittig
2013-07-15 18:47 ` [PATCH v1 06/24] dts: mpc512x: prepare for preprocessor support Gerhard Sittig
2013-07-15 18:47   ` Gerhard Sittig
2013-07-15 18:47 ` [PATCH v1 07/24] dts: mpc512x: introduce dt-bindings/clock/ header Gerhard Sittig
2013-07-15 18:47   ` Gerhard Sittig
2013-07-15 18:47 ` [PATCH v1 09/24] clk: mpc512x: introduce COMMON_CLK for MPC512x Gerhard Sittig
2013-07-15 18:47   ` Gerhard Sittig
2013-07-15 18:47   ` Gerhard Sittig
2013-07-15 18:47 ` [PATCH v1 10/24] dts: mpc512x: add clock specs for client lookups Gerhard Sittig
2013-07-15 18:47   ` Gerhard Sittig
2013-07-15 18:47   ` Gerhard Sittig
2013-07-15 18:47 ` [PATCH v1 13/24] spi: mpc512x: OF clock lookup, use the 'mclk' name Gerhard Sittig
2013-07-15 18:47   ` Gerhard Sittig
     [not found] ` <1373914074-20889-1-git-send-email-gsi-ynQEQJNshbs@public.gmane.org>
2013-07-15 18:47   ` [PATCH v1 01/24] spi: mpc512x: prepare clocks before enabling them Gerhard Sittig
2013-07-15 18:47     ` Gerhard Sittig
2013-07-15 18:47     ` Gerhard Sittig
     [not found]     ` <1373914074-20889-2-git-send-email-gsi-ynQEQJNshbs@public.gmane.org>
2013-07-15 20:17       ` Mark Brown
2013-07-15 20:17         ` Mark Brown
2013-07-15 20:17         ` Mark Brown
     [not found]         ` <20130715201734.GF11538-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-07-17 11:22           ` Gerhard Sittig
2013-07-17 11:22             ` Gerhard Sittig
2013-07-17 11:22             ` Gerhard Sittig
2013-07-17 12:07             ` Mark Brown
2013-07-17 12:07               ` Mark Brown
2013-07-17 12:07               ` Mark Brown
     [not found]               ` <20130717120758.GR22506-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-07-17 14:26                 ` Gerhard Sittig
2013-07-17 14:26                   ` Gerhard Sittig
2013-07-17 14:26                   ` Gerhard Sittig
     [not found]                   ` <20130717142628.GN7080-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
2013-07-17 16:53                     ` Mark Brown
2013-07-17 16:53                       ` Mark Brown
2013-07-17 16:53                       ` Mark Brown
2013-07-15 18:47   ` [PATCH v1 05/24] clk: wrap I/O access for improved portability Gerhard Sittig
2013-07-15 18:47     ` Gerhard Sittig
2013-07-15 18:47     ` Gerhard Sittig
2013-07-15 19:38     ` Sascha Hauer
2013-07-15 19:38       ` Sascha Hauer
2013-07-17 12:07       ` Gerhard Sittig
2013-07-17 12:07         ` Gerhard Sittig
2013-07-18  7:04       ` Gerhard Sittig
2013-07-18  7:04         ` Gerhard Sittig
2013-07-18  8:06         ` Sascha Hauer
2013-07-18  8:06           ` Sascha Hauer
     [not found]           ` <20130718080657.GI10380-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-07-18 10:08             ` Mark Brown
2013-07-18 10:08               ` Mark Brown
2013-07-18 10:08               ` Mark Brown
     [not found]         ` <20130718070402.GO7080-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
2013-07-18  9:17           ` Russell King - ARM Linux
2013-07-18  9:17             ` Russell King - ARM Linux
2013-07-18  9:17             ` Russell King - ARM Linux
2013-07-18 17:47             ` Nicolas Pitre
2013-07-18 17:47               ` Nicolas Pitre
2013-08-02 22:09               ` Mike Turquette
2013-08-02 22:09                 ` Mike Turquette
2013-08-02 22:09                 ` Mike Turquette
2013-07-15 18:47   ` [PATCH v1 08/24] dts: mpc512x: add clock related device tree specs Gerhard Sittig
2013-07-15 18:47     ` Gerhard Sittig
2013-07-15 18:47     ` Gerhard Sittig
2013-07-15 18:47   ` [PATCH v1 11/24] net: can: mscan: add a comment on reg to idx mapping Gerhard Sittig
2013-07-15 18:47     ` Gerhard Sittig
2013-07-15 18:47     ` Gerhard Sittig
2013-07-15 18:47   ` [PATCH v1 12/24] net: can: mscan: make mpc512x code use common clock Gerhard Sittig
2013-07-15 18:47     ` Gerhard Sittig
2013-07-15 18:47     ` Gerhard Sittig
2013-07-15 18:47   ` [PATCH v1 14/24] powerpc/mpc512x: improve DIU related clock setup Gerhard Sittig
2013-07-15 18:47     ` Gerhard Sittig
2013-07-15 18:47     ` Gerhard Sittig
2013-07-15 21:46   ` [PATCH v1 15/24] serial: mpc512x: OF clock lookup, use the 'mclk' name Gerhard Sittig
2013-07-15 21:46     ` Gerhard Sittig
2013-07-15 21:46     ` Gerhard Sittig
2013-07-15 21:54     ` Sascha Hauer
2013-07-15 21:54       ` Sascha Hauer
     [not found]       ` <20130715215423.GU14452-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-07-17 11:27         ` Gerhard Sittig
2013-07-17 11:27           ` Gerhard Sittig
2013-07-17 11:27           ` Gerhard Sittig
2013-07-16  6:05   ` [PATCH v1 16/24] clk: mpc512x: remove now obsolete clkdev registration Gerhard Sittig
2013-07-16  6:05     ` Gerhard Sittig
2013-07-16  6:05     ` Gerhard Sittig
2013-07-16  8:45   ` [PATCH v1 21/24] [media] fsl-viu: OF clock lookup, prepare before enable Gerhard Sittig
2013-07-16  8:45     ` Gerhard Sittig
2013-07-16  8:45     ` Gerhard Sittig
2013-07-16  8:45   ` [PATCH v1 23/24] clk: mpc512x: switch to COMMON_CLK, remove PPC_CLOCK Gerhard Sittig
2013-07-16  8:45     ` Gerhard Sittig
2013-07-16  8:45     ` Gerhard Sittig
2013-07-18 17:00   ` [PATCH v2 00/24] add COMMON_CLK support for PowerPC MPC512x Gerhard Sittig
2013-07-18 17:00     ` Gerhard Sittig
2013-07-18 17:00     ` Gerhard Sittig
     [not found]     ` <1374166855-7280-1-git-send-email-gsi-ynQEQJNshbs@public.gmane.org>
2013-07-18 17:00       ` [PATCH v2 01/24] spi: mpc512x: cleanup clock API use Gerhard Sittig
2013-07-18 17:00         ` Gerhard Sittig
2013-07-18 17:00         ` Gerhard Sittig
     [not found]         ` <1374166855-7280-2-git-send-email-gsi-ynQEQJNshbs@public.gmane.org>
2013-07-18 20:49           ` Mark Brown
2013-07-18 20:49             ` Mark Brown
2013-07-18 20:49             ` Mark Brown
2013-07-18 17:00       ` [PATCH v2 02/24] serial: " Gerhard Sittig
2013-07-18 17:00         ` Gerhard Sittig
2013-07-18 17:00         ` Gerhard Sittig
2013-07-18 17:00       ` [PATCH v2 07/24] dts: mpc512x: introduce dt-bindings/clock/ header Gerhard Sittig
2013-07-18 17:00         ` Gerhard Sittig
2013-07-18 17:00         ` Gerhard Sittig
2013-07-18 20:20       ` [PATCH v2 16/24] net: can: mscan: make mpc512x code use common clock Gerhard Sittig
2013-07-18 20:20         ` Gerhard Sittig
2013-07-18 20:20         ` Gerhard Sittig
2013-07-19  7:34         ` Marc Kleine-Budde
2013-07-19  7:34           ` Marc Kleine-Budde
2013-07-19  7:34           ` Marc Kleine-Budde
     [not found]           ` <51E8EC17.9060703-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-07-19  9:41             ` Gerhard Sittig
2013-07-19  9:41               ` Gerhard Sittig
2013-07-19  9:41               ` Gerhard Sittig
     [not found]               ` <20130719094143.GQ7080-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
2013-07-19 10:46                 ` Marc Kleine-Budde
2013-07-19 10:46                   ` Marc Kleine-Budde
2013-07-19 10:46                   ` Marc Kleine-Budde
2013-07-18 20:20       ` Gerhard Sittig [this message]
2013-07-18 20:20         ` [PATCH v2 17/24] powerpc/mpc512x: improve DIU related clock setup Gerhard Sittig
2013-07-18 20:20         ` Gerhard Sittig
2013-07-18 20:20       ` [PATCH v2 22/24] powerpc/fsl-pci: OF clock lookup, prepare before enable Gerhard Sittig
2013-07-18 20:20         ` Gerhard Sittig
2013-07-18 20:20         ` Gerhard Sittig
2013-07-18 20:20       ` [PATCH v2 23/24] clk: mpc512x: switch to COMMON_CLK, remove PPC_CLOCK Gerhard Sittig
2013-07-18 20:20         ` Gerhard Sittig
2013-07-18 20:20         ` Gerhard Sittig
2013-07-18 17:00     ` [PATCH v2 03/24] mtd: mpc5121_nfc: prepare clocks before enabling them Gerhard Sittig
2013-07-18 17:00       ` Gerhard Sittig
2013-07-18 17:00     ` [PATCH v2 04/24] powerpc: mpc512x: array decl for MCLK registers in CCM Gerhard Sittig
2013-07-18 17:00       ` Gerhard Sittig
2013-07-18 17:00     ` [PATCH v2 05/24] clk: wrap I/O access for improved portability Gerhard Sittig
2013-07-18 17:00       ` Gerhard Sittig
2013-07-18 17:00     ` [PATCH v2 06/24] dts: mpc512x: prepare for preprocessor support Gerhard Sittig
2013-07-18 17:00       ` Gerhard Sittig
2013-07-18 17:00     ` [PATCH v2 08/24] dts: mpc512x: add clock related device tree specs Gerhard Sittig
2013-07-18 17:00       ` Gerhard Sittig
2013-07-18 17:00     ` [PATCH v2 09/24] clk: mpc512x: introduce COMMON_CLK for MPC512x Gerhard Sittig
2013-07-18 17:00       ` Gerhard Sittig
2013-07-18 17:00     ` [PATCH v2 10/24] dts: mpc512x: add clock specs for client lookups Gerhard Sittig
2013-07-18 17:00       ` Gerhard Sittig
2013-07-18 17:00       ` Gerhard Sittig
2013-07-18 17:00     ` [PATCH v2 11/24] spi: mpc512x: remove now obsolete clock lookup name Gerhard Sittig
2013-07-18 17:00       ` Gerhard Sittig
2013-07-18 17:00       ` Gerhard Sittig
2013-07-18 17:00     ` [PATCH v2 12/24] serial: " Gerhard Sittig
2013-07-18 17:00       ` Gerhard Sittig
2013-07-18 17:00     ` [PATCH v2 13/24] clk: mpc512x: remove now obsolete clkdev registration Gerhard Sittig
2013-07-18 17:00       ` Gerhard Sittig
2013-07-18 17:00     ` [PATCH v2 14/24] serial: mpc512x: setup the PSC FIFO clock as well Gerhard Sittig
2013-07-18 17:00       ` Gerhard Sittig
2013-07-18 20:20     ` [PATCH v2 15/24] net: can: mscan: add a comment on reg to idx mapping Gerhard Sittig
2013-07-18 20:20       ` Gerhard Sittig
2013-07-18 20:20       ` Gerhard Sittig
2013-07-18 20:20     ` [PATCH v2 18/24] i2c: mpc: OF clock lookup for MPC512x Gerhard Sittig
2013-07-18 20:20       ` Gerhard Sittig
2013-07-18 20:20       ` Gerhard Sittig
2013-07-18 20:33       ` Russell King - ARM Linux
2013-07-18 20:33         ` Russell King - ARM Linux
     [not found]         ` <20130718203324.GB24642-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-07-19  8:42           ` Gerhard Sittig
2013-07-19  8:42             ` Gerhard Sittig
2013-07-19  8:42             ` Gerhard Sittig
2013-07-18 20:20     ` [PATCH v2 19/24] USB: fsl-mph-dr-of: OF clock lookup, prepare and enable Gerhard Sittig
2013-07-18 20:20       ` Gerhard Sittig
2013-07-18 20:20     ` [PATCH v2 20/24] fs_enet: OF clock lookup (non-fatal), " Gerhard Sittig
2013-07-18 20:20       ` Gerhard Sittig
2013-07-18 20:20       ` Gerhard Sittig
2013-07-18 20:20     ` [PATCH v2 21/24] [media] fsl-viu: OF clock lookup, prepare before enable Gerhard Sittig
2013-07-18 20:20       ` Gerhard Sittig
2013-07-18 20:20       ` Gerhard Sittig
2013-07-18 20:20     ` [PATCH v2 24/24] net: can: mscan: remove MPC512x non-COMMON_CLK code path Gerhard Sittig
2013-07-18 20:20       ` Gerhard Sittig
2013-07-22 12:14     ` [PATCH v3 00/31] add COMMON_CLK support for PowerPC MPC512x Gerhard Sittig
2013-07-22 12:14       ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 01/31] spi: mpc512x: cleanup clock API use Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 14:09         ` Mark Brown
2013-07-22 14:09           ` Mark Brown
2013-07-22 14:09           ` Mark Brown
2013-07-23 11:58           ` Gerhard Sittig
2013-07-23 11:58             ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 02/31] serial: " Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 03/31] USB: fsl-mph-dr-of: " Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 04/31] mtd: mpc5121_nfc: " Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 05/31] [media] fsl-viu: " Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 06/31] i2c: mpc: " Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 07/31] fs_enet: silence a build warning (unused variable) Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 08/31] fs_enet: cleanup clock API use Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:28         ` Marc Kleine-Budde
2013-07-22 12:28           ` Marc Kleine-Budde
2013-07-22 12:28           ` Marc Kleine-Budde
2013-07-22 12:14       ` [PATCH v3 09/31] powerpc/fsl-pci: improve " Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 10/31] net: can: mscan: add a comment on reg to idx mapping Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 11/31] net: can: mscan: improve clock API use Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:31         ` Marc Kleine-Budde
2013-07-22 12:31           ` Marc Kleine-Budde
2013-07-22 12:31           ` Marc Kleine-Budde
2013-07-23 11:53           ` Gerhard Sittig
2013-07-23 11:53             ` Gerhard Sittig
2013-07-23 12:33             ` Marc Kleine-Budde
2013-07-23 12:33               ` Marc Kleine-Budde
2013-07-23 12:33               ` Marc Kleine-Budde
2013-08-03 17:07               ` Gerhard Sittig
2013-08-03 17:07                 ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 12/31] powerpc: mpc512x: array decl for MCLK registers in CCM Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 13/31] clk: wrap I/O access for improved portability Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-08-02 22:30         ` Mike Turquette
2013-08-02 22:30           ` Mike Turquette
2013-08-02 22:30           ` Mike Turquette
2013-08-03 14:08           ` Gerhard Sittig
2013-08-03 14:08             ` Gerhard Sittig
2013-08-23 22:05           ` Anatolij Gustschin
2013-08-23 22:05             ` Anatolij Gustschin
2013-08-28  0:55             ` Mike Turquette
2013-08-28  0:55               ` Mike Turquette
2013-07-22 12:14       ` [PATCH v3 14/31] dts: mpc512x: prepare for preprocessor support Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 15/31] dts: mpc512x: introduce dt-bindings/clock/ header Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-08-02 22:43         ` Mike Turquette
2013-08-02 22:43           ` Mike Turquette
2013-08-02 22:43           ` Mike Turquette
2013-08-03 14:19           ` Gerhard Sittig
2013-08-03 14:19             ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 16/31] dts: mpc512x: add clock related device tree specs Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-08-02 22:46         ` Mike Turquette
2013-08-02 22:46           ` Mike Turquette
2013-08-02 22:46           ` Mike Turquette
2013-07-22 12:14       ` [PATCH v3 17/31] clk: mpc512x: introduce COMMON_CLK for MPC512x Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-23 13:14         ` Gerhard Sittig
2013-07-23 13:14           ` Gerhard Sittig
2013-08-02 23:30           ` Mike Turquette
2013-08-02 23:30             ` Mike Turquette
2013-08-03 14:39             ` Gerhard Sittig
2013-08-03 14:39               ` Gerhard Sittig
2013-08-05 17:11               ` Mike Turquette
2013-08-05 17:11                 ` Mike Turquette
2013-08-02 23:41         ` Mike Turquette
2013-08-02 23:41           ` Mike Turquette
2013-08-02 23:41           ` Mike Turquette
2013-08-03 15:03           ` Gerhard Sittig
2013-08-03 15:03             ` Gerhard Sittig
2013-08-05 11:37         ` Mark Rutland
2013-08-05 11:37           ` Mark Rutland
2013-08-05 11:37           ` Mark Rutland
2013-08-05 17:01           ` Gerhard Sittig
2013-08-05 17:01             ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 18/31] dts: mpc512x: add clock specs for client lookups Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-08-02 23:41         ` Mike Turquette
2013-08-02 23:41           ` Mike Turquette
2013-08-02 23:41           ` Mike Turquette
2013-08-03 15:36           ` Gerhard Sittig
2013-08-03 15:36             ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 19/31] clk: mpc512x: don't pre-enable FEC and I2C clocks Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 20/31] spi: mpc512x: remove now obsolete clock lookup name Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 21/31] serial: " Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 22/31] clk: mpc512x: remove clkdev registration (uart, spi) Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 23/31] serial: mpc512x: setup the PSC FIFO clock as well Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 24/31] USB: fsl-mph-dr-of: remove now obsolete clock lookup name Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 25/31] mtd: mpc5121_nfc: " Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 26/31] [media] fsl-viu: " Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 27/31] net: can: mscan: add common clock support for mpc512x Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 13:04         ` Marc Kleine-Budde
2013-07-22 13:04           ` Marc Kleine-Budde
2013-07-22 13:04           ` Marc Kleine-Budde
2013-07-23 12:07           ` Gerhard Sittig
2013-07-23 12:07             ` Gerhard Sittig
2013-07-23 12:37             ` Marc Kleine-Budde
2013-07-23 12:37               ` Marc Kleine-Budde
2013-07-22 12:14       ` [PATCH v3 28/31] powerpc/mpc512x: improve DIU related clock setup Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 29/31] clk: mpc512x: switch to COMMON_CLK, remove PPC_CLOCK Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 30/31] net: can: mscan: remove non-common_clock code for MPC512x Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:14       ` [PATCH v3 31/31] clk: mpc512x: remove clkdev registration (sys/ref, header) Gerhard Sittig
2013-07-22 12:14         ` Gerhard Sittig
2013-07-22 12:33       ` [PATCH v3 00/31] add COMMON_CLK support for PowerPC MPC512x Gerhard Sittig
2013-07-22 12:33         ` Gerhard Sittig
2013-08-06 20:43       ` [PATCH v4 " Gerhard Sittig
2013-08-06 20:43         ` Gerhard Sittig
2013-08-06 20:43         ` [PATCH v4 01/31] spi: mpc512x: cleanup clock API use Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-21 19:22           ` Anatolij Gustschin
2013-08-21 19:48             ` Mark Brown
2013-08-21 20:38               ` Anatolij Gustschin
2013-08-22 10:02           ` Mark Brown
2013-08-22 10:02             ` Mark Brown
2013-08-06 20:43         ` [PATCH v4 02/31] serial: " Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-12 18:27           ` Greg Kroah-Hartman
2013-08-12 18:27             ` Greg Kroah-Hartman
2013-08-21 19:52           ` Anatolij Gustschin
2013-08-06 20:43         ` [PATCH v4 03/31] USB: fsl-mph-dr-of: " Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-21 20:45           ` Anatolij Gustschin
2013-08-06 20:43         ` [PATCH v4 04/31] mtd: mpc5121_nfc: " Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-23 21:47           ` Anatolij Gustschin
2013-08-06 20:43         ` [PATCH v4 05/31] [media] fsl-viu: " Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-23 21:48           ` Anatolij Gustschin
2013-08-06 20:43         ` [PATCH v4 06/31] i2c: mpc: " Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-06 20:43         ` [PATCH v4 07/31] fs_enet: silence a build warning (unused variable) Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-06 20:43         ` [PATCH v4 08/31] fs_enet: cleanup clock API use Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-06 20:43         ` [PATCH v4 09/31] powerpc/fsl-pci: improve " Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-08 20:12           ` Anatolij Gustschin
2013-08-12  7:57             ` Gerhard Sittig
2013-08-28 12:08           ` Gerhard Sittig
2013-08-28 12:08             ` Gerhard Sittig
2013-08-28 15:59             ` Gerhard Sittig
2013-08-28 15:59               ` Gerhard Sittig
2013-08-28 22:10               ` Benjamin Herrenschmidt
2013-08-28 22:10                 ` Benjamin Herrenschmidt
2013-08-06 20:43         ` [PATCH v4 10/31] net: can: mscan: add a comment on reg to idx mapping Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-06 20:43         ` [PATCH v4 11/31] net: can: mscan: improve clock API use Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-07  7:28           ` Marc Kleine-Budde
2013-08-07  7:28             ` Marc Kleine-Budde
2013-08-08 19:50             ` Gerhard Sittig
2013-08-08 19:50               ` Gerhard Sittig
2013-08-07  7:30           ` Marc Kleine-Budde
2013-08-07  7:30             ` Marc Kleine-Budde
2013-08-07  7:35             ` Marc Kleine-Budde
2013-08-07  7:35               ` Marc Kleine-Budde
2013-08-06 20:43         ` [PATCH v4 12/31] powerpc: mpc512x: array decl for MCLK registers in CCM Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-23 21:49           ` Anatolij Gustschin
2013-08-06 20:43         ` [PATCH v4 13/31] clk: wrap I/O access for improved portability Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-06 20:43         ` [PATCH v4 14/31] dts: mpc512x: prepare for preprocessor support Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-23 22:18           ` Anatolij Gustschin
2013-08-06 20:43         ` [PATCH v4 15/31] dts: mpc512x: introduce dt-bindings/clock/ header Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-06 20:43         ` [PATCH v4 16/31] dts: mpc512x: add clock related device tree specs Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-06 20:43         ` [PATCH v4 17/31] clk: mpc512x: introduce COMMON_CLK for MPC512x Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-06 20:43         ` [PATCH v4 18/31] dts: mpc512x: add clock specs for client lookups Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-06 20:43         ` [PATCH v4 19/31] clk: mpc512x: don't pre-enable FEC and I2C clocks Gerhard Sittig
2013-08-06 20:43           ` Gerhard Sittig
2013-08-06 20:44         ` [PATCH v4 20/31] spi: mpc512x: switch to CCF names in clock lookup Gerhard Sittig
2013-08-06 20:44           ` Gerhard Sittig
2013-08-06 20:44         ` [PATCH v4 21/31] serial: " Gerhard Sittig
2013-08-06 20:44           ` Gerhard Sittig
2013-08-12 18:27           ` Greg Kroah-Hartman
2013-08-12 18:27             ` Greg Kroah-Hartman
2013-08-06 20:44         ` [PATCH v4 22/31] clk: mpc512x: remove PSC (UART, SPI) compat workarounds Gerhard Sittig
2013-08-06 20:44           ` Gerhard Sittig
2013-08-06 20:44         ` [PATCH v4 23/31] serial: mpc512x: setup the PSC FIFO clock as well Gerhard Sittig
2013-08-06 20:44           ` Gerhard Sittig
2013-08-12 18:27           ` Greg Kroah-Hartman
2013-08-12 18:27             ` Greg Kroah-Hartman
2013-08-06 20:44         ` [PATCH v4 24/31] USB: fsl-mph-dr-of: remove now obsolete clock lookup name Gerhard Sittig
2013-08-06 20:44           ` Gerhard Sittig
2013-08-06 20:44         ` [PATCH v4 25/31] mtd: mpc5121_nfc: " Gerhard Sittig
2013-08-06 20:44           ` Gerhard Sittig
2013-08-06 20:44         ` [PATCH v4 26/31] [media] fsl-viu: " Gerhard Sittig
2013-08-06 20:44           ` Gerhard Sittig
2013-08-06 20:44         ` [PATCH v4 27/31] net: can: mscan: add common clock support for mpc512x Gerhard Sittig
2013-08-06 20:44           ` Gerhard Sittig
2013-08-06 20:44         ` [PATCH v4 28/31] powerpc/mpc512x: improve DIU related clock setup Gerhard Sittig
2013-08-06 20:44           ` Gerhard Sittig
2013-08-06 20:44         ` [PATCH v4 29/31] clk: mpc512x: switch to COMMON_CLK, remove PPC_CLOCK Gerhard Sittig
2013-08-06 20:44           ` Gerhard Sittig
2013-08-06 20:44         ` [PATCH v4 30/31] net: can: mscan: remove non-CCF code for MPC512x Gerhard Sittig
2013-08-06 20:44           ` Gerhard Sittig
2013-08-06 20:44         ` [PATCH v4 31/31] clk: mpc512x: remove remaining migration workarounds Gerhard Sittig
2013-08-06 20:44           ` Gerhard Sittig
2013-08-06 21:31         ` [PATCH v4 00/31] add COMMON_CLK support for PowerPC MPC512x Gerhard Sittig
2013-08-06 21:31           ` Gerhard Sittig
2013-08-07  7:36           ` Gerhard Sittig
2013-08-07  7:36             ` Gerhard Sittig
2013-08-07 15:40         ` Kumar Gala
2013-08-07 15:40           ` Kumar Gala
2013-08-08 18:41           ` Gerhard Sittig
2013-08-08 18:41             ` Gerhard Sittig
2013-08-28 13:50         ` Gerhard Sittig
2013-08-28 13:50           ` Gerhard Sittig
2013-07-16  6:05 ` [PATCH v1 17/24] serial: mpc512x: setup the PSC FIFO clock as well Gerhard Sittig
2013-07-16  6:05   ` Gerhard Sittig
2013-07-16  6:05 ` [PATCH v1 18/24] i2c: mpc: OF clock lookup for MPC512x Gerhard Sittig
2013-07-16  6:05   ` Gerhard Sittig
2013-07-16  6:05   ` Gerhard Sittig
2013-07-16  6:05 ` [PATCH v1 19/24] USB: fsl-mph-dr-of: OF clock lookup, prepare and enable Gerhard Sittig
2013-07-16  6:05   ` Gerhard Sittig
2013-07-16  6:05   ` Gerhard Sittig
2013-07-16  6:05 ` [PATCH v1 20/24] fs_enet: OF clock lookup (non-fatal), " Gerhard Sittig
2013-07-16  6:05   ` Gerhard Sittig
2013-07-16  6:05   ` Gerhard Sittig
2013-07-16  8:45 ` [PATCH v1 22/24] powerpc/fsl-pci: OF clock lookup, prepare before enable Gerhard Sittig
2013-07-16  8:45   ` Gerhard Sittig
2013-07-16  8:45 ` [PATCH v1 24/24] net: can: mscan: remove MPC512x non-COMMON_CLK code path Gerhard Sittig
2013-07-16  8:45   ` Gerhard Sittig
2013-07-16  8:45   ` Gerhard Sittig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1374178858-8683-3-git-send-email-gsi@denx.de \
    --to=gsi-ynqeqjnshbs@public.gmane.org \
    --cc=agust-ynQEQJNshbs@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=dzu-ynQEQJNshbs@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=m.chehab-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    --cc=wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org \
    --cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.