From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <rjui@broadcom.com>
Subject: Re: [PATCH 0/3] clk: Broadcom BCM63138 support
To: Florian Fainelli <f.fainelli@gmail.com>, <linux-clk@vger.kernel.org>
References: <1445621448-11894-1-git-send-email-f.fainelli@gmail.com>
CC: <bcm-kernel-feedback-list@broadcom.com>, <devicetree@vger.kernel.org>,
	<jonmason@broadcom.com>, <sboyd@codeaurora.org>, <mturquette@baylibre.com>,
	<linux@arm.linux.org.uk>, <sbranden@broadcom.com>
From: Ray Jui <rjui@broadcom.com>
Message-ID: <562A7DF0.20709@broadcom.com>
Date: Fri, 23 Oct 2015 11:35:28 -0700
MIME-Version: 1.0
In-Reply-To: <1445621448-11894-1-git-send-email-f.fainelli@gmail.com>
Content-Type: text/plain; charset="windows-1252"; format=flowed
Return-Path: rjui@broadcom.com
List-ID: <linux-clk.vger.kernel.org>

Hi Florian,

On 10/23/2015 10:30 AM, Florian Fainelli wrote:
> Hi all,
>
> This patch series adds support for the Broadcom BCM63138 DSL SoCs
> clocking framework.
>
> Since the HW is identical to the one found in Broadcom iProc SoCs, but the
> integration is different (obviously), there is still a new compatible string
> introduced just in case we happen to find issues in the future.
>
> This applies on top of clk/next as of
>
> f63d19ef52aa66e97fca2425974845177ce02b0a ("Merge branch 'clk-iproc' into clk-next")
>
> Since there is an obvious dependency between patch 2 and 3, we can either
> merge this through the Clock tree or via a future arm-soc pull requests
> for Broadcom SoCs.
>
> Thanks!
>
> Florian Fainelli (3):
>    clk: iproc: Extend binding to cover BCM63138
>    clk: bcm: Add BCM63138 clock support
>    ARM: dts: BCM63xx: Add ARMPLL device tree nodes
>
>   .../bindings/clock/brcm,iproc-clocks.txt           |  5 +++
>   arch/arm/boot/dts/bcm63138.dtsi                    | 39 ++++++++++++++++------
>   drivers/clk/bcm/Kconfig                            | 10 ++++++
>   drivers/clk/bcm/Makefile                           |  1 +
>   drivers/clk/bcm/clk-bcm63xx.c                      | 22 ++++++++++++
>   5 files changed, 67 insertions(+), 10 deletions(-)
>   create mode 100644 drivers/clk/bcm/clk-bcm63xx.c
>

The entire patch set looks good to me (- Scott's comment of adding 
COMPILE_TEST to increase build test coverage).

Thanks,

Ray

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <sbranden@broadcom.com>
Subject: Re: [PATCH 2/3] clk: bcm: Add BCM63138 clock support
To: Florian Fainelli <f.fainelli@gmail.com>, <linux-clk@vger.kernel.org>
References: <1445621448-11894-1-git-send-email-f.fainelli@gmail.com>
 <1445621448-11894-3-git-send-email-f.fainelli@gmail.com>
CC: <bcm-kernel-feedback-list@broadcom.com>, <devicetree@vger.kernel.org>,
	<jonmason@broadcom.com>, <sboyd@codeaurora.org>, <mturquette@baylibre.com>,
	<linux@arm.linux.org.uk>, <rjui@broadcom.com>
From: Scott Branden <sbranden@broadcom.com>
Message-ID: <562A70D8.1090401@broadcom.com>
Date: Fri, 23 Oct 2015 10:39:36 -0700
MIME-Version: 1.0
In-Reply-To: <1445621448-11894-3-git-send-email-f.fainelli@gmail.com>
Content-Type: text/plain; charset="windows-1252"; format=flowed
Return-Path: sbranden@broadcom.com
List-ID: <linux-clk.vger.kernel.org>

