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 23/24] clk: mpc512x: switch to COMMON_CLK, remove PPC_CLOCK
Date: Thu, 18 Jul 2013 22:20:57 +0200	[thread overview]
Message-ID: <1374178858-8683-9-git-send-email-gsi@denx.de> (raw)
In-Reply-To: <1374166855-7280-1-git-send-email-gsi-ynQEQJNshbs@public.gmane.org>

completely switch to, i.e. unconditionally use COMMON_CLK for the
MPC512x platform, and retire the PPC_CLOCK implementation for that
platform after the transition has completed

Signed-off-by: Gerhard Sittig <gsi-ynQEQJNshbs@public.gmane.org>
---
 arch/powerpc/platforms/512x/Kconfig  |   14 +-
 arch/powerpc/platforms/512x/Makefile |    3 +-
 arch/powerpc/platforms/512x/clock.c  |  753 ----------------------------------
 3 files changed, 2 insertions(+), 768 deletions(-)
 delete mode 100644 arch/powerpc/platforms/512x/clock.c

diff --git a/arch/powerpc/platforms/512x/Kconfig b/arch/powerpc/platforms/512x/Kconfig
index c5fcdd0..5aa3f4b 100644
--- a/arch/powerpc/platforms/512x/Kconfig
+++ b/arch/powerpc/platforms/512x/Kconfig
@@ -1,21 +1,9 @@
-config MPC512x_COMMON_CLK
-	bool "MPC512x platform uses COMMON_CLK"
-	default y
-	depends on PPC_MPC512x
-	help
-	  This option is only here to support tests and comparison
-	  during development and migration.  This option will get
-	  removed after the COMMON_CLK support for MPC512x has become
-	  fully operational and all drivers were adjusted to explicitly
-	  acquire their required clocks.
-
 config PPC_MPC512x
 	bool "512x-based boards"
 	depends on 6xx
+	select COMMON_CLK
 	select FSL_SOC
 	select IPIC
-	select PPC_CLOCK if !MPC512x_COMMON_CLK
-	select COMMON_CLK if MPC512x_COMMON_CLK
 	select PPC_PCI_CHOICE
 	select FSL_PCI if PCI
 	select ARCH_WANT_OPTIONAL_GPIOLIB
diff --git a/arch/powerpc/platforms/512x/Makefile b/arch/powerpc/platforms/512x/Makefile
index 1e05f9d..bb20116 100644
--- a/arch/powerpc/platforms/512x/Makefile
+++ b/arch/powerpc/platforms/512x/Makefile
@@ -1,8 +1,7 @@
 #
 # Makefile for the Freescale PowerPC 512x linux kernel.
 #
