linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 25/41] clk: ux500: Add Device Tree support for the PRCMU clock
Date: Wed, 18 Sep 2013 13:14:22 +0100	[thread overview]
Message-ID: <1379506478-16625-26-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1379506478-16625-1-git-send-email-lee.jones@linaro.org>

This patch enables clocks to be specified from Device Tree via phandles
to the "prcmu-clock" node.

Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/clk/ux500/u8500_of_clk.c | 50 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 48 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/ux500/u8500_of_clk.c b/drivers/clk/ux500/u8500_of_clk.c
index b9b3317..f5534fd 100644
--- a/drivers/clk/ux500/u8500_of_clk.c
+++ b/drivers/clk/ux500/u8500_of_clk.c
@@ -15,6 +15,8 @@
 #include <linux/platform_data/clk-ux500.h>
 #include "clk.h"
 
+static struct clk *prcmu_clk[PRCMU_NUM_CLKS];
+
 #define PRCC_SHOW(clk, base, bit) \
 	clk[(base * PRCC_PERIPHS_PER_CLUSTER) + bit]
 
@@ -61,12 +63,15 @@ void u8500_of_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base,
 	/* Clock sources */
 	clk = clk_reg_prcmu_gate("soc0_pll", NULL, PRCMU_PLLSOC0,
 				CLK_IS_ROOT|CLK_IGNORE_UNUSED);
+	prcmu_clk[PRCMU_PLLSOC0] = clk;
 
 	clk = clk_reg_prcmu_gate("soc1_pll", NULL, PRCMU_PLLSOC1,
 				CLK_IS_ROOT|CLK_IGNORE_UNUSED);
+	prcmu_clk[PRCMU_PLLSOC1] = clk;
 
 	clk = clk_reg_prcmu_gate("ddr_pll", NULL, PRCMU_PLLDDR,
 				CLK_IS_ROOT|CLK_IGNORE_UNUSED);
+	prcmu_clk[PRCMU_PLLDDR] = clk;
 
 	/* FIXME: Add sys, ulp and int clocks here. */
 
@@ -94,93 +99,128 @@ void u8500_of_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base,
 	else
 		clk = clk_reg_prcmu_gate("sgclk", NULL,
 					PRCMU_SGACLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_SGACLK] = clk;
 
 	clk = clk_reg_prcmu_gate("uartclk", NULL, PRCMU_UARTCLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_UARTCLK] = clk;
 
 	clk = clk_reg_prcmu_gate("msp02clk", NULL, PRCMU_MSP02CLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_MSP02CLK] = clk;
 
 	clk = clk_reg_prcmu_gate("msp1clk", NULL, PRCMU_MSP1CLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_MSP1CLK] = clk;
 
 	clk = clk_reg_prcmu_gate("i2cclk", NULL, PRCMU_I2CCLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_I2CCLK] = clk;
 
 	clk = clk_reg_prcmu_gate("slimclk", NULL, PRCMU_SLIMCLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_SLIMCLK] = clk;
 
 	clk = clk_reg_prcmu_gate("per1clk", NULL, PRCMU_PER1CLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_PER1CLK] = clk;
 
 	clk = clk_reg_prcmu_gate("per2clk", NULL, PRCMU_PER2CLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_PER2CLK] = clk;
 
 	clk = clk_reg_prcmu_gate("per3clk", NULL, PRCMU_PER3CLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_PER3CLK] = clk;
 
 	clk = clk_reg_prcmu_gate("per5clk", NULL, PRCMU_PER5CLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_PER5CLK] = clk;
 
 	clk = clk_reg_prcmu_gate("per6clk", NULL, PRCMU_PER6CLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_PER6CLK] = clk;
 
 	clk = clk_reg_prcmu_gate("per7clk", NULL, PRCMU_PER7CLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_PER7CLK] = clk;
 
 	clk = clk_reg_prcmu_scalable("lcdclk", NULL, PRCMU_LCDCLK, 0,
 				CLK_IS_ROOT|CLK_SET_RATE_GATE);