Hi Florian,

You should probably add COMPILE_TEST to increase compiler code coverage.

On 15-10-23 10:30 AM, Florian Fainelli wrote:
> BCM63138 has a simple clocking domain which is primarily the ARMPLL
> clocking complex, from which the ARM (CPU), APB and AXI clocks would be
> derived from.
>
> Since the ARMPLL controller is entirely compatible with the iProc ARM
> PLL, we just initialize it without additional parameters.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>   drivers/clk/bcm/Kconfig       | 10 ++++++++++
>   drivers/clk/bcm/Makefile      |  1 +
>   drivers/clk/bcm/clk-bcm63xx.c | 22 ++++++++++++++++++++++
>   3 files changed, 33 insertions(+)
>   create mode 100644 drivers/clk/bcm/clk-bcm63xx.c
>
> diff --git a/drivers/clk/bcm/Kconfig b/drivers/clk/bcm/Kconfig
> index 85260fb96b36..eb4daed6aa56 100644
> --- a/drivers/clk/bcm/Kconfig
> +++ b/drivers/clk/bcm/Kconfig
> @@ -1,3 +1,13 @@
> +config CLK_BCM_63XX
> +	bool "Broadcom BCM63xx clock support"
> +	depends on ARCH_BCM_63XX
|| COMPILE_TEST
> +	depends on COMMON_CLK
> +	select COMMON_CLK_IPROC
> +	default y
> +	help
> +	  Enable common clock framework support for Broadcom BCM63xx DSL SoCs
> +	  based on the ARM architecture
> +
>   config CLK_BCM_KONA
>   	bool "Broadcom Kona CCU clock support"
>   	depends on ARCH_BCM_MOBILE || COMPILE_TEST
> diff --git a/drivers/clk/bcm/Makefile b/drivers/clk/bcm/Makefile
> index 3fc95060d875..247c26750d8b 100644
> --- a/drivers/clk/bcm/Makefile
> +++ b/drivers/clk/bcm/Makefile
> @@ -1,3 +1,4 @@
> +obj-$(CONFIG_CLK_BCM_63XX)	+= clk-bcm63xx.o
>   obj-$(CONFIG_CLK_BCM_KONA)	+= clk-kona.o
>   obj-$(CONFIG_CLK_BCM_KONA)	+= clk-kona-setup.o
>   obj-$(CONFIG_CLK_BCM_KONA)	+= clk-bcm281xx.o
> diff --git a/drivers/clk/bcm/clk-bcm63xx.c b/drivers/clk/bcm/clk-bcm63xx.c
> new file mode 100644
> index 000000000000..b7e0469d0522
> --- /dev/null
> +++ b/drivers/clk/bcm/clk-bcm63xx.c
> @@ -0,0 +1,22 @@
> +/*
> + * Copyright (C) 2015 Broadcom Corporation
> + *
> + * 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 version 2.
> + *
> + * This program is distributed "as is" WITHOUT ANY WARRANTY of any
> + * kind, whether express or implied; without even the implied warranty
> + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +#include <linux/kernel.h>
> +#include <linux/clk-provider.h>
> +#include <linux/of.h>
> +#include "clk-iproc.h"
> +
> +static void __init bcm63138_armpll_init(struct device_node *node)
> +{
> +	iproc_armpll_setup(node);
> +}
> +CLK_OF_DECLARE(bcm63138_armpll, "brcm,bcm63138-armpll", bcm63138_armpll_init);
>

Regards,
Scott

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <f.fainelli@gmail.com>
Return-Path: <f.fainelli@gmail.com>
From: Florian Fainelli <f.fainelli@gmail.com>
To: linux-clk@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com,
	devicetree@vger.kernel.org,
	jonmason@broadcom.com,
	sboyd@codeaurora.org,
	mturquette@baylibre.com,
	linux@arm.linux.org.uk,
	sbranden@broadcom.com,
	rjui@broadcom.com,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH 0/3] clk: Broadcom BCM63138 support
Date: Fri, 23 Oct 2015 10:30:45 -0700
Message-Id: <1445621448-11894-1-git-send-email-f.fainelli@gmail.com>
List-ID: <linux-clk.vger.kernel.org>

Hi all,

This patch series adds support for the Broadcom BCM63138 DSL SoCs
clocking framework.

Since the HW is identical to the one found in Broadcom iProc SoCs, but the
integration is different (obviously), there is still a new compatible string
introduced just in case we happen to find issues in the future.

This applies on top of clk/next as of

f63d19ef52aa66e97fca2425974845177ce02b0a ("Merge branch 'clk-iproc' into clk-next")

Since there is an obvious dependency between patch 2 and 3, we can either
merge this through the Clock tree or via a future arm-soc pull requests
for Broadcom SoCs.

Thanks!

Florian Fainelli (3):
  clk: iproc: Extend binding to cover BCM63138
  clk: bcm: Add BCM63138 clock support
  ARM: dts: BCM63xx: Add ARMPLL device tree nodes

 .../bindings/clock/brcm,iproc-clocks.txt           |  5 +++
 arch/arm/boot/dts/bcm63138.dtsi                    | 39 ++++++++++++++++------
 drivers/clk/bcm/Kconfig                            | 10 ++++++
 drivers/clk/bcm/Makefile                           |  1 +
 drivers/clk/bcm/clk-bcm63xx.c                      | 22 ++++++++++++
 5 files changed, 67 insertions(+), 10 deletions(-)
 create mode 100644 drivers/clk/bcm/clk-bcm63xx.c

-- 
2.1.0

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <f.fainelli@gmail.com>
Return-Path: <f.fainelli@gmail.com>
From: Florian Fainelli <f.fainelli@gmail.com>
To: linux-clk@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com,
	devicetree@vger.kernel.org,
	jonmason@broadcom.com,
	sboyd@codeaurora.org,
	mturquette@baylibre.com,
	linux@arm.linux.org.uk,
	sbranden@broadcom.com,
	rjui@broadcom.com,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH 1/3] clk: iproc: Extend binding to cover BCM63138
Date: Fri, 23 Oct 2015 10:30:46 -0700
Message-Id: <1445621448-11894-2-git-send-email-f.fainelli@gmail.com>
In-Reply-To: <1445621448-11894-1-git-send-email-f.fainelli@gmail.com>
References: <1445621448-11894-1-git-send-email-f.fainelli@gmail.com>
List-ID: <linux-clk.vger.kernel.org>

Broadcom BCM63138 DSL SoCs have the same ARMPLL clocking infrastructure
as the Cygnus and iProc chips, add a dedicated compatible string and
document that the ARMPLL node is a valid node for this chip.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 Documentation/devicetree/bindings/clock/brcm,iproc-clocks.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/clock/brcm,iproc-clocks.txt b/Documentation/devicetree/bindings/clock/brcm,iproc-clocks.txt
index ede65a55e21b..0b35e71b39e8 100644
--- a/Documentation/devicetree/bindings/clock/brcm,iproc-clocks.txt
+++ b/Documentation/devicetree/bindings/clock/brcm,iproc-clocks.txt
@@ -208,3 +208,8 @@ These clock IDs are defined in:
     ch3_unused	lcpll_ports	4	BCM_NS2_LCPLL_PORTS_CH3_UNUSED
     ch4_unused	lcpll_ports	5	BCM_NS2_LCPLL_PORTS_CH4_UNUSED
     ch5_unused	lcpll_ports	6	BCM_NS2_LCPLL_PORTS_CH5_UNUSED
+
+BCM63138
+--------
+PLL and leaf clock compatible strings for BCM63138 are:
+    "brcm,bcm63138-armpll"
-- 
2.1.0

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <f.fainelli@gmail.com>
Return-Path: <f.fainelli@gmail.com>
From: Florian Fainelli <f.fainelli@gmail.com>
To: linux-clk@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com,
	devicetree@vger.kernel.org,
	jonmason@broadcom.com,
	sboyd@codeaurora.org,
	mturquette@baylibre.com,
	linux@arm.linux.org.uk,
	sbranden@broadcom.com,
	rjui@broadcom.com,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH 3/3] ARM: dts: BCM63xx: Add ARMPLL device tree nodes
Date: Fri, 23 Oct 2015 10:30:48 -0700
Message-Id: <1445621448-11894-4-git-send-email-f.fainelli@gmail.com>
In-Reply-To: <1445621448-11894-1-git-send-email-f.fainelli@gmail.com>
References: <1445621448-11894-1-git-send-email-f.fainelli@gmail.com>
List-ID: <linux-clk.vger.kernel.org>

Add the ARM PLL controller which comes standard with the Cortex-A9 found
on the BCM63138 SoCs. This is the same controller as the one found in
the Broadcom iProc architecture, however, we have a separate compatible
string to indicate the integration difference.

While at it, properly rename references to the 50Mhz clock which is in
fact a crystal/oscillator and updates references to it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 arch/arm/boot/dts/bcm63138.dtsi | 39 +++++++++++++++++++++++++++++----------
 1 file changed, 29 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boot/dts/bcm63138.dtsi b/arch/arm/boot/dts/bcm63138.dtsi
index 34cd64051250..c146325eebdb 100644
--- a/arch/arm/boot/dts/bcm63138.dtsi
+++ b/arch/arm/boot/dts/bcm63138.dtsi
@@ -43,17 +43,29 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		arm_timer_clk: arm_timer_clk {
+		osc: oscillator {
 			#clock-cells = <0>;
 			compatible = "fixed-clock";
-			clock-frequency = <500000000>;
+			clock-frequency = <50000000>;
+			clock-output-names = "periph";
 		};
 
-		periph_clk: periph_clk {
+		/* peripheral clock for system timer */
+		axi_clk: axi_clk {
 			#clock-cells = <0>;
-			compatible = "fixed-clock";
-			clock-frequency = <50000000>;
-			clock-output-names = "periph";
+			compatible = "fixed-factor-clock";
+			clocks = <&armpll>;
+			clock-div = <2>;
+			clock-mult = <1>;
+		};
+
+		/* APB bus clock */
+		apb_clk: apb_clk {
+			#clock-cells = <0>;
+			compatible = "fixed-factor-clock";
+			clocks = <&armpll>;
+			clock-div = <4>;
+			clock-mult = <1>;
 		};
 	};
 