-obj-$(CONFIG_PPC_CLOCK)		+= clock.o
-obj-$(CONFIG_COMMON_CLK)	+= clock-commonclk.o
+obj-y				+= clock-commonclk.o
 obj-y				+= mpc512x_shared.o
 obj-$(CONFIG_MPC5121_ADS)	+= mpc5121_ads.o mpc5121_ads_cpld.o
 obj-$(CONFIG_MPC512x_GENERIC)	+= mpc512x_generic.o
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c
deleted file mode 100644
index e504166..0000000
--- a/arch/powerpc/platforms/512x/clock.c
+++ /dev/null
@@ -1,753 +0,0 @@
-/*
- * Copyright (C) 2007,2008 Freescale Semiconductor, Inc. All rights reserved.
- *
- * Author: John Rigby <jrigby-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
- *
- * Implements the clk api defined in include/linux/clk.h
- *
- *    Original based on linux/arch/arm/mach-integrator/clock.c
- *
- *    Copyright (C) 2004 ARM Limited.
- *    Written by Deep Blue Solutions Limited.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <linux/kernel.h>
-#include <linux/list.h>
-#include <linux/errno.h>
-#include <linux/err.h>
-#include <linux/module.h>
-#include <linux/string.h>
-#include <linux/clk.h>
-#include <linux/mutex.h>
-#include <linux/io.h>
-
-#include <linux/of_platform.h>
-#include <asm/mpc5xxx.h>
-#include <asm/mpc5121.h>
-#include <asm/clk_interface.h>
-
-#include "mpc512x.h"
-
-#undef CLK_DEBUG
-
-static int clocks_initialized;
-
-#define CLK_HAS_RATE	0x1	/* has rate in MHz */
-#define CLK_HAS_CTRL	0x2	/* has control reg and bit */
-
-struct clk {
-	struct list_head node;
-	char name[32];
-	int flags;
-	struct device *dev;
-	unsigned long rate;
-	struct module *owner;
-	void (*calc) (struct clk *);
-	struct clk *parent;
-	int reg, bit;		/* CLK_HAS_CTRL */
-	int div_shift;		/* only used by generic_div_clk_calc */
-};
-
-static LIST_HEAD(clocks);
-static DEFINE_MUTEX(clocks_mutex);
-
-static struct clk *mpc5121_clk_get(struct device *dev, const char *id)
-{
-	struct clk *p, *clk = ERR_PTR(-ENOENT);
-	int dev_match;
-	int id_match;
-
-	if (dev == NULL || id == NULL)
-		return clk;
-
-	mutex_lock(&clocks_mutex);
-	list_for_each_entry(p, &clocks, node) {
-		dev_match = id_match = 0;
-
-		if (dev == p->dev)
-			dev_match++;
-		if (strcmp(id, p->name) == 0)
-			id_match++;
-		if ((dev_match || id_match) && try_module_get(p->owner)) {
-			clk = p;
-			break;
-		}
-	}
-	mutex_unlock(&clocks_mutex);
-
-	return clk;
-}
-
-#ifdef CLK_DEBUG
-static void dump_clocks(void)
-{
-	struct clk *p;
-
-	mutex_lock(&clocks_mutex);
-	printk(KERN_INFO "CLOCKS:\n");
-	list_for_each_entry(p, &clocks, node) {
-		pr_info("  %s=%ld", p->name, p->rate);
-		if (p->parent)
-			pr_cont(" %s=%ld", p->parent->name,
-			       p->parent->rate);
-		if (p->flags & CLK_HAS_CTRL)
-			pr_cont(" reg/bit=%d/%d", p->reg, p->bit);
-		pr_cont("\n");
-	}
-	mutex_unlock(&clocks_mutex);
-}
-#define	DEBUG_CLK_DUMP() dump_clocks()
-#else
-#define	DEBUG_CLK_DUMP()
-#endif
-
-
-static void mpc5121_clk_put(struct clk *clk)
-{
-	module_put(clk->owner);
-}
-
-#define NRPSC 12
-
-struct mpc512x_clockctl {
-	u32 spmr;		/* System PLL Mode Reg */
-	u32 sccr[2];		/* System Clk Ctrl Reg 1 & 2 */
-	u32 scfr1;		/* System Clk Freq Reg 1 */
-	u32 scfr2;		/* System Clk Freq Reg 2 */
-	u32 reserved;
-	u32 bcr;		/* Bread Crumb Reg */
-	u32 pccr[NRPSC];	/* PSC Clk Ctrl Reg 0-11 */
-	u32 spccr;		/* SPDIF Clk Ctrl Reg */
-	u32 cccr;		/* CFM Clk Ctrl Reg */
-	u32 dccr;		/* DIU Clk Cnfg Reg */
-};
-
-static struct mpc512x_clockctl __iomem *clockctl;
-
-static int mpc5121_clk_enable(struct clk *clk)
-{
-	unsigned int mask;
-
-	if (clk->flags & CLK_HAS_CTRL) {
-		mask = in_be32(&clockctl->sccr[clk->reg]);
-		mask |= 1 << clk->bit;
-		out_be32(&clockctl->sccr[clk->reg], mask);
-	}
-	return 0;
-}
-
-static void mpc5121_clk_disable(struct clk *clk)
-{
-	unsigned int mask;
-
-	if (clk->flags & CLK_HAS_CTRL) {
-		mask = in_be32(&clockctl->sccr[clk->reg]);
-		mask &= ~(1 << clk->bit);
-		out_be32(&clockctl->sccr[clk->reg], mask);
-	}
-}
-
-static unsigned long mpc5121_clk_get_rate(struct clk *clk)
-{
-	if (clk->flags & CLK_HAS_RATE)
-		return clk->rate;
-	else
-		return 0;
-}
-
-static long mpc5121_clk_round_rate(struct clk *clk, unsigned long rate)
-{
-	return rate;
-}
-
-static int mpc5121_clk_set_rate(struct clk *clk, unsigned long rate)
-{
-	return 0;
-}
-
-static int clk_register(struct clk *clk)
-{
-	mutex_lock(&clocks_mutex);
-	list_add(&clk->node, &clocks);
-	mutex_unlock(&clocks_mutex);
-	return 0;
-}
-
-static unsigned long spmf_mult(void)
-{
-	/*
-	 * Convert spmf to multiplier
-	 */
-	static int spmf_to_mult[] = {
-		68, 1, 12, 16,
-		20, 24, 28, 32,
-		36, 40, 44, 48,
-		52, 56, 60, 64
-	};
-	int spmf = (in_be32(&clockctl->spmr) >> 24) & 0xf;
-	return spmf_to_mult[spmf];
-}
-
-static unsigned long sysdiv_div_x_2(void)
-{
-	/*
-	 * Convert sysdiv to divisor x 2
-	 * Some divisors have fractional parts so
-	 * multiply by 2 then divide by this value
-	 */
-	static int sysdiv_to_div_x_2[] = {
-		4, 5, 6, 7,
-		8, 9, 10, 14,
-		12, 16, 18, 22,
-		20, 24, 26, 30,
-		28, 32, 34, 38,
-		36, 40, 42, 46,
-		44, 48, 50, 54,
-		52, 56, 58, 62,
-		60, 64, 66,
-	};
-	int sysdiv = (in_be32(&clockctl->scfr2) >> 26) & 0x3f;
-	return sysdiv_to_div_x_2[sysdiv];
-}
-
-static unsigned long ref_to_sys(unsigned long rate)
-{
-	rate *= spmf_mult();
-	rate *= 2;
-	rate /= sysdiv_div_x_2();
-
-	return rate;
-}
-
-static unsigned long sys_to_ref(unsigned long rate)
-{
-	rate *= sysdiv_div_x_2();
-	rate /= 2;
-	rate /= spmf_mult();
-
-	return rate;
-}
-
-static long ips_to_ref(unsigned long rate)
-{
-	int ips_div = (in_be32(&clockctl->scfr1) >> 23) & 0x7;
-
-	rate *= ips_div;	/* csb_clk = ips_clk * ips_div */
-	rate *= 2;		/* sys_clk = csb_clk * 2 */
-	return sys_to_ref(rate);
-}
-
-static unsigned long devtree_getfreq(char *clockname)
-{
-	struct device_node *np;
-	const unsigned int *prop;
-	unsigned int val = 0;
-
-	np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-immr");
-	if (np) {
-		prop = of_get_property(np, clockname, NULL);
-		if (prop)
-			val = *prop;
-	    of_node_put(np);
-	}
-	return val;
-}
-
-static void ref_clk_calc(struct clk *clk)
-{
-	unsigned long rate;
-
-	rate = devtree_getfreq("bus-frequency");
-	if (rate == 0) {
-		printk(KERN_ERR "No bus-frequency in dev tree\n");
-		clk->rate = 0;
-		return;
-	}
-	clk->rate = ips_to_ref(rate);
-}
-
-static struct clk ref_clk = {
-	.name = "ref_clk",
-	.calc = ref_clk_calc,
-};
-
-
-static void sys_clk_calc(struct clk *clk)
-{
-	clk->rate = ref_to_sys(ref_clk.rate);
-}
-
-static struct clk sys_clk = {
-	.name = "sys_clk",
-	.calc = sys_clk_calc,
-};
-
-static void diu_clk_calc(struct clk *clk)
-{
-	int diudiv_x_2 = in_be32(&clockctl->scfr1) & 0xff;
-	unsigned long rate;
-
-	rate = sys_clk.rate;
-
-	rate *= 2;
-	rate /= diudiv_x_2;
-
-	clk->rate = rate;
-}
-
-static void viu_clk_calc(struct clk *clk)
-{
-	unsigned long rate;
-
-	rate = sys_clk.rate;
-	rate /= 2;
-	clk->rate = rate;
-}
-
-static void half_clk_calc(struct clk *clk)
-{
-	clk->rate = clk->parent->rate / 2;
-}
-
-static void generic_div_clk_calc(struct clk *clk)
-{
-	int div = (in_be32(&clockctl->scfr1) >> clk->div_shift) & 0x7;
-
-	clk->rate = clk->parent->rate / div;
-}
-
-static void unity_clk_calc(struct clk *clk)
-{
-	clk->rate = clk->parent->rate;
-}
-
-static struct clk csb_clk = {
-	.name = "csb_clk",
-	.calc = half_clk_calc,
-	.parent = &sys_clk,
-};
-
-static void e300_clk_calc(struct clk *clk)
-{
-	int spmf = (in_be32(&clockctl->spmr) >> 16) & 0xf;
-	int ratex2 = clk->parent->rate * spmf;
-
-	clk->rate = ratex2 / 2;
-}
-
-static struct clk e300_clk = {
-	.name = "e300_clk",
-	.calc = e300_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk ips_clk = {
-	.name = "ips_clk",
-	.calc = generic_div_clk_calc,
-	.parent = &csb_clk,
-	.div_shift = 23,
-};
-
-/*
- * Clocks controlled by SCCR1 (.reg = 0)
- */
-static struct clk lpc_clk = {
-	.name = "lpc_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 30,
-	.calc = generic_div_clk_calc,
-	.parent = &ips_clk,
-	.div_shift = 11,
-};
-
-static struct clk nfc_clk = {
-	.name = "nfc_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 29,
-	.calc = generic_div_clk_calc,
-	.parent = &ips_clk,
-	.div_shift = 8,
-};
-
-static struct clk pata_clk = {
-	.name = "pata_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 28,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-/*
- * PSC clocks (bits 27 - 16)
- * are setup elsewhere
- */
-
-static struct clk sata_clk = {
-	.name = "sata_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 14,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-static struct clk fec_clk = {
-	.name = "fec_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 13,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-static struct clk pci_clk = {
-	.name = "pci_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 11,
-	.calc = generic_div_clk_calc,
-	.parent = &csb_clk,
-	.div_shift = 20,
-};
-
-/*
- * Clocks controlled by SCCR2 (.reg = 1)
- */
-static struct clk diu_clk = {
-	.name = "diu_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 31,
-	.calc = diu_clk_calc,
-};
-
-static struct clk viu_clk = {
-	.name = "viu_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 18,
-	.calc = viu_clk_calc,
-};
-
-static struct clk axe_clk = {
-	.name = "axe_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 30,
-	.calc = unity_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk usb1_clk = {
-	.name = "usb1_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 28,
-	.calc = unity_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk usb2_clk = {
-	.name = "usb2_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 27,
-	.calc = unity_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk i2c_clk = {
-	.name = "i2c_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 26,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-static struct clk mscan_clk = {
-	.name = "mscan_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 25,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-static struct clk sdhc_clk = {
-	.name = "sdhc_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 24,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-static struct clk mbx_bus_clk = {
-	.name = "mbx_bus_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 22,
-	.calc = half_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk mbx_clk = {
-	.name = "mbx_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 21,
-	.calc = unity_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk mbx_3d_clk = {
-	.name = "mbx_3d_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 20,
-	.calc = generic_div_clk_calc,
-	.parent = &mbx_bus_clk,
-	.div_shift = 14,
-};
-
-static void psc_mclk_in_calc(struct clk *clk)
-{
-	clk->rate = devtree_getfreq("psc_mclk_in");
-	if (!clk->rate)
-		clk->rate = 25000000;
-}
-
-static struct clk psc_mclk_in = {
-	.name = "psc_mclk_in",
-	.calc = psc_mclk_in_calc,
-};
-
-static struct clk spdif_txclk = {
-	.name = "spdif_txclk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 23,
-};
-
-static struct clk spdif_rxclk = {
-	.name = "spdif_rxclk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 23,
-};
-
-static void ac97_clk_calc(struct clk *clk)
-{
-	/* ac97 bit clock is always 24.567 MHz */
-	clk->rate = 24567000;
-}
-
-static struct clk ac97_clk = {
-	.name = "ac97_clk_in",
-	.calc = ac97_clk_calc,
-};
-
-static struct clk *rate_clks[] = {
-	&ref_clk,
-	&sys_clk,
-	&diu_clk,
-	&viu_clk,
-	&csb_clk,
-	&e300_clk,
-	&ips_clk,
-	&fec_clk,
-	&sata_clk,
-	&pata_clk,
-	&nfc_clk,
-	&lpc_clk,
-	&mbx_bus_clk,
-	&mbx_clk,
-	&mbx_3d_clk,
-	&axe_clk,
-	&usb1_clk,
-	&usb2_clk,
-	&i2c_clk,
-	&mscan_clk,
-	&sdhc_clk,
-	&pci_clk,
-	&psc_mclk_in,
-	&spdif_txclk,
-	&spdif_rxclk,
-	&ac97_clk,
-	NULL
-};
-
-static void rate_clk_init(struct clk *clk)
-{
-	if (clk->calc) {
-		clk->calc(clk);
-		clk->flags |= CLK_HAS_RATE;
-		clk_register(clk);
-	} else {
-		printk(KERN_WARNING
-		       "Could not initialize clk %s without a calc routine\n",
-		       clk->name);
-	}
-}
-
-static void rate_clks_init(void)
-{
-	struct clk **cpp, *clk;
-
-	cpp = rate_clks;
-	while ((clk = *cpp++))
-		rate_clk_init(clk);
-}
-
-/*
- * There are two clk enable registers with 32 enable bits each
- * psc clocks and device clocks are all stored in dev_clks
- */
-static struct clk dev_clks[2][32];
-
-/*
- * Given a psc number return the dev_clk
- * associated with it
- */
-static struct clk *psc_dev_clk(int pscnum)
-{
-	int reg, bit;
-	struct clk *clk;
-
-	reg = 0;
-	bit = 27 - pscnum;
-
-	clk = &dev_clks[reg][bit];
-	clk->reg = 0;
-	clk->bit = bit;
-	return clk;
-}
-
-/*
- * PSC clock rate calculation
- */
-static void psc_calc_rate(struct clk *clk, int pscnum, struct device_node *np)
-{
-	unsigned long mclk_src = sys_clk.rate;
-	unsigned long mclk_div;
-
-	/*
-	 * Can only change value of mclk divider
-	 * when the divider is disabled.
-	 *
-	 * Zero is not a valid divider so minimum
-	 * divider is 1
-	 *
-	 * disable/set divider/enable
-	 */
-	out_be32(&clockctl->pccr[pscnum], 0);
-	out_be32(&clockctl->pccr[pscnum], 0x00020000);
-	out_be32(&clockctl->pccr[pscnum], 0x00030000);
-
-	if (in_be32(&clockctl->pccr[pscnum]) & 0x80) {
-		clk->rate = spdif_rxclk.rate;
-		return;
-	}
-
-	switch ((in_be32(&clockctl->pccr[pscnum]) >> 14) & 0x3) {
-	case 0:
-		mclk_src = sys_clk.rate;
-		break;
-	case 1:
-		mclk_src = ref_clk.rate;
-		break;
-	case 2:
-		mclk_src = psc_mclk_in.rate;
-		break;
-	case 3:
-		mclk_src = spdif_txclk.rate;
-		break;
-	}
-
-	mclk_div = ((in_be32(&clockctl->pccr[pscnum]) >> 17) & 0x7fff) + 1;
-	clk->rate = mclk_src / mclk_div;
-}
-
-/*
- * Find all psc nodes in device tree and assign a clock
- * with name "psc%d_mclk" and dev pointing at the device
- * returned from of_find_device_by_node
- */
-static void psc_clks_init(void)
-{
-	struct device_node *np;
-	struct platform_device *ofdev;
-	u32 reg;
-	const char *psc_compat;
-
-	psc_compat = mpc512x_select_psc_compat();
-	if (!psc_compat)
-		return;
-
-	for_each_compatible_node(np, NULL, psc_compat) {
-		if (!of_property_read_u32(np, "reg", &reg)) {
-			int pscnum = (reg & 0xf00) >> 8;
-			struct clk *clk = psc_dev_clk(pscnum);
-
-			clk->flags = CLK_HAS_RATE | CLK_HAS_CTRL;
-			ofdev = of_find_device_by_node(np);
-			clk->dev = &ofdev->dev;
-			/*
-			 * AC97 is special rate clock does
-			 * not go through normal path
-			 */
-			if (of_device_is_compatible(np, "fsl,mpc5121-psc-ac97"))
-				clk->rate = ac97_clk.rate;
-			else
-				psc_calc_rate(clk, pscnum, np);
-			sprintf(clk->name, "psc%d_mclk", pscnum);
-			clk_register(clk);
-			clk_enable(clk);
-		}
-	}
-}
-
-static struct clk_interface mpc5121_clk_functions = {
-	.clk_get		= mpc5121_clk_get,
-	.clk_enable		= mpc5121_clk_enable,
-	.clk_disable		= mpc5121_clk_disable,
-	.clk_get_rate		= mpc5121_clk_get_rate,
-	.clk_put		= mpc5121_clk_put,
-	.clk_round_rate		= mpc5121_clk_round_rate,
-	.clk_set_rate		= mpc5121_clk_set_rate,
-	.clk_set_parent		= NULL,
-	.clk_get_parent		= NULL,
-};
-
-int __init mpc5121_clk_init(void)
-{
-	struct device_node *np;
-
-	np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-clock");
-	if (np) {
-		clockctl = of_iomap(np, 0);
-		of_node_put(np);
-	}
-
-	if (!clockctl) {
-		printk(KERN_ERR "Could not map clock control registers\n");
-		return 0;
-	}
-
-	rate_clks_init();
-	psc_clks_init();
-
-	/* leave clockctl mapped forever */
-	/*iounmap(clockctl); */
-	DEBUG_CLK_DUMP();
-	clocks_initialized++;
-	clk_functions = mpc5121_clk_functions;
-	return 0;
-}
-- 
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 23/24] clk: mpc512x: switch to COMMON_CLK, remove PPC_CLOCK
Date: Thu, 18 Jul 2013 22:20:57 +0200	[thread overview]
Message-ID: <1374178858-8683-9-git-send-email-gsi@denx.de> (raw)
In-Reply-To: <1374166855-7280-1-git-send-email-gsi@denx.de>

completely switch to, i.e. unconditionally use COMMON_CLK for the
MPC512x platform, and retire the PPC_CLOCK implementation for that
platform after the transition has completed

Signed-off-by: Gerhard Sittig <gsi@denx.de>
---
 arch/powerpc/platforms/512x/Kconfig  |   14 +-
 arch/powerpc/platforms/512x/Makefile |    3 +-
 arch/powerpc/platforms/512x/clock.c  |  753 ----------------------------------
 3 files changed, 2 insertions(+), 768 deletions(-)
 delete mode 100644 arch/powerpc/platforms/512x/clock.c

diff --git a/arch/powerpc/platforms/512x/Kconfig b/arch/powerpc/platforms/512x/Kconfig
index c5fcdd0..5aa3f4b 100644
--- a/arch/powerpc/platforms/512x/Kconfig
+++ b/arch/powerpc/platforms/512x/Kconfig
@@ -1,21 +1,9 @@
-config MPC512x_COMMON_CLK
-	bool "MPC512x platform uses COMMON_CLK"
-	default y
-	depends on PPC_MPC512x
-	help
-	  This option is only here to support tests and comparison
-	  during development and migration.  This option will get
-	  removed after the COMMON_CLK support for MPC512x has become
-	  fully operational and all drivers were adjusted to explicitly
-	  acquire their required clocks.
-
 config PPC_MPC512x
 	bool "512x-based boards"
 	depends on 6xx
+	select COMMON_CLK
 	select FSL_SOC
 	select IPIC
-	select PPC_CLOCK if !MPC512x_COMMON_CLK
-	select COMMON_CLK if MPC512x_COMMON_CLK
 	select PPC_PCI_CHOICE
 	select FSL_PCI if PCI
 	select ARCH_WANT_OPTIONAL_GPIOLIB
diff --git a/arch/powerpc/platforms/512x/Makefile b/arch/powerpc/platforms/512x/Makefile
index 1e05f9d..bb20116 100644
--- a/arch/powerpc/platforms/512x/Makefile
+++ b/arch/powerpc/platforms/512x/Makefile
@@ -1,8 +1,7 @@
 #
 # Makefile for the Freescale PowerPC 512x linux kernel.
 #
-obj-$(CONFIG_PPC_CLOCK)		+= clock.o
-obj-$(CONFIG_COMMON_CLK)	+= clock-commonclk.o
+obj-y				+= clock-commonclk.o
 obj-y				+= mpc512x_shared.o
 obj-$(CONFIG_MPC5121_ADS)	+= mpc5121_ads.o mpc5121_ads_cpld.o
 obj-$(CONFIG_MPC512x_GENERIC)	+= mpc512x_generic.o
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c
deleted file mode 100644
index e504166..0000000
--- a/arch/powerpc/platforms/512x/clock.c
+++ /dev/null
@@ -1,753 +0,0 @@
-/*
- * Copyright (C) 2007,2008 Freescale Semiconductor, Inc. All rights reserved.
- *
- * Author: John Rigby <jrigby@freescale.com>
- *
- * Implements the clk api defined in include/linux/clk.h
- *
- *    Original based on linux/arch/arm/mach-integrator/clock.c
- *
- *    Copyright (C) 2004 ARM Limited.
- *    Written by Deep Blue Solutions Limited.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <linux/kernel.h>
-#include <linux/list.h>
-#include <linux/errno.h>
-#include <linux/err.h>
-#include <linux/module.h>
-#include <linux/string.h>
-#include <linux/clk.h>
-#include <linux/mutex.h>
-#include <linux/io.h>
-
-#include <linux/of_platform.h>
-#include <asm/mpc5xxx.h>
-#include <asm/mpc5121.h>
-#include <asm/clk_interface.h>
-
-#include "mpc512x.h"
-
-#undef CLK_DEBUG
-
-static int clocks_initialized;
-
-#define CLK_HAS_RATE	0x1	/* has rate in MHz */
-#define CLK_HAS_CTRL	0x2	/* has control reg and bit */
-
-struct clk {
-	struct list_head node;
-	char name[32];
-	int flags;
-	struct device *dev;
-	unsigned long rate;
-	struct module *owner;
-	void (*calc) (struct clk *);
-	struct clk *parent;
-	int reg, bit;		/* CLK_HAS_CTRL */
-	int div_shift;		/* only used by generic_div_clk_calc */
-};
-
-static LIST_HEAD(clocks);
-static DEFINE_MUTEX(clocks_mutex);
-
-static struct clk *mpc5121_clk_get(struct device *dev, const char *id)
-{
-	struct clk *p, *clk = ERR_PTR(-ENOENT);
-	int dev_match;
-	int id_match;
-
-	if (dev == NULL || id == NULL)
-		return clk;
-
-	mutex_lock(&clocks_mutex);
-	list_for_each_entry(p, &clocks, node) {
-		dev_match = id_match = 0;
-
-		if (dev == p->dev)
-			dev_match++;
-		if (strcmp(id, p->name) == 0)
-			id_match++;
-		if ((dev_match || id_match) && try_module_get(p->owner)) {
-			clk = p;
-			break;
-		}
-	}
-	mutex_unlock(&clocks_mutex);
-
-	return clk;
-}
-
-#ifdef CLK_DEBUG
-static void dump_clocks(void)
-{
-	struct clk *p;
-
-	mutex_lock(&clocks_mutex);
-	printk(KERN_INFO "CLOCKS:\n");
-	list_for_each_entry(p, &clocks, node) {
-		pr_info("  %s=%ld", p->name, p->rate);
-		if (p->parent)
-			pr_cont(" %s=%ld", p->parent->name,
-			       p->parent->rate);
-		if (p->flags & CLK_HAS_CTRL)
-			pr_cont(" reg/bit=%d/%d", p->reg, p->bit);
-		pr_cont("\n");
-	}
-	mutex_unlock(&clocks_mutex);
-}
-#define	DEBUG_CLK_DUMP() dump_clocks()
-#else
-#define	DEBUG_CLK_DUMP()
-#endif
-
-
-static void mpc5121_clk_put(struct clk *clk)
-{
-	module_put(clk->owner);
-}
-
-#define NRPSC 12
-
-struct mpc512x_clockctl {
-	u32 spmr;		/* System PLL Mode Reg */
-	u32 sccr[2];		/* System Clk Ctrl Reg 1 & 2 */
-	u32 scfr1;		/* System Clk Freq Reg 1 */
-	u32 scfr2;		/* System Clk Freq Reg 2 */
-	u32 reserved;
-	u32 bcr;		/* Bread Crumb Reg */
-	u32 pccr[NRPSC];	/* PSC Clk Ctrl Reg 0-11 */
-	u32 spccr;		/* SPDIF Clk Ctrl Reg */
-	u32 cccr;		/* CFM Clk Ctrl Reg */
-	u32 dccr;		/* DIU Clk Cnfg Reg */
-};
-
-static struct mpc512x_clockctl __iomem *clockctl;
-
-static int mpc5121_clk_enable(struct clk *clk)
-{
-	unsigned int mask;
-
-	if (clk->flags & CLK_HAS_CTRL) {
-		mask = in_be32(&clockctl->sccr[clk->reg]);
-		mask |= 1 << clk->bit;
-		out_be32(&clockctl->sccr[clk->reg], mask);
-	}
-	return 0;
-}
-
-static void mpc5121_clk_disable(struct clk *clk)
-{
-	unsigned int mask;
-
-	if (clk->flags & CLK_HAS_CTRL) {
-		mask = in_be32(&clockctl->sccr[clk->reg]);
-		mask &= ~(1 << clk->bit);
-		out_be32(&clockctl->sccr[clk->reg], mask);
-	}
-}
-
-static unsigned long mpc5121_clk_get_rate(struct clk *clk)
-{
-	if (clk->flags & CLK_HAS_RATE)
-		return clk->rate;
-	else
-		return 0;
-}
-
-static long mpc5121_clk_round_rate(struct clk *clk, unsigned long rate)
-{
-	return rate;
-}
-
-static int mpc5121_clk_set_rate(struct clk *clk, unsigned long rate)
-{
-	return 0;
-}
-
-static int clk_register(struct clk *clk)
-{
-	mutex_lock(&clocks_mutex);
-	list_add(&clk->node, &clocks);
-	mutex_unlock(&clocks_mutex);
-	return 0;
-}
-
-static unsigned long spmf_mult(void)
-{
-	/*
-	 * Convert spmf to multiplier
-	 */
-	static int spmf_to_mult[] = {
-		68, 1, 12, 16,
-		20, 24, 28, 32,
-		36, 40, 44, 48,
-		52, 56, 60, 64
-	};
-	int spmf = (in_be32(&clockctl->spmr) >> 24) & 0xf;
-	return spmf_to_mult[spmf];
-}
-
-static unsigned long sysdiv_div_x_2(void)
-{
-	/*
-	 * Convert sysdiv to divisor x 2
-	 * Some divisors have fractional parts so
-	 * multiply by 2 then divide by this value
-	 */
-	static int sysdiv_to_div_x_2[] = {
-		4, 5, 6, 7,
-		8, 9, 10, 14,
-		12, 16, 18, 22,
-		20, 24, 26, 30,
-		28, 32, 34, 38,
-		36, 40, 42, 46,
-		44, 48, 50, 54,
-		52, 56, 58, 62,
-		60, 64, 66,
-	};
-	int sysdiv = (in_be32(&clockctl->scfr2) >> 26) & 0x3f;
-	return sysdiv_to_div_x_2[sysdiv];
-}
-
-static unsigned long ref_to_sys(unsigned long rate)
-{
-	rate *= spmf_mult();
-	rate *= 2;
-	rate /= sysdiv_div_x_2();
-
-	return rate;
-}
-
-static unsigned long sys_to_ref(unsigned long rate)
-{
-	rate *= sysdiv_div_x_2();
-	rate /= 2;
-	rate /= spmf_mult();
-
-	return rate;
-}
-
-static long ips_to_ref(unsigned long rate)
-{
-	int ips_div = (in_be32(&clockctl->scfr1) >> 23) & 0x7;
-
-	rate *= ips_div;	/* csb_clk = ips_clk * ips_div */
-	rate *= 2;		/* sys_clk = csb_clk * 2 */
-	return sys_to_ref(rate);
-}
-
-static unsigned long devtree_getfreq(char *clockname)
-{
-	struct device_node *np;
-	const unsigned int *prop;
-	unsigned int val = 0;
-
-	np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-immr");
-	if (np) {
-		prop = of_get_property(np, clockname, NULL);
-		if (prop)
-			val = *prop;
-	    of_node_put(np);
-	}
-	return val;
-}
-
-static void ref_clk_calc(struct clk *clk)
-{
-	unsigned long rate;
-
-	rate = devtree_getfreq("bus-frequency");
-	if (rate == 0) {
-		printk(KERN_ERR "No bus-frequency in dev tree\n");
-		clk->rate = 0;
-		return;
-	}
-	clk->rate = ips_to_ref(rate);
-}
-
-static struct clk ref_clk = {
-	.name = "ref_clk",
-	.calc = ref_clk_calc,
-};
-
-
-static void sys_clk_calc(struct clk *clk)
-{
-	clk->rate = ref_to_sys(ref_clk.rate);
-}
-
-static struct clk sys_clk = {
-	.name = "sys_clk",
-	.calc = sys_clk_calc,
-};
-
-static void diu_clk_calc(struct clk *clk)
-{
-	int diudiv_x_2 = in_be32(&clockctl->scfr1) & 0xff;
-	unsigned long rate;
-
-	rate = sys_clk.rate;
-
-	rate *= 2;
-	rate /= diudiv_x_2;
-
-	clk->rate = rate;
-}
-
-static void viu_clk_calc(struct clk *clk)
-{
-	unsigned long rate;
-
-	rate = sys_clk.rate;
-	rate /= 2;
-	clk->rate = rate;
-}
-
-static void half_clk_calc(struct clk *clk)
-{
-	clk->rate = clk->parent->rate / 2;
-}
-
-static void generic_div_clk_calc(struct clk *clk)
-{
-	int div = (in_be32(&clockctl->scfr1) >> clk->div_shift) & 0x7;
-
-	clk->rate = clk->parent->rate / div;
-}
-
-static void unity_clk_calc(struct clk *clk)
-{
-	clk->rate = clk->parent->rate;
-}
-
-static struct clk csb_clk = {
-	.name = "csb_clk",
-	.calc = half_clk_calc,
-	.parent = &sys_clk,
-};
-
-static void e300_clk_calc(struct clk *clk)
-{
-	int spmf = (in_be32(&clockctl->spmr) >> 16) & 0xf;
-	int ratex2 = clk->parent->rate * spmf;
-
-	clk->rate = ratex2 / 2;
-}
-
-static struct clk e300_clk = {
-	.name = "e300_clk",
-	.calc = e300_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk ips_clk = {
-	.name = "ips_clk",
-	.calc = generic_div_clk_calc,
-	.parent = &csb_clk,
-	.div_shift = 23,
-};
-
-/*
- * Clocks controlled by SCCR1 (.reg = 0)
- */
-static struct clk lpc_clk = {
-	.name = "lpc_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 30,
-	.calc = generic_div_clk_calc,
-	.parent = &ips_clk,
-	.div_shift = 11,
-};
-
-static struct clk nfc_clk = {
-	.name = "nfc_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 29,
-	.calc = generic_div_clk_calc,
-	.parent = &ips_clk,
-	.div_shift = 8,
-};
-
-static struct clk pata_clk = {
-	.name = "pata_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 28,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-/*
- * PSC clocks (bits 27 - 16)
- * are setup elsewhere
- */
-
-static struct clk sata_clk = {
-	.name = "sata_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 14,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-static struct clk fec_clk = {
-	.name = "fec_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 13,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-static struct clk pci_clk = {
-	.name = "pci_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 11,
-	.calc = generic_div_clk_calc,
-	.parent = &csb_clk,
-	.div_shift = 20,
-};
-
-/*
- * Clocks controlled by SCCR2 (.reg = 1)
- */
-static struct clk diu_clk = {
-	.name = "diu_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 31,
-	.calc = diu_clk_calc,
-};
-
-static struct clk viu_clk = {
-	.name = "viu_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 18,
-	.calc = viu_clk_calc,
-};
-
-static struct clk axe_clk = {
-	.name = "axe_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 30,
-	.calc = unity_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk usb1_clk = {
-	.name = "usb1_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 28,
-	.calc = unity_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk usb2_clk = {
-	.name = "usb2_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 27,
-	.calc = unity_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk i2c_clk = {
-	.name = "i2c_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 26,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-static struct clk mscan_clk = {
-	.name = "mscan_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 25,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-static struct clk sdhc_clk = {
-	.name = "sdhc_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 24,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-static struct clk mbx_bus_clk = {
-	.name = "mbx_bus_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 22,
-	.calc = half_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk mbx_clk = {
-	.name = "mbx_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 21,
-	.calc = unity_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk mbx_3d_clk = {
-	.name = "mbx_3d_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 20,
-	.calc = generic_div_clk_calc,
-	.parent = &mbx_bus_clk,
-	.div_shift = 14,
-};
-
-static void psc_mclk_in_calc(struct clk *clk)
-{
-	clk->rate = devtree_getfreq("psc_mclk_in");
-	if (!clk->rate)
-		clk->rate = 25000000;
-}
-
-static struct clk psc_mclk_in = {
-	.name = "psc_mclk_in",
-	.calc = psc_mclk_in_calc,
-};
-
-static struct clk spdif_txclk = {
-	.name = "spdif_txclk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 23,
-};
-
-static struct clk spdif_rxclk = {
-	.name = "spdif_rxclk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 23,
-};
-
-static void ac97_clk_calc(struct clk *clk)
-{
-	/* ac97 bit clock is always 24.567 MHz */
-	clk->rate = 24567000;
-}
-
-static struct clk ac97_clk = {
-	.name = "ac97_clk_in",
-	.calc = ac97_clk_calc,
-};
-
-static struct clk *rate_clks[] = {
-	&ref_clk,
-	&sys_clk,
-	&diu_clk,
-	&viu_clk,
-	&csb_clk,
-	&e300_clk,
-	&ips_clk,
-	&fec_clk,
-	&sata_clk,
-	&pata_clk,
-	&nfc_clk,
-	&lpc_clk,
-	&mbx_bus_clk,
-	&mbx_clk,
-	&mbx_3d_clk,
-	&axe_clk,
-	&usb1_clk,
-	&usb2_clk,
-	&i2c_clk,
-	&mscan_clk,
-	&sdhc_clk,
-	&pci_clk,
-	&psc_mclk_in,
-	&spdif_txclk,
-	&spdif_rxclk,
-	&ac97_clk,
-	NULL
-};
-
-static void rate_clk_init(struct clk *clk)
-{
-	if (clk->calc) {
-		clk->calc(clk);
-		clk->flags |= CLK_HAS_RATE;
-		clk_register(clk);
-	} else {
-		printk(KERN_WARNING
-		       "Could not initialize clk %s without a calc routine\n",
-		       clk->name);
-	}
-}
-
-static void rate_clks_init(void)
-{
-	struct clk **cpp, *clk;
-
-	cpp = rate_clks;
-	while ((clk = *cpp++))
-		rate_clk_init(clk);
-}
-
-/*
- * There are two clk enable registers with 32 enable bits each
- * psc clocks and device clocks are all stored in dev_clks
- */
-static struct clk dev_clks[2][32];
-
-/*
- * Given a psc number return the dev_clk
- * associated with it
- */
-static struct clk *psc_dev_clk(int pscnum)
-{
-	int reg, bit;
-	struct clk *clk;
-
-	reg = 0;
-	bit = 27 - pscnum;
-
-	clk = &dev_clks[reg][bit];
-	clk->reg = 0;
-	clk->bit = bit;
-	return clk;
-}
-
-/*
- * PSC clock rate calculation
- */
-static void psc_calc_rate(struct clk *clk, int pscnum, struct device_node *np)
-{
-	unsigned long mclk_src = sys_clk.rate;
-	unsigned long mclk_div;
-
-	/*
-	 * Can only change value of mclk divider
-	 * when the divider is disabled.
-	 *
-	 * Zero is not a valid divider so minimum
-	 * divider is 1
-	 *
-	 * disable/set divider/enable
-	 */
-	out_be32(&clockctl->pccr[pscnum], 0);
-	out_be32(&clockctl->pccr[pscnum], 0x00020000);
-	out_be32(&clockctl->pccr[pscnum], 0x00030000);
-
-	if (in_be32(&clockctl->pccr[pscnum]) & 0x80) {
-		clk->rate = spdif_rxclk.rate;
-		return;
-	}
-
-	switch ((in_be32(&clockctl->pccr[pscnum]) >> 14) & 0x3) {
-	case 0:
-		mclk_src = sys_clk.rate;
-		break;
-	case 1:
-		mclk_src = ref_clk.rate;
-		break;
-	case 2:
-		mclk_src = psc_mclk_in.rate;
-		break;
-	case 3:
-		mclk_src = spdif_txclk.rate;
-		break;
-	}
-
-	mclk_div = ((in_be32(&clockctl->pccr[pscnum]) >> 17) & 0x7fff) + 1;
-	clk->rate = mclk_src / mclk_div;
-}
-
-/*
- * Find all psc nodes in device tree and assign a clock
- * with name "psc%d_mclk" and dev pointing at the device
- * returned from of_find_device_by_node
- */
-static void psc_clks_init(void)
-{
-	struct device_node *np;
-	struct platform_device *ofdev;
-	u32 reg;
-	const char *psc_compat;
-
-	psc_compat = mpc512x_select_psc_compat();
-	if (!psc_compat)
-		return;
-
-	for_each_compatible_node(np, NULL, psc_compat) {
-		if (!of_property_read_u32(np, "reg", &reg)) {
-			int pscnum = (reg & 0xf00) >> 8;
-			struct clk *clk = psc_dev_clk(pscnum);
-
-			clk->flags = CLK_HAS_RATE | CLK_HAS_CTRL;
-			ofdev = of_find_device_by_node(np);
-			clk->dev = &ofdev->dev;
-			/*
-			 * AC97 is special rate clock does
-			 * not go through normal path
-			 */
-			if (of_device_is_compatible(np, "fsl,mpc5121-psc-ac97"))
-				clk->rate = ac97_clk.rate;
-			else
-				psc_calc_rate(clk, pscnum, np);
-			sprintf(clk->name, "psc%d_mclk", pscnum);
-			clk_register(clk);
-			clk_enable(clk);
-		}
-	}
-}
-
-static struct clk_interface mpc5121_clk_functions = {
-	.clk_get		= mpc5121_clk_get,
-	.clk_enable		= mpc5121_clk_enable,
-	.clk_disable		= mpc5121_clk_disable,
-	.clk_get_rate		= mpc5121_clk_get_rate,
-	.clk_put		= mpc5121_clk_put,
-	.clk_round_rate		= mpc5121_clk_round_rate,
-	.clk_set_rate		= mpc5121_clk_set_rate,
-	.clk_set_parent		= NULL,
-	.clk_get_parent		= NULL,
-};
-
-int __init mpc5121_clk_init(void)
-{
-	struct device_node *np;
-
-	np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-clock");
-	if (np) {
-		clockctl = of_iomap(np, 0);
-		of_node_put(np);
-	}
-
-	if (!clockctl) {
-		printk(KERN_ERR "Could not map clock control registers\n");
-		return 0;
-	}
-
-	rate_clks_init();
-	psc_clks_init();
-
-	/* leave clockctl mapped forever */
-	/*iounmap(clockctl); */
-	DEBUG_CLK_DUMP();
-	clocks_initialized++;
-	clk_functions = mpc5121_clk_functions;
-	return 0;
-}
-- 
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 23/24] clk: mpc512x: switch to COMMON_CLK, remove PPC_CLOCK
Date: Thu, 18 Jul 2013 22:20:57 +0200	[thread overview]
Message-ID: <1374178858-8683-9-git-send-email-gsi@denx.de> (raw)
In-Reply-To: <1374166855-7280-1-git-send-email-gsi@denx.de>

completely switch to, i.e. unconditionally use COMMON_CLK for the
MPC512x platform, and retire the PPC_CLOCK implementation for that
platform after the transition has completed

Signed-off-by: Gerhard Sittig <gsi@denx.de>
---
 arch/powerpc/platforms/512x/Kconfig  |   14 +-
 arch/powerpc/platforms/512x/Makefile |    3 +-
 arch/powerpc/platforms/512x/clock.c  |  753 ----------------------------------
 3 files changed, 2 insertions(+), 768 deletions(-)
 delete mode 100644 arch/powerpc/platforms/512x/clock.c

diff --git a/arch/powerpc/platforms/512x/Kconfig b/arch/powerpc/platforms/512x/Kconfig
index c5fcdd0..5aa3f4b 100644
--- a/arch/powerpc/platforms/512x/Kconfig
+++ b/arch/powerpc/platforms/512x/Kconfig
@@ -1,21 +1,9 @@
-config MPC512x_COMMON_CLK
-	bool "MPC512x platform uses COMMON_CLK"
-	default y
-	depends on PPC_MPC512x
-	help
-	  This option is only here to support tests and comparison
-	  during development and migration.  This option will get
-	  removed after the COMMON_CLK support for MPC512x has become
-	  fully operational and all drivers were adjusted to explicitly
-	  acquire their required clocks.
-
 config PPC_MPC512x
 	bool "512x-based boards"
 	depends on 6xx
+	select COMMON_CLK
 	select FSL_SOC
 	select IPIC
-	select PPC_CLOCK if !MPC512x_COMMON_CLK
-	select COMMON_CLK if MPC512x_COMMON_CLK
 	select PPC_PCI_CHOICE
 	select FSL_PCI if PCI
 	select ARCH_WANT_OPTIONAL_GPIOLIB
diff --git a/arch/powerpc/platforms/512x/Makefile b/arch/powerpc/platforms/512x/Makefile
index 1e05f9d..bb20116 100644
--- a/arch/powerpc/platforms/512x/Makefile
+++ b/arch/powerpc/platforms/512x/Makefile
@@ -1,8 +1,7 @@
 #
 # Makefile for the Freescale PowerPC 512x linux kernel.
 #
-obj-$(CONFIG_PPC_CLOCK)		+= clock.o
-obj-$(CONFIG_COMMON_CLK)	+= clock-commonclk.o
+obj-y				+= clock-commonclk.o
 obj-y				+= mpc512x_shared.o
 obj-$(CONFIG_MPC5121_ADS)	+= mpc5121_ads.o mpc5121_ads_cpld.o
 obj-$(CONFIG_MPC512x_GENERIC)	+= mpc512x_generic.o
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c
deleted file mode 100644
index e504166..0000000
--- a/arch/powerpc/platforms/512x/clock.c
+++ /dev/null
@@ -1,753 +0,0 @@
-/*
- * Copyright (C) 2007,2008 Freescale Semiconductor, Inc. All rights reserved.
- *
- * Author: John Rigby <jrigby@freescale.com>
- *
- * Implements the clk api defined in include/linux/clk.h
- *
- *    Original based on linux/arch/arm/mach-integrator/clock.c
- *
- *    Copyright (C) 2004 ARM Limited.
- *    Written by Deep Blue Solutions Limited.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <linux/kernel.h>
-#include <linux/list.h>
-#include <linux/errno.h>
-#include <linux/err.h>
-#include <linux/module.h>
-#include <linux/string.h>
-#include <linux/clk.h>
-#include <linux/mutex.h>
-#include <linux/io.h>
-
-#include <linux/of_platform.h>
-#include <asm/mpc5xxx.h>
-#include <asm/mpc5121.h>
-#include <asm/clk_interface.h>
-
-#include "mpc512x.h"
-
-#undef CLK_DEBUG
-
-static int clocks_initialized;
-
-#define CLK_HAS_RATE	0x1	/* has rate in MHz */
-#define CLK_HAS_CTRL	0x2	/* has control reg and bit */
-
-struct clk {
-	struct list_head node;
-	char name[32];
-	int flags;
-	struct device *dev;
-	unsigned long rate;
-	struct module *owner;
-	void (*calc) (struct clk *);
-	struct clk *parent;
-	int reg, bit;		/* CLK_HAS_CTRL */
-	int div_shift;		/* only used by generic_div_clk_calc */
-};
-
-static LIST_HEAD(clocks);
-static DEFINE_MUTEX(clocks_mutex);
-
-static struct clk *mpc5121_clk_get(struct device *dev, const char *id)
-{
-	struct clk *p, *clk = ERR_PTR(-ENOENT);
-	int dev_match;
-	int id_match;
-
-	if (dev == NULL || id == NULL)
-		return clk;
-
-	mutex_lock(&clocks_mutex);
-	list_for_each_entry(p, &clocks, node) {
-		dev_match = id_match = 0;
-
-		if (dev == p->dev)
-			dev_match++;
-		if (strcmp(id, p->name) == 0)
-			id_match++;
-		if ((dev_match || id_match) && try_module_get(p->owner)) {
-			clk = p;
-			break;
-		}
-	}
-	mutex_unlock(&clocks_mutex);
-
-	return clk;
-}
-
-#ifdef CLK_DEBUG
-static void dump_clocks(void)
-{
-	struct clk *p;
-
-	mutex_lock(&clocks_mutex);
-	printk(KERN_INFO "CLOCKS:\n");
-	list_for_each_entry(p, &clocks, node) {
-		pr_info("  %s=%ld", p->name, p->rate);
-		if (p->parent)
-			pr_cont(" %s=%ld", p->parent->name,
-			       p->parent->rate);
-		if (p->flags & CLK_HAS_CTRL)
-			pr_cont(" reg/bit=%d/%d", p->reg, p->bit);
-		pr_cont("\n");
-	}
-	mutex_unlock(&clocks_mutex);
-}
-#define	DEBUG_CLK_DUMP() dump_clocks()
-#else
-#define	DEBUG_CLK_DUMP()
-#endif
-
-
-static void mpc5121_clk_put(struct clk *clk)
-{
-	module_put(clk->owner);
-}
-
-#define NRPSC 12
-
-struct mpc512x_clockctl {
-	u32 spmr;		/* System PLL Mode Reg */
-	u32 sccr[2];		/* System Clk Ctrl Reg 1 & 2 */
-	u32 scfr1;		/* System Clk Freq Reg 1 */
-	u32 scfr2;		/* System Clk Freq Reg 2 */
-	u32 reserved;
-	u32 bcr;		/* Bread Crumb Reg */
-	u32 pccr[NRPSC];	/* PSC Clk Ctrl Reg 0-11 */
-	u32 spccr;		/* SPDIF Clk Ctrl Reg */
-	u32 cccr;		/* CFM Clk Ctrl Reg */
-	u32 dccr;		/* DIU Clk Cnfg Reg */
-};
-
-static struct mpc512x_clockctl __iomem *clockctl;
-
-static int mpc5121_clk_enable(struct clk *clk)
-{
-	unsigned int mask;
-
-	if (clk->flags & CLK_HAS_CTRL) {
-		mask = in_be32(&clockctl->sccr[clk->reg]);
-		mask |= 1 << clk->bit;
-		out_be32(&clockctl->sccr[clk->reg], mask);
-	}
-	return 0;
-}
-
-static void mpc5121_clk_disable(struct clk *clk)
-{
-	unsigned int mask;
-
-	if (clk->flags & CLK_HAS_CTRL) {
-		mask = in_be32(&clockctl->sccr[clk->reg]);
-		mask &= ~(1 << clk->bit);
-		out_be32(&clockctl->sccr[clk->reg], mask);
-	}
-}
-
-static unsigned long mpc5121_clk_get_rate(struct clk *clk)
-{
-	if (clk->flags & CLK_HAS_RATE)
-		return clk->rate;
-	else
-		return 0;
-}
-
-static long mpc5121_clk_round_rate(struct clk *clk, unsigned long rate)
-{
-	return rate;
-}
-
-static int mpc5121_clk_set_rate(struct clk *clk, unsigned long rate)
-{
-	return 0;
-}
-
-static int clk_register(struct clk *clk)
-{
-	mutex_lock(&clocks_mutex);
-	list_add(&clk->node, &clocks);
-	mutex_unlock(&clocks_mutex);
-	return 0;
-}
-
-static unsigned long spmf_mult(void)
-{
-	/*
-	 * Convert spmf to multiplier
-	 */
-	static int spmf_to_mult[] = {
-		68, 1, 12, 16,
-		20, 24, 28, 32,
-		36, 40, 44, 48,
-		52, 56, 60, 64
-	};
-	int spmf = (in_be32(&clockctl->spmr) >> 24) & 0xf;
-	return spmf_to_mult[spmf];
-}
-
-static unsigned long sysdiv_div_x_2(void)
-{
-	/*
-	 * Convert sysdiv to divisor x 2
-	 * Some divisors have fractional parts so
-	 * multiply by 2 then divide by this value
-	 */
-	static int sysdiv_to_div_x_2[] = {
-		4, 5, 6, 7,
-		8, 9, 10, 14,
-		12, 16, 18, 22,
-		20, 24, 26, 30,
-		28, 32, 34, 38,
-		36, 40, 42, 46,
-		44, 48, 50, 54,
-		52, 56, 58, 62,
-		60, 64, 66,
-	};
-	int sysdiv = (in_be32(&clockctl->scfr2) >> 26) & 0x3f;
-	return sysdiv_to_div_x_2[sysdiv];
-}
-
-static unsigned long ref_to_sys(unsigned long rate)
-{
-	rate *= spmf_mult();
-	rate *= 2;
-	rate /= sysdiv_div_x_2();
-
-	return rate;
-}
-
-static unsigned long sys_to_ref(unsigned long rate)
-{
-	rate *= sysdiv_div_x_2();
-	rate /= 2;
-	rate /= spmf_mult();
-
-	return rate;
-}
-
-static long ips_to_ref(unsigned long rate)
-{
-	int ips_div = (in_be32(&clockctl->scfr1) >> 23) & 0x7;
-
-	rate *= ips_div;	/* csb_clk = ips_clk * ips_div */
-	rate *= 2;		/* sys_clk = csb_clk * 2 */
-	return sys_to_ref(rate);
-}
-
-static unsigned long devtree_getfreq(char *clockname)
-{
-	struct device_node *np;
-	const unsigned int *prop;
-	unsigned int val = 0;
-
-	np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-immr");
-	if (np) {
-		prop = of_get_property(np, clockname, NULL);
-		if (prop)
-			val = *prop;
-	    of_node_put(np);
-	}
-	return val;
-}
-
-static void ref_clk_calc(struct clk *clk)
-{
-	unsigned long rate;
-
-	rate = devtree_getfreq("bus-frequency");
-	if (rate == 0) {
-		printk(KERN_ERR "No bus-frequency in dev tree\n");
-		clk->rate = 0;
-		return;
-	}
-	clk->rate = ips_to_ref(rate);
-}
-
-static struct clk ref_clk = {
-	.name = "ref_clk",
-	.calc = ref_clk_calc,
-};
-
-
-static void sys_clk_calc(struct clk *clk)
-{
-	clk->rate = ref_to_sys(ref_clk.rate);
-}
-
-static struct clk sys_clk = {
-	.name = "sys_clk",
-	.calc = sys_clk_calc,
-};
-
-static void diu_clk_calc(struct clk *clk)
-{
-	int diudiv_x_2 = in_be32(&clockctl->scfr1) & 0xff;
-	unsigned long rate;
-
-	rate = sys_clk.rate;
-
-	rate *= 2;
-	rate /= diudiv_x_2;
-
-	clk->rate = rate;
-}
-
-static void viu_clk_calc(struct clk *clk)
-{
-	unsigned long rate;
-
-	rate = sys_clk.rate;
-	rate /= 2;
-	clk->rate = rate;
-}
-
-static void half_clk_calc(struct clk *clk)
-{
-	clk->rate = clk->parent->rate / 2;
-}
-
-static void generic_div_clk_calc(struct clk *clk)
-{
-	int div = (in_be32(&clockctl->scfr1) >> clk->div_shift) & 0x7;
-
-	clk->rate = clk->parent->rate / div;
-}
-
-static void unity_clk_calc(struct clk *clk)
-{
-	clk->rate = clk->parent->rate;
-}
-
-static struct clk csb_clk = {
-	.name = "csb_clk",
-	.calc = half_clk_calc,
-	.parent = &sys_clk,
-};
-
-static void e300_clk_calc(struct clk *clk)
-{
-	int spmf = (in_be32(&clockctl->spmr) >> 16) & 0xf;
-	int ratex2 = clk->parent->rate * spmf;
-
-	clk->rate = ratex2 / 2;
-}
-
-static struct clk e300_clk = {
-	.name = "e300_clk",
-	.calc = e300_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk ips_clk = {
-	.name = "ips_clk",
-	.calc = generic_div_clk_calc,
-	.parent = &csb_clk,
-	.div_shift = 23,
-};
-
-/*
- * Clocks controlled by SCCR1 (.reg = 0)
- */
-static struct clk lpc_clk = {
-	.name = "lpc_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 30,
-	.calc = generic_div_clk_calc,
-	.parent = &ips_clk,
-	.div_shift = 11,
-};
-
-static struct clk nfc_clk = {
-	.name = "nfc_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 29,
-	.calc = generic_div_clk_calc,
-	.parent = &ips_clk,
-	.div_shift = 8,
-};
-
-static struct clk pata_clk = {
-	.name = "pata_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 28,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-/*
- * PSC clocks (bits 27 - 16)
- * are setup elsewhere
- */
-
-static struct clk sata_clk = {
-	.name = "sata_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 14,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-static struct clk fec_clk = {
-	.name = "fec_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 13,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-static struct clk pci_clk = {
-	.name = "pci_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 0,
-	.bit = 11,
-	.calc = generic_div_clk_calc,
-	.parent = &csb_clk,
-	.div_shift = 20,
-};
-
-/*
- * Clocks controlled by SCCR2 (.reg = 1)
- */
-static struct clk diu_clk = {
-	.name = "diu_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 31,
-	.calc = diu_clk_calc,
-};
-
-static struct clk viu_clk = {
-	.name = "viu_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 18,
-	.calc = viu_clk_calc,
-};
-
-static struct clk axe_clk = {
-	.name = "axe_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 30,
-	.calc = unity_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk usb1_clk = {
-	.name = "usb1_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 28,
-	.calc = unity_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk usb2_clk = {
-	.name = "usb2_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 27,
-	.calc = unity_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk i2c_clk = {
-	.name = "i2c_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 26,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-static struct clk mscan_clk = {
-	.name = "mscan_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 25,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-static struct clk sdhc_clk = {
-	.name = "sdhc_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 24,
-	.calc = unity_clk_calc,
-	.parent = &ips_clk,
-};
-
-static struct clk mbx_bus_clk = {
-	.name = "mbx_bus_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 22,
-	.calc = half_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk mbx_clk = {
-	.name = "mbx_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 21,
-	.calc = unity_clk_calc,
-	.parent = &csb_clk,
-};
-
-static struct clk mbx_3d_clk = {
-	.name = "mbx_3d_clk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 20,
-	.calc = generic_div_clk_calc,
-	.parent = &mbx_bus_clk,
-	.div_shift = 14,
-};
-
-static void psc_mclk_in_calc(struct clk *clk)
-{
-	clk->rate = devtree_getfreq("psc_mclk_in");
-	if (!clk->rate)
-		clk->rate = 25000000;
-}
-
-static struct clk psc_mclk_in = {
-	.name = "psc_mclk_in",
-	.calc = psc_mclk_in_calc,
-};
-
-static struct clk spdif_txclk = {
-	.name = "spdif_txclk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 23,
-};
-
-static struct clk spdif_rxclk = {
-	.name = "spdif_rxclk",
-	.flags = CLK_HAS_CTRL,
-	.reg = 1,
-	.bit = 23,
-};
-
-static void ac97_clk_calc(struct clk *clk)
-{
-	/* ac97 bit clock is always 24.567 MHz */
-	clk->rate = 24567000;
-}
-
-static struct clk ac97_clk = {
-	.name = "ac97_clk_in",
-	.calc = ac97_clk_calc,
-};
-
-static struct clk *rate_clks[] = {
-	&ref_clk,
-	&sys_clk,
-	&diu_clk,
-	&viu_clk,
-	&csb_clk,
-	&e300_clk,
-	&ips_clk,
-	&fec_clk,
-	&sata_clk,
-	&pata_clk,
-	&nfc_clk,
-	&lpc_clk,
-	&mbx_bus_clk,
-	&mbx_clk,
-	&mbx_3d_clk,
-	&axe_clk,
-	&usb1_clk,
-	&usb2_clk,
-	&i2c_clk,
-	&mscan_clk,
-	&sdhc_clk,
-	&pci_clk,
-	&psc_mclk_in,
-	&spdif_txclk,
-	&spdif_rxclk,
-	&ac97_clk,
-	NULL
-};
-
-static void rate_clk_init(struct clk *clk)
-{
-	if (clk->calc) {
-		clk->calc(clk);
-		clk->flags |= CLK_HAS_RATE;
-		clk_register(clk);
-	} else {
-		printk(KERN_WARNING
-		       "Could not initialize clk %s without a calc routine\n",
-		       clk->name);
-	}
-}
-
-static void rate_clks_init(void)
-{
-	struct clk **cpp, *clk;
-
-	cpp = rate_clks;
-	while ((clk = *cpp++))
-		rate_clk_init(clk);
-}
-
-/*
- * There are two clk enable registers with 32 enable bits each
- * psc clocks and device clocks are all stored in dev_clks
- */
-static struct clk dev_clks[2][32];
-
-/*
- * Given a psc number return the dev_clk
- * associated with it
- */
-static struct clk *psc_dev_clk(int pscnum)
-{
-	int reg, bit;
-	struct clk *clk;
-
-	reg = 0;
-	bit = 27 - pscnum;
-
-	clk = &dev_clks[reg][bit];
-	clk->reg = 0;
-	clk->bit = bit;
-	return clk;
-}
-
-/*
- * PSC clock rate calculation
- */
-static void psc_calc_rate(struct clk *clk, int pscnum, struct device_node *np)
-{
-	unsigned long mclk_src = sys_clk.rate;
-	unsigned long mclk_div;
-
-	/*
-	 * Can only change value of mclk divider
-	 * when the divider is disabled.
-	 *
-	 * Zero is not a valid divider so minimum
-	 * divider is 1
-	 *
-	 * disable/set divider/enable
-	 */
-	out_be32(&clockctl->pccr[pscnum], 0);
-	out_be32(&clockctl->pccr[pscnum], 0x00020000);
-	out_be32(&clockctl->pccr[pscnum], 0x00030000);
-
-	if (in_be32(&clockctl->pccr[pscnum]) & 0x80) {
-		clk->rate = spdif_rxclk.rate;
-		return;
-	}
-
-	switch ((in_be32(&clockctl->pccr[pscnum]) >> 14) & 0x3) {
-	case 0:
-		mclk_src = sys_clk.rate;
-		break;
-	case 1:
-		mclk_src = ref_clk.rate;
-		break;
-	case 2:
-		mclk_src = psc_mclk_in.rate;
-		break;
-	case 3:
-		mclk_src = spdif_txclk.rate;
-		break;
-	}
-
-	mclk_div = ((in_be32(&clockctl->pccr[pscnum]) >> 17) & 0x7fff) + 1;
-	clk->rate = mclk_src / mclk_div;
-}
-
-/*
- * Find all psc nodes in device tree and assign a clock
- * with name "psc%d_mclk" and dev pointing at the device
- * returned from of_find_device_by_node
- */
-static void psc_clks_init(void)
-{
-	struct device_node *np;
-	struct platform_device *ofdev;
-	u32 reg;
-	const char *psc_compat;
-
-	psc_compat = mpc512x_select_psc_compat();
-	if (!psc_compat)
-		return;
-
-	for_each_compatible_node(np, NULL, psc_compat) {
-		if (!of_property_read_u32(np, "reg", &reg)) {
-			int pscnum = (reg & 0xf00) >> 8;
-			struct clk *clk = psc_dev_clk(pscnum);
-
-			clk->flags = CLK_HAS_RATE | CLK_HAS_CTRL;
-			ofdev = of_find_device_by_node(np);
-			clk->dev = &ofdev->dev;
-			/*
-			 * AC97 is special rate clock does
-			 * not go through normal path
-			 */
-			if (of_device_is_compatible(np, "fsl,mpc5121-psc-ac97"))
-				clk->rate = ac97_clk.rate;
-			else
-				psc_calc_rate(clk, pscnum, np);
-			sprintf(clk->name, "psc%d_mclk", pscnum);
-			clk_register(clk);
-			clk_enable(clk);
-		}
-	}
-}
-
-static struct clk_interface mpc5121_clk_functions = {
-	.clk_get		= mpc5121_clk_get,
-	.clk_enable		= mpc5121_clk_enable,
-	.clk_disable		= mpc5121_clk_disable,
-	.clk_get_rate		= mpc5121_clk_get_rate,
-	.clk_put		= mpc5121_clk_put,
-	.clk_round_rate		= mpc5121_clk_round_rate,
-	.clk_set_rate		= mpc5121_clk_set_rate,
-	.clk_set_parent		= NULL,
-	.clk_get_parent		= NULL,
-};
-
-int __init mpc5121_clk_init(void)
-{
-	struct device_node *np;
-
-	np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-clock");
-	if (np) {
-		clockctl = of_iomap(np, 0);
-		of_node_put(np);
-	}
-
-	if (!clockctl) {
-		printk(KERN_ERR "Could not map clock control registers\n");
-		return 0;
-	}
-
-	rate_clks_init();
-	psc_clks_init();
-
-	/* leave clockctl mapped forever */
-	/*iounmap(clockctl); */
-	DEBUG_CLK_DUMP();
-	clocks_initialized++;
-	clk_functions = mpc5121_clk_functions;
-	return 0;
-}
-- 
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       ` [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         ` 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       ` Gerhard Sittig [this message]
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 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-9-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.