+	prcmu_clk[PRCMU_LCDCLK] = clk;
 
 	clk = clk_reg_prcmu_opp_gate("bmlclk", NULL, PRCMU_BMLCLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_BMLCLK] = clk;
 
 	clk = clk_reg_prcmu_scalable("hsitxclk", NULL, PRCMU_HSITXCLK, 0,
 				CLK_IS_ROOT|CLK_SET_RATE_GATE);
+	prcmu_clk[PRCMU_HSITXCLK] = clk;
 
 	clk = clk_reg_prcmu_scalable("hsirxclk", NULL, PRCMU_HSIRXCLK, 0,
 				CLK_IS_ROOT|CLK_SET_RATE_GATE);
+	prcmu_clk[PRCMU_HSIRXCLK] = clk;
 
 	clk = clk_reg_prcmu_scalable("hdmiclk", NULL, PRCMU_HDMICLK, 0,
 				CLK_IS_ROOT|CLK_SET_RATE_GATE);
+	prcmu_clk[PRCMU_HDMICLK] = clk;
 
 	clk = clk_reg_prcmu_gate("apeatclk", NULL, PRCMU_APEATCLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_APEATCLK] = clk;
 
 	clk = clk_reg_prcmu_gate("apetraceclk", NULL, PRCMU_APETRACECLK,
 				CLK_IS_ROOT);
+	prcmu_clk[PRCMU_APETRACECLK] = clk;
 
 	clk = clk_reg_prcmu_gate("mcdeclk", NULL, PRCMU_MCDECLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_MCDECLK] = clk;
 
 	clk = clk_reg_prcmu_opp_gate("ipi2cclk", NULL, PRCMU_IPI2CCLK,
 				CLK_IS_ROOT);
+	prcmu_clk[PRCMU_IPI2CCLK] = clk;
 
 	clk = clk_reg_prcmu_gate("dsialtclk", NULL, PRCMU_DSIALTCLK,
 				CLK_IS_ROOT);
+	prcmu_clk[PRCMU_DSIALTCLK] = clk;
 
 	clk = clk_reg_prcmu_gate("dmaclk", NULL, PRCMU_DMACLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_DMACLK] = clk;
 
 	clk = clk_reg_prcmu_gate("b2r2clk", NULL, PRCMU_B2R2CLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_B2R2CLK] = clk;
 
 	clk = clk_reg_prcmu_scalable("tvclk", NULL, PRCMU_TVCLK, 0,
 				CLK_IS_ROOT|CLK_SET_RATE_GATE);
+	prcmu_clk[PRCMU_TVCLK] = clk;
 
 	clk = clk_reg_prcmu_gate("sspclk", NULL, PRCMU_SSPCLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_SSPCLK] = clk;
 
 	clk = clk_reg_prcmu_gate("rngclk", NULL, PRCMU_RNGCLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_RNGCLK] = clk;
 
 	clk = clk_reg_prcmu_gate("uiccclk", NULL, PRCMU_UICCCLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_UICCCLK] = clk;
 
 	clk = clk_reg_prcmu_gate("timclk", NULL, PRCMU_TIMCLK, CLK_IS_ROOT);
+	prcmu_clk[PRCMU_TIMCLK] = clk;
 
 	clk = clk_reg_prcmu_opp_volt_scalable("sdmmcclk", NULL, PRCMU_SDMMCCLK,
 					100000000,
 					CLK_IS_ROOT|CLK_SET_RATE_GATE);
+	prcmu_clk[PRCMU_SDMMCCLK] = clk;
 
 	clk = clk_reg_prcmu_scalable("dsi_pll", "hdmiclk",
 				PRCMU_PLLDSI, 0, CLK_SET_RATE_GATE);
-
+	prcmu_clk[PRCMU_PLLDSI] = clk;
 
 	clk = clk_reg_prcmu_scalable("dsi0clk", "dsi_pll",
 				PRCMU_DSI0CLK, 0, CLK_SET_RATE_GATE);
+	prcmu_clk[PRCMU_DSI0CLK] = clk;
 
 	clk = clk_reg_prcmu_scalable("dsi1clk", "dsi_pll",
 				PRCMU_DSI1CLK, 0, CLK_SET_RATE_GATE);