@@ -93,14 +105,14 @@
 			compatible = "arm,cortex-a9-global-timer";
 			reg = <0x1e200 0x20>;
 			interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&arm_timer_clk>;
+			clocks = <&axi_clk>;
 		};
 
 		local_timer: local-timer@1e600 {
 			compatible = "arm,cortex-a9-twd-timer";
 			reg = <0x1e600 0x20>;
 			interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&arm_timer_clk>;
+			clocks = <&axi_clk>;
 		};
 
 		twd_watchdog: watchdog@1e620 {
@@ -109,6 +121,13 @@
 			interrupts = <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH>;
 		};
 
+		armpll: armpll {
+			#clock-cells = <0>;
+			compatible = "brcm,bcm63138-armpll";
+			clocks = <&osc>;
+			reg = <0x20000 0xf00>;
+		};
+
 		pmb0: reset-controller@4800c0 {
 			compatible = "brcm,bcm63138-pmb";
 			reg = <0x4800c0 0x10>;
@@ -138,7 +157,7 @@
 			compatible = "brcm,bcm6345-uart";
 			reg = <0x600 0x1b>;
 			interrupts = <GIC_SPI 32 0>;
-			clocks = <&periph_clk>;
+			clocks = <&osc>;
 			clock-names = "periph";
 			status = "disabled";
 		};
