From: Domenico Andreoli <[email-masked]>

Minimal clock support required for the BCM4760 SoCs boot.

Cc: Mike Turquette <[email-masked]>
Cc: [email-masked]
Signed-off-by: Domenico Andreoli <[email-masked]>
---
 arch/arm/mach-bcm/bcm4760.c |    2 ++
 drivers/clk/Makefile        |    1 +
 drivers/clk/clk-bcm4760.c   |   35 +++++++++++++++++++++++++++++++++++
 include/linux/clk/bcm4760.h |   22 ++++++++++++++++++++++
 4 files changed, 60 insertions(+)
 create mode 100644 drivers/clk/clk-bcm4760.c
 create mode 100644 include/linux/clk/bcm4760.h

Index: b/arch/arm/mach-bcm/bcm4760.c
===================================================================
--- a/arch/arm/mach-bcm/bcm4760.c
+++ b/arch/arm/mach-bcm/bcm4760.c
@@ -18,6 +18,7 @@
 #include <linux/irqchip.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
+#include <linux/clk/bcm4760.h>
 
 #include <asm/system_info.h>
 #include <asm/mach/arch.h>
@@ -60,6 +61,7 @@ static void __init bcm4760_init(void)
 	int err;
 
 	bcm4760_system_rev();
+	bcm4760_init_clocks();
 
 	err = of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 	if (err) {
Index: b/drivers/clk/Makefile
===================================================================
--- a/drivers/clk/Makefile
+++ b/drivers/clk/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_COMMON_CLK)	+= clk-composit
 
 # SoCs specific
 obj-$(CONFIG_ARCH_BCM2835)	+= clk-bcm2835.o
+obj-$(CONFIG_ARCH_BCM4760)	+= clk-bcm4760.o
 obj-$(CONFIG_ARCH_NOMADIK)	+= clk-nomadik.o
 obj-$(CONFIG_ARCH_HIGHBANK)	+= clk-highbank.o
 obj-$(CONFIG_ARCH_NSPIRE)	+= clk-nspire.o
Index: b/drivers/clk/clk-bcm4760.c
===================================================================
--- /dev/null
+++ b/drivers/clk/clk-bcm4760.c
@@ -0,0 +1,35 @@
+/*
+ * Broadcom BCM4760 based ARM11 SoCs clocks
+ *
+ * Copyright (C) 2012 Domenico Andreoli <[email-masked]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/clkdev.h>
+#include <linux/clk/bcm4760.h>
+
+void __init bcm4760_init_clocks(void)
+{
+	struct clk *clk;
+
+	clk = clk_register_fixed_rate(NULL, "pclk", NULL, CLK_IS_ROOT, 78000000);
+	if (IS_ERR(clk))
+		pr_err("pclk not registered\n");
+
+	if (clk_register_clkdev(clk, NULL, "c0000.uart0"))
+		pr_err("uart0 clk alias not registered\n");
+	if (clk_register_clkdev(clk, NULL, "c1000.uart1"))
+		pr_err("uart1 clk alias not registered\n");
+	if (clk_register_clkdev(clk, NULL, "b2000.uart2"))
+		pr_err("uart2 clk alias not registered\n");
+}
Index: b/include/linux/clk/bcm4760.h
===================================================================
--- /dev/null
+++ b/include/linux/clk/bcm4760.h
@@ -0,0 +1,22 @@
+/*
+ * Broadcom BCM4760 based ARM11 SoCs clocks
+ *
+ * Copyright (C) 2012 Domenico Andreoli <[email-masked]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _LINUX_CLK_BCM4760_H
+#define _LINUX_CLK_BCM4760_H
+
+void __init bcm4760_init_clocks(void);
+
+#endif