+	prcmu_clk[PRCMU_DSI1CLK] = clk;
 
 	clk = clk_reg_prcmu_scalable("dsi0escclk", "tvclk",
 				PRCMU_DSI0ESCCLK, 0, CLK_SET_RATE_GATE);
+	prcmu_clk[PRCMU_DSI0ESCCLK] = clk;
 
 	clk = clk_reg_prcmu_scalable("dsi1escclk", "tvclk",
 				PRCMU_DSI1ESCCLK, 0, CLK_SET_RATE_GATE);
+	prcmu_clk[PRCMU_DSI1ESCCLK] = clk;
 
 	clk = clk_reg_prcmu_scalable("dsi2escclk", "tvclk",
 				PRCMU_DSI2ESCCLK, 0, CLK_SET_RATE_GATE);
+	prcmu_clk[PRCMU_DSI2ESCCLK] = clk;
 
 	clk = clk_reg_prcmu_scalable_rate("armss", NULL,
 				PRCMU_ARMSS, 0, CLK_IS_ROOT|CLK_IGNORE_UNUSED);
@@ -417,6 +457,12 @@ void u8500_of_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base,
 			clkrst6_base, BIT(0), CLK_SET_RATE_GATE);
 
 	for_each_child_of_node(np, child) {
-		/* Place holder for supported nodes. */
+		static struct clk_onecell_data clk_data;
+
+		if (!of_node_cmp(child->name, "prcmu-clock")) {
+			clk_data.clks = prcmu_clk;
+			clk_data.clk_num = ARRAY_SIZE(prcmu_clk);
+			of_clk_add_provider(child, of_clk_src_onecell_get, &clk_data);
+		}
 	}
 }