@@ -147,7 +166,7 @@
 			compatible = "brcm,bcm6345-uart";
 			reg = <0x620 0x1b>;
 			interrupts = <GIC_SPI 33 0>;
-			clocks = <&periph_clk>;
+			clocks = <&osc>;
 			clock-names = "periph";
 			status = "disabled";
 		};
-- 
2.1.0

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <f.fainelli@gmail.com>
Return-Path: <f.fainelli@gmail.com>
From: Florian Fainelli <f.fainelli@gmail.com>
To: linux-clk@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com,
	devicetree@vger.kernel.org,
	jonmason@broadcom.com,
	sboyd@codeaurora.org,
	mturquette@baylibre.com,
	linux@arm.linux.org.uk,
	sbranden@broadcom.com,
	rjui@broadcom.com,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH 2/3] clk: bcm: Add BCM63138 clock support
Date: Fri, 23 Oct 2015 10:30:47 -0700
Message-Id: <1445621448-11894-3-git-send-email-f.fainelli@gmail.com>
In-Reply-To: <1445621448-11894-1-git-send-email-f.fainelli@gmail.com>
References: <1445621448-11894-1-git-send-email-f.fainelli@gmail.com>
List-ID: <linux-clk.vger.kernel.org>

BCM63138 has a simple clocking domain which is primarily the ARMPLL
clocking complex, from which the ARM (CPU), APB and AXI clocks would be
derived from.

