From: Tero Kristo <t-kristo@ti.com>
To: Paul Walmsley <paul@pwsan.com>
Cc: linux-omap@vger.kernel.org, tony@atomide.com, nm@ti.com,
rnayak@ti.com, bcousson@baylibre.com, mturquette@linaro.org,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org
Subject: Re: [PATCHv11 43/49] ARM: OMAP2+: PRM: add support for initializing PRCM clock modules from DT
Date: Fri, 20 Dec 2013 15:12:42 +0200 [thread overview]
Message-ID: <52B4424A.8040003@ti.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1312201147060.20802@utopia.booyaka.com>
On 12/20/2013 01:49 PM, Paul Walmsley wrote:
> On Thu, 19 Dec 2013, Tero Kristo wrote:
>
>> This patch provides top level functionality for the DT clock initialization.
>> Clock tree is initialized hierarchically starting from IP modules (CM/PRM/PRCM)
>> going down towards individual clock nodes, and finally initializing
>> clockdomains once all the clocks are ready.
>
> So just to flag this as something we'll want to deal with later.
> The low-level CM* drivers should be responsible for registering CM* clocks
> and clockdomains. Similarly the PRM* low-level drivers should only
> register PRM* clocks and clockdomains. But it looks to me like we can
> rearrange this code later without any significant impact, unless you
> foresee any issues with that? If not, in the interests of expediency,
> let's take that up in future patches.
Yeah, this can be split under cm/prm later on once we implement proper
drivers for each block. DT data won't be changed, just kernel side
implementation will be modified, and this modification is relatively
simple to do also.
-Tero
>
>
> - Paul
>
>>
>> Signed-off-by: Tero Kristo <t-kristo@ti.com>
>> ---
>> arch/arm/mach-omap2/prm.h | 1 +
>> arch/arm/mach-omap2/prm_common.c | 66 ++++++++++++++++++++++++++++++++++++++
>> 2 files changed, 67 insertions(+)
>>
>> diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
>> index ac25ae6..623db40 100644
>> --- a/arch/arm/mach-omap2/prm.h
>> +++ b/arch/arm/mach-omap2/prm.h
>> @@ -18,6 +18,7 @@
>> # ifndef __ASSEMBLER__
>> extern void __iomem *prm_base;
>> extern void omap2_set_globals_prm(void __iomem *prm);
>> +int of_prcm_init(void);
>> # endif
>>
>>
>> diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
>> index a2e1174..835eb7d 100644
>> --- a/arch/arm/mach-omap2/prm_common.c
>> +++ b/arch/arm/mach-omap2/prm_common.c
>> @@ -23,6 +23,10 @@
>> #include <linux/irq.h>
>> #include <linux/interrupt.h>
>> #include <linux/slab.h>
>> +#include <linux/of.h>
>> +#include <linux/of_address.h>
>> +#include <linux/clk-provider.h>
>> +#include <linux/clk/ti.h>
>>
>> #include "soc.h"
>> #include "prm2xxx_3xxx.h"
>> @@ -30,6 +34,7 @@
>> #include "prm3xxx.h"
>> #include "prm44xx.h"
>> #include "common.h"
>> +#include "clock.h"
>>
>> /*
>> * OMAP_PRCM_MAX_NR_PENDING_REG: maximum number of PRM_IRQ*_MPU regs
>> @@ -464,3 +469,64 @@ int prm_unregister(struct prm_ll_data *pld)
>>
>> return 0;
>> }
>> +
>> +static struct of_device_id omap_prcm_dt_match_table[] = {
>> + { .compatible = "ti,am3-prcm" },
>> + { .compatible = "ti,am3-scrm" },
>> + { .compatible = "ti,am4-prcm" },
>> + { .compatible = "ti,am4-scrm" },
>> + { .compatible = "ti,omap3-prm" },
>> + { .compatible = "ti,omap3-cm" },
>> + { .compatible = "ti,omap3-scrm" },
>> + { .compatible = "ti,omap4-cm1" },
>> + { .compatible = "ti,omap4-prm" },
>> + { .compatible = "ti,omap4-cm2" },
>> + { .compatible = "ti,omap4-scrm" },
>> + { .compatible = "ti,omap5-prm" },
>> + { .compatible = "ti,omap5-cm-core-aon" },
>> + { .compatible = "ti,omap5-scrm" },
>> + { .compatible = "ti,omap5-cm-core" },
>> + { .compatible = "ti,dra7-prm" },
>> + { .compatible = "ti,dra7-cm-core-aon" },
>> + { .compatible = "ti,dra7-cm-core" },
>> + { }
>> +};
>> +
>> +static struct clk_hw_omap memmap_dummy_ck = {
>> + .flags = MEMMAP_ADDRESSING,
>> +};
>> +
>> +static u32 prm_clk_readl(u32 *reg)
>> +{
>> + return omap2_clk_readl(&memmap_dummy_ck, reg);
>> +}
>> +
>> +static void prm_clk_writel(u32 val, u32 *reg)
>> +{
>> + omap2_clk_writel(val, &memmap_dummy_ck, reg);
>> +}
>> +
>> +static struct clk_ll_ops omap_clk_ll_ops = {
>> + .clk_readl = prm_clk_readl,
>> + .clk_writel = prm_clk_writel,
>> +};
>> +
>> +int __init of_prcm_init(void)
>> +{
>> + struct device_node *np;
>> + void __iomem *mem;
>> + int memmap_index = 0;
>> +
>> + ti_clk_ll_ops = &omap_clk_ll_ops;
>> +
>> + for_each_matching_node(np, omap_prcm_dt_match_table) {
>> + mem = of_iomap(np, 0);
>> + clk_memmaps[memmap_index] = mem;
>> + ti_dt_clk_init_provider(np, memmap_index);
>> + memmap_index++;
>> + }
>> +
>> + ti_dt_clockdomains_setup();
>> +
>> + return 0;
>> +}
>> --
>> 1.7.9.5
>>
>
>
> - Paul
>
next prev parent reply other threads:[~2013-12-20 13:13 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-19 11:23 [PATCHv11 00/49] ARM: TI SoC clock DT conversion Tero Kristo
2013-12-19 11:23 ` [PATCHv11 01/49] clk: add support for registering clocks from description Tero Kristo
2013-12-20 10:53 ` Paul Walmsley
2013-12-20 13:14 ` Tero Kristo
[not found] ` <1387452260-23276-1-git-send-email-t-kristo-l0cyMroinI0@public.gmane.org>
2013-12-19 11:23 ` [PATCHv11 02/49] clk: fixed-rate: add support for registering fixed-rate clock from descriptor Tero Kristo
2013-12-19 11:23 ` [PATCHv11 26/49] CLK: TI: add interface clock support for OMAP3 Tero Kristo
2013-12-19 11:23 ` [PATCHv11 28/49] CLK: TI: add am43xx clock init file Tero Kristo
2013-12-19 11:24 ` [PATCHv11 29/49] ARM: dts: omap4 clock data Tero Kristo
2013-12-19 11:24 ` [PATCHv11 38/49] ARM: dts: am43xx " Tero Kristo
2013-12-19 11:24 ` [PATCHv11 41/49] ARM: OMAP: hwmod: fix an incorrect clk type cast with _get_clkdm Tero Kristo
2013-12-19 11:24 ` [PATCHv11 42/49] ARM: OMAP3: hwmod: initialize clkdm from clkdm_name Tero Kristo
2013-12-19 11:24 ` [PATCHv11 43/49] ARM: OMAP2+: PRM: add support for initializing PRCM clock modules from DT Tero Kristo
2013-12-20 11:49 ` Paul Walmsley
2013-12-20 13:12 ` Tero Kristo [this message]
2013-12-19 11:24 ` [PATCHv11 44/49] ARM: OMAP2+: io: use new clock init API Tero Kristo
2013-12-19 11:24 ` [PATCHv11 46/49] ARM: OMAP: DRA7: Enable clock init Tero Kristo
2013-12-19 11:24 ` [PATCHv11 47/49] ARM: AM43xx: " Tero Kristo
2013-12-19 11:23 ` [PATCHv11 03/49] clk: divider: add support for registering divider clock from descriptor Tero Kristo
2013-12-20 10:54 ` Paul Walmsley
2013-12-19 11:23 ` [PATCHv11 04/49] clk: mux: add support for registering mux " Tero Kristo
2013-12-20 10:55 ` Paul Walmsley
2013-12-19 11:23 ` [PATCHv11 05/49] clk: gate: add support for registering gate " Tero Kristo
2013-12-20 10:56 ` Paul Walmsley
2013-12-19 11:23 ` [PATCHv11 06/49] clk: add support for low level register ops Tero Kristo
2013-12-20 11:00 ` Paul Walmsley
2013-12-20 11:17 ` Tero Kristo
2013-12-20 16:09 ` Paul Walmsley
2013-12-19 11:23 ` [PATCHv11 07/49] clk: divider: add support for low level ops Tero Kristo
2013-12-19 18:26 ` Tony Lindgren
2013-12-19 19:02 ` Tero Kristo
2013-12-20 10:07 ` Rajendra Nayak
2013-12-20 10:29 ` Tero Kristo
2013-12-20 10:39 ` Rajendra Nayak
2013-12-20 16:16 ` Tony Lindgren
2013-12-20 16:33 ` Tero Kristo
2013-12-19 11:23 ` [PATCHv11 08/49] clk: gate: " Tero Kristo
2013-12-19 11:23 ` [PATCHv11 09/49] clk: mux: " Tero Kristo
2013-12-19 11:23 ` [PATCHv11 10/49] CLK: TI: add DT alias clock registration mechanism Tero Kristo
2013-12-19 11:23 ` [PATCHv11 11/49] CLK: ti: add init support for clock IP blocks Tero Kristo
2013-12-19 11:23 ` [PATCHv11 12/49] CLK: TI: Add DPLL clock support Tero Kristo
2013-12-19 11:23 ` [PATCHv11 13/49] CLK: TI: add autoidle support Tero Kristo
2013-12-19 11:23 ` [PATCHv11 14/49] clk: ti: add composite clock support Tero Kristo
2013-12-19 11:23 ` [PATCHv11 15/49] CLK: ti: add support for ti divider-clock Tero Kristo
2013-12-19 11:23 ` [PATCHv11 16/49] clk: ti: add support for TI fixed factor clock Tero Kristo
2013-12-19 11:23 ` [PATCHv11 17/49] CLK: TI: add support for gate clock Tero Kristo
2013-12-19 11:23 ` [PATCHv11 18/49] CLK: TI: add support for clockdomain binding Tero Kristo
2013-12-20 11:46 ` Paul Walmsley
2013-12-19 11:23 ` [PATCHv11 19/49] clk: ti: add support for basic mux clock Tero Kristo
2013-12-19 11:23 ` [PATCHv11 20/49] CLK: TI: add omap4 clock init file Tero Kristo
2013-12-19 11:23 ` [PATCHv11 21/49] CLK: TI: add omap5 " Tero Kristo
2013-12-19 11:23 ` [PATCHv11 22/49] CLK: TI: omap5: Initialize USB_DPLL at boot Tero Kristo
2013-12-19 11:23 ` [PATCHv11 23/49] CLK: TI: DRA7: Add APLL support Tero Kristo
2013-12-19 11:23 ` [PATCHv11 24/49] CLK: TI: add dra7 clock init file Tero Kristo
2013-12-19 11:23 ` [PATCHv11 25/49] CLK: TI: add am33xx " Tero Kristo
2013-12-19 11:23 ` [PATCHv11 27/49] CLK: TI: add omap3 " Tero Kristo
2013-12-19 11:24 ` [PATCHv11 30/49] ARM: dts: omap5 clock data Tero Kristo
2013-12-19 11:24 ` [PATCHv11 31/49] ARM: dts: dra7 " Tero Kristo
2013-12-19 11:24 ` [PATCHv11 32/49] ARM: dts: clk: Add apll related clocks Tero Kristo
2013-12-19 11:24 ` [PATCHv11 33/49] ARM: dts: DRA7: Change apll_pcie_m2_ck to fixed factor clock Tero Kristo
2013-12-19 11:24 ` [PATCHv11 34/49] ARM: dts: DRA7: Add PCIe related clock nodes Tero Kristo
2013-12-19 11:24 ` [PATCHv11 35/49] ARM: dts: am33xx clock data Tero Kristo
2013-12-19 11:24 ` [PATCHv11 36/49] ARM: dts: omap3 " Tero Kristo
2013-12-19 11:24 ` [PATCHv11 37/49] ARM: dts: AM35xx: use DT " Tero Kristo
2013-12-19 11:24 ` [PATCHv11 39/49] ARM: OMAP2+: clock: add support for indexed memmaps Tero Kristo
2013-12-19 11:24 ` [PATCHv11 40/49] ARM: OMAP2+: clock: use driver API instead of direct memory read/write Tero Kristo
2013-12-19 11:24 ` [PATCHv11 45/49] ARM: OMAP4: remove old clock data and link in new clock init code Tero Kristo
2013-12-19 11:24 ` [PATCHv11 48/49] ARM: AM33xx: " Tero Kristo
2013-12-19 11:24 ` [PATCHv11 49/49] ARM: OMAP3: use DT clock init if DT data is available Tero Kristo
2013-12-19 15:07 ` [PATCHv11 00/49] ARM: TI SoC clock DT conversion Nishanth Menon
2013-12-19 18:05 ` Tony Lindgren
2013-12-20 6:52 ` Keerthy
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=52B4424A.8040003@ti.com \
--to=t-kristo@ti.com \
--cc=bcousson@baylibre.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=nm@ti.com \
--cc=paul@pwsan.com \
--cc=rnayak@ti.com \
--cc=tony@atomide.com \
/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).