-- 
1.8.1.2

  parent reply	other threads:[~2013-09-18 12:14 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-18 12:13 [PATCH v2 00/41] Enable common clock with Device Tree on ux500 platforms Lee Jones
2013-09-18 12:13 ` [PATCH 01/41] mfd: dbx500-prcmu: Correctly reorder PRCMU clock identifiers Lee Jones
2013-09-18 12:23   ` Linus Walleij
2013-09-18 12:13 ` [PATCH 02/41] mfd: dbx500-prcmu: Move PRCMU numerical clock identifiers into DT include file Lee Jones
2013-09-18 12:24   ` Linus Walleij
2013-09-18 12:14 ` [PATCH 03/41] mfd: dbx500: Remove any mention of the BML8580CLK Lee Jones
2013-09-18 12:14 ` [PATCH 04/41] ARM: ux500: Add PRCMU clock node to DBx500 Device Tree Lee Jones
2013-09-18 12:14 ` [PATCH 05/41] ARM: ux500: Supply the DMA clock lookup to the DBX500 DT Lee Jones
2013-09-18 12:14 ` [PATCH 06/41] ARM: ux500: Add PRCC Peripheral clock node to DBx500 Device Tree Lee Jones
2013-09-18 12:14 ` [PATCH 07/41] ARM: ux500: Supply the GPIO clocks lookup to the DBX500 DT Lee Jones
2013-09-18 12:14 ` [PATCH 08/41] ARM: ux500: Supply the USB clock " Lee Jones
2013-09-18 12:14 ` [PATCH 09/41] ARM: ux500: Supply the Ethernet clock lookup to Snowball's DT Lee Jones
2013-09-18 12:14 ` [PATCH 10/41] ARM: ux500: Add PRCC Kernel clock node to DBx500 Device Tree Lee Jones
2013-09-18 12:14 ` [PATCH 11/41] ARM: ux500: Supply the I2C clocks lookup to the DBX500 DT Lee Jones
2013-09-18 12:14 ` [PATCH 12/41] ARM: ux500: Supply the UART " Lee Jones
2013-09-18 12:14 ` [PATCH 13/41] ARM: ux500: Supply the SDI (MMC) " Lee Jones
2013-09-18 12:14 ` [PATCH 14/41] ARM: ux500: Supply the MSP (Audio) " Lee Jones
2013-09-18 12:14 ` [PATCH 15/41] ARM: ux500: Add RTC (fixed-frequency) clock node to DBx500 Device Tree Lee Jones
2013-09-18 12:14 ` [PATCH 16/41] ARM: ux500: Supply the RTC clock lookup to the DBX500 DT Lee Jones
2013-09-18 12:14 ` [PATCH 17/41] ARM: ux500: Add TWD (fixed-factor) clock node to DBx500 Device Tree Lee Jones
2013-09-18 12:14 ` [PATCH 18/41] ARM: ux500: Supply the TWD Timer clock lookup to the DBX500 DT Lee Jones
2013-09-18 12:14 ` [PATCH 19/41] ARM: ux500: Add a DT node for the Nomadik System Timer (MTU0) Lee Jones
2013-09-18 12:14 ` [PATCH 20/41] ARM: ux500: Don't attempt to enable the Nomadik System Timer twice Lee Jones
2013-09-18 12:14 ` [PATCH 21/41] clk: ux500: Remove BML8580 clock Lee Jones
2013-09-18 12:14 ` [PATCH 22/41] clk: ux500: Copy u8500_clk_init() ready for DT enablement Lee Jones
2013-09-19 12:31   ` Lee Jones
2013-09-20 20:59   ` Linus Walleij
2013-12-13  1:51     ` Mike Turquette
2013-12-19 20:15       ` Ulf Hansson
2013-09-18 12:14 ` [PATCH 23/41] clk: ux500: Provide u8500_clk with skeleton Device Tree support Lee Jones
2013-09-18 12:14 ` [PATCH 24/41] clk: ux500: Add a 2-cell Device Tree parser for obtaining PRCC clocks Lee Jones
2013-09-18 12:14 ` Lee Jones [this message]
2013-09-18 12:14 ` [PATCH 26/41] clk: ux500: Add Device Tree support for the PRCC Peripheral clock Lee Jones
2013-09-18 12:14 ` [PATCH 27/41] clk: ux500: Add Device Tree support for the PRCC Kernel clock Lee Jones
2013-09-18 12:14 ` [PATCH 28/41] clk: ux500: Add Device Tree support for the RTC clock Lee Jones
2013-09-18 12:14 ` [PATCH 29/41] clk: ux500: Add Device Tree support for the TWD clock Lee Jones
2013-09-18 12:14 ` [PATCH 30/41] usb: musb: ux500: Don't supply a con_id when requesting the clock Lee Jones
2013-09-20 20:41   ` Linus Walleij
2013-09-23 20:43   ` Felipe Balbi
2013-09-18 12:14 ` [PATCH 31/41] ARM: ux500: Call appropriate clock initialisation based on DT or !DT booting Lee Jones
2013-09-18 12:14 ` [PATCH 32/41] ARM: ux500: Remove AUXDATA relating to GPIO clock-name bindings Lee Jones
2013-09-18 12:14 ` [PATCH 33/41] ARM: ux500: Remove AUXDATA relating to UART " Lee Jones
2013-09-18 12:14 ` [PATCH 34/41] ARM: ux500: Remove AUXDATA relating to I2C " Lee Jones
2013-09-18 12:14 ` [PATCH 35/41] ARM: ux500: Relocate AUXDATA relating to MSP (Audio) Lee Jones
2013-09-18 12:14 ` [PATCH 36/41] ARM: ux500: Remove AUXDATA relating to USB clock-name bindings Lee Jones
2013-09-18 12:14 ` [PATCH 37/41] ARM: ux500: Remove AUXDATA relating to Ethernet " Lee Jones
2013-09-18 12:14 ` [PATCH 38/41] ARM: ux500: Remove AUXDATA relating to DMA " Lee Jones
2013-09-18 12:14 ` [PATCH 39/41] ARM: ux500: Reclassify PRCMU AUXDATA entry Lee Jones
2013-09-18 12:14 ` [PATCH 40/41] ARM: ux500: Remove SSP AUXDATA pertaining to DMA bindings Lee Jones
2013-09-18 12:14 ` [PATCH 41/41] ARM: ux500: Fix trivial whitespace/tabbing issue Lee Jones

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=1379506478-16625-26-git-send-email-lee.jones@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).