Since the ARMPLL controller is entirely compatible with the iProc ARM
PLL, we just initialize it without additional parameters.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/clk/bcm/Kconfig       | 10 ++++++++++
 drivers/clk/bcm/Makefile      |  1 +
 drivers/clk/bcm/clk-bcm63xx.c | 22 ++++++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 drivers/clk/bcm/clk-bcm63xx.c

diff --git a/drivers/clk/bcm/Kconfig b/drivers/clk/bcm/Kconfig
index 85260fb96b36..eb4daed6aa56 100644
--- a/drivers/clk/bcm/Kconfig
+++ b/drivers/clk/bcm/Kconfig
@@ -1,3 +1,13 @@
+config CLK_BCM_63XX
+	bool "Broadcom BCM63xx clock support"
+	depends on ARCH_BCM_63XX
+	depends on COMMON_CLK
+	select COMMON_CLK_IPROC
+	default y
+	help
+	  Enable common clock framework support for Broadcom BCM63xx DSL SoCs
+	  based on the ARM architecture
+
 config CLK_BCM_KONA
 	bool "Broadcom Kona CCU clock support"
 	depends on ARCH_BCM_MOBILE || COMPILE_TEST
diff --git a/drivers/clk/bcm/Makefile b/drivers/clk/bcm/Makefile
index 3fc95060d875..247c26750d8b 100644
--- a/drivers/clk/bcm/Makefile
+++ b/drivers/clk/bcm/Makefile
@@ -1,3 +1,4 @@
+obj-$(CONFIG_CLK_BCM_63XX)	+= clk-bcm63xx.o
 obj-$(CONFIG_CLK_BCM_KONA)	+= clk-kona.o
 obj-$(CONFIG_CLK_BCM_KONA)	+= clk-kona-setup.o
 obj-$(CONFIG_CLK_BCM_KONA)	+= clk-bcm281xx.o
diff --git a/drivers/clk/bcm/clk-bcm63xx.c b/drivers/clk/bcm/clk-bcm63xx.c
new file mode 100644
index 000000000000..b7e0469d0522
--- /dev/null
+++ b/drivers/clk/bcm/clk-bcm63xx.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2015 Broadcom Corporation
+ *
+ * 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 version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+#include <linux/kernel.h>
+#include <linux/clk-provider.h>
+#include <linux/of.h>
+#include "clk-iproc.h"
+
+static void __init bcm63138_armpll_init(struct device_node *node)
+{
+	iproc_armpll_setup(node);
+}
+CLK_OF_DECLARE(bcm63138_armpll, "brcm,bcm63138-armpll", bcm63138_armpll_init);
-- 
2.1.0

From mboxrd@z Thu Jan  1 00:00:00 1970
From: Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH 3/3] ARM: dts: BCM63xx: Add ARMPLL device tree nodes
Date: Fri, 23 Oct 2015 10:30:48 -0700
Message-ID: <1445621448-11894-4-git-send-email-f.fainelli@gmail.com>
References: <1445621448-11894-1-git-send-email-f.fainelli@gmail.com>
Return-path: <devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
In-Reply-To: <1445621448-11894-1-git-send-email-f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
To: linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, jonmason-dY08KVG/lbpWk0Htik3J/w@public.gmane.org, sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org, linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org, sbranden-dY08KVG/lbpWk0Htik3J/w@public.gmane.org, rjui-dY08KVG/lbpWk0Htik3J/w@public.gmane.org, Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
List-Id: devicetree@vger.kernel.org

Add the ARM PLL controller which comes standard with the Cortex-A9 found
on the BCM63138 SoCs. This is the same controller as the one found in
the Broadcom iProc architecture, however, we have a separate compatible
string to indicate the integration difference.

While at it, properly rename references to the 50Mhz clock which is in
fact a crystal/oscillator and updates references to it.

Signed-off-by: Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 arch/arm/boot/dts/bcm63138.dtsi | 39 +++++++++++++++++++++++++++++----------
 1 file changed, 29 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boot/dts/bcm63138.dtsi b/arch/arm/boot/dts/bcm63138.dtsi
index 34cd64051250..c146325eebdb 100644
--- a/arch/arm/boot/dts/bcm63138.dtsi
+++ b/arch/arm/boot/dts/bcm63138.dtsi
@@ -43,17 +43,29 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		arm_timer_clk: arm_timer_clk {
+		osc: oscillator {
 			#clock-cells = <0>;
 			compatible = "fixed-clock";
-			clock-frequency = <500000000>;
+			clock-frequency = <50000000>;
+			clock-output-names = "periph";
 		};
 
-		periph_clk: periph_clk {
+		/* peripheral clock for system timer */
+		axi_clk: axi_clk {
 			#clock-cells = <0>;
-			compatible = "fixed-clock";
-			clock-frequency = <50000000>;
-			clock-output-names = "periph";
+			compatible = "fixed-factor-clock";
+			clocks = <&armpll>;
+			clock-div = <2>;
+			clock-mult = <1>;
+		};
+
+		/* APB bus clock */
+		apb_clk: apb_clk {
+			#clock-cells = <0>;
+			compatible = "fixed-factor-clock";
+			clocks = <&armpll>;
+			clock-div = <4>;
+			clock-mult = <1>;
 		};
 	};
 
@@ -93,14 +105,14 @@
 			compatible = "arm,cortex-a9-global-timer";
 			reg = <0x1e200 0x20>;
 			interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&arm_timer_clk>;
+			clocks = <&axi_clk>;
 		};
 
 		local_timer: local-timer@1e600 {
 			compatible = "arm,cortex-a9-twd-timer";
 			reg = <0x1e600 0x20>;
 			interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&arm_timer_clk>;
+			clocks = <&axi_clk>;
 		};
 
 		twd_watchdog: watchdog@1e620 {
@@ -109,6 +121,13 @@
 			interrupts = <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH>;
 		};
 
+		armpll: armpll {
+			#clock-cells = <0>;
+			compatible = "brcm,bcm63138-armpll";
+			clocks = <&osc>;
+			reg = <0x20000 0xf00>;
+		};
+
 		pmb0: reset-controller@4800c0 {
 			compatible = "brcm,bcm63138-pmb";
 			reg = <0x4800c0 0x10>;
@@ -138,7 +157,7 @@
 			compatible = "brcm,bcm6345-uart";
 			reg = <0x600 0x1b>;
 			interrupts = <GIC_SPI 32 0>;
-			clocks = <&periph_clk>;
+			clocks = <&osc>;
 			clock-names = "periph";
 			status = "disabled";
 		};
@@ -147,7 +166,7 @@
 			compatible = "brcm,bcm6345-uart";
 			reg = <0x620 0x1b>;
 			interrupts = <GIC_SPI 33 0>;
-			clocks = <&periph_clk>;
+			clocks = <&osc>;
 			clock-names = "periph";
 			status = "disabled";
 		};
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

From mboxrd@z Thu Jan  1 00:00:00 1970
From: Scott Branden <sbranden@broadcom.com>
Subject: Re: [PATCH 2/3] clk: bcm: Add BCM63138 clock support
Date: Fri, 23 Oct 2015 10:39:36 -0700
Message-ID: <562A70D8.1090401@broadcom.com>
References: <1445621448-11894-1-git-send-email-f.fainelli@gmail.com>
 <1445621448-11894-3-git-send-email-f.fainelli@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="windows-1252"; format=flowed
Content-Transfer-Encoding: 7bit
Return-path: <linux-clk-owner@vger.kernel.org>
In-Reply-To: <1445621448-11894-3-git-send-email-f.fainelli@gmail.com>
Sender: linux-clk-owner@vger.kernel.org
To: Florian Fainelli <f.fainelli@gmail.com>, linux-clk@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com, devicetree@vger.kernel.org, jonmason@broadcom.com, sboyd@codeaurora.org, mturquette@baylibre.com, linux@arm.linux.org.uk, rjui@broadcom.com
List-Id: devicetree@vger.kernel.org

Hi Florian,

You should probably add COMPILE_TEST to increase compiler code coverage.

On 15-10-23 10:30 AM, Florian Fainelli wrote:
> BCM63138 has a simple clocking domain which is primarily the ARMPLL
> clocking complex, from which the ARM (CPU), APB and AXI clocks would be
> derived from.
>
> Since the ARMPLL controller is entirely compatible with the iProc ARM
> PLL, we just initialize it without additional parameters.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>   drivers/clk/bcm/Kconfig       | 10 ++++++++++
>   drivers/clk/bcm/Makefile      |  1 +
>   drivers/clk/bcm/clk-bcm63xx.c | 22 ++++++++++++++++++++++
>   3 files changed, 33 insertions(+)
>   create mode 100644 drivers/clk/bcm/clk-bcm63xx.c
>
> diff --git a/drivers/clk/bcm/Kconfig b/drivers/clk/bcm/Kconfig
> index 85260fb96b36..eb4daed6aa56 100644
> --- a/drivers/clk/bcm/Kconfig
> +++ b/drivers/clk/bcm/Kconfig
> @@ -1,3 +1,13 @@
> +config CLK_BCM_63XX
> +	bool "Broadcom BCM63xx clock support"
> +	depends on ARCH_BCM_63XX
|| COMPILE_TEST
> +	depends on COMMON_CLK
> +	select COMMON_CLK_IPROC
> +	default y
> +	help
> +	  Enable common clock framework support for Broadcom BCM63xx DSL SoCs
> +	  based on the ARM architecture
> +
>   config CLK_BCM_KONA
>   	bool "Broadcom Kona CCU clock support"
>   	depends on ARCH_BCM_MOBILE || COMPILE_TEST
> diff --git a/drivers/clk/bcm/Makefile b/drivers/clk/bcm/Makefile
> index 3fc95060d875..247c26750d8b 100644
> --- a/drivers/clk/bcm/Makefile
> +++ b/drivers/clk/bcm/Makefile
> @@ -1,3 +1,4 @@
> +obj-$(CONFIG_CLK_BCM_63XX)	+= clk-bcm63xx.o
>   obj-$(CONFIG_CLK_BCM_KONA)	+= clk-kona.o
>   obj-$(CONFIG_CLK_BCM_KONA)	+= clk-kona-setup.o
>   obj-$(CONFIG_CLK_BCM_KONA)	+= clk-bcm281xx.o
> diff --git a/drivers/clk/bcm/clk-bcm63xx.c b/drivers/clk/bcm/clk-bcm63xx.c
> new file mode 100644
> index 000000000000..b7e0469d0522
> --- /dev/null
> +++ b/drivers/clk/bcm/clk-bcm63xx.c
> @@ -0,0 +1,22 @@
> +/*
> + * Copyright (C) 2015 Broadcom Corporation
> + *
> + * 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 version 2.
> + *
> + * This program is distributed "as is" WITHOUT ANY WARRANTY of any
> + * kind, whether express or implied; without even the implied warranty
> + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +#include <linux/kernel.h>
> +#include <linux/clk-provider.h>
> +#include <linux/of.h>
> +#include "clk-iproc.h"
> +
> +static void __init bcm63138_armpll_init(struct device_node *node)
> +{
> +	iproc_armpll_setup(node);
> +}
> +CLK_OF_DECLARE(bcm63138_armpll, "brcm,bcm63138-armpll", bcm63138_armpll_init);
>

Regards,
Scott

From mboxrd@z Thu Jan  1 00:00:00 1970
From: Ray Jui <rjui@broadcom.com>
Subject: Re: [PATCH 0/3] clk: Broadcom BCM63138 support
Date: Fri, 23 Oct 2015 11:35:28 -0700
Message-ID: <562A7DF0.20709@broadcom.com>
References: <1445621448-11894-1-git-send-email-f.fainelli@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="windows-1252"; format=flowed
Content-Transfer-Encoding: 7bit
Return-path: <linux-clk-owner@vger.kernel.org>
In-Reply-To: <1445621448-11894-1-git-send-email-f.fainelli@gmail.com>
Sender: linux-clk-owner@vger.kernel.org
To: Florian Fainelli <f.fainelli@gmail.com>, linux-clk@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com, devicetree@vger.kernel.org, jonmason@broadcom.com, sboyd@codeaurora.org, mturquette@baylibre.com, linux@arm.linux.org.uk, sbranden@broadcom.com
List-Id: devicetree@vger.kernel.org

Hi Florian,

On 10/23/2015 10:30 AM, Florian Fainelli wrote:
> Hi all,
>
> This patch series adds support for the Broadcom BCM63138 DSL SoCs
> clocking framework.
>
> Since the HW is identical to the one found in Broadcom iProc SoCs, but the
> integration is different (obviously), there is still a new compatible string
> introduced just in case we happen to find issues in the future.
>
> This applies on top of clk/next as of
>
> f63d19ef52aa66e97fca2425974845177ce02b0a ("Merge branch 'clk-iproc' into clk-next")
>
> Since there is an obvious dependency between patch 2 and 3, we can either
> merge this through the Clock tree or via a future arm-soc pull requests
> for Broadcom SoCs.
>
> Thanks!
>
> Florian Fainelli (3):
>    clk: iproc: Extend binding to cover BCM63138
>    clk: bcm: Add BCM63138 clock support
>    ARM: dts: BCM63xx: Add ARMPLL device tree nodes
>
>   .../bindings/clock/brcm,iproc-clocks.txt           |  5 +++
>   arch/arm/boot/dts/bcm63138.dtsi                    | 39 ++++++++++++++++------
>   drivers/clk/bcm/Kconfig                            | 10 ++++++
>   drivers/clk/bcm/Makefile                           |  1 +
>   drivers/clk/bcm/clk-bcm63xx.c                      | 22 ++++++++++++
>   5 files changed, 67 insertions(+), 10 deletions(-)
>   create mode 100644 drivers/clk/bcm/clk-bcm63xx.c
>

The entire patch set looks good to me (- Scott's comment of adding 
COMPILE_TEST to increase build test coverage).

Thanks,

Ray

