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 06/49] clk: add support for low level register ops
Date: Fri, 20 Dec 2013 13:17:27 +0200 [thread overview]
Message-ID: <52B42747.8090408@ti.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1312201056560.20802@utopia.booyaka.com>
On 12/20/2013 01:00 PM, Paul Walmsley wrote:
> On Thu, 19 Dec 2013, Tero Kristo wrote:
>
>> Low level register ops are needed for providing SoC or IP block specific
>> access routines to clock registers. Subsequent patches add support for
>> the low level ops for the individual clock drivers.
>>
>> Signed-off-by: Tero Kristo <t-kristo@ti.com>
>
> ...
>
>> ---
>> drivers/clk/clk.c | 28 ++++++++++++++++++++++++++++
>> include/linux/clk-provider.h | 13 +++++++++++++
>> 2 files changed, 41 insertions(+)
>>
>> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
>> index 29281f6..23a742b 100644
>> --- a/drivers/clk/clk.c
>> +++ b/drivers/clk/clk.c
>> @@ -34,6 +34,34 @@ static HLIST_HEAD(clk_root_list);
>> static HLIST_HEAD(clk_orphan_list);
>> static LIST_HEAD(clk_notifier_list);
>>
>> +/**
>> + * clk_readl_default - default clock register read support function
>> + * @reg: register to read
>> + *
>> + * Default implementation for reading a clock register.
>> + */
>> +static u32 clk_readl_default(u32 __iomem *reg)
>
> Why u32 __iomem rather than void *? Not that this will affect OMAP, but
> will this need to be changed later to support 64-bit addresses?
> __raw_writel() and __raw_readl() are defined with "void __iomem *" as
> their address argument, which will be 64 bits on arm64, correct?
Just copy pasting the current implementation from the clk-provider.h file.
However, pointer is pointer no? This is just used to refer to a 32bit
value, the pointer itself can be either 32bit or 64bit. If the registers
are changed to be 64 bit though.... but that will require changing most
of the clock code as it is littered with 'u32 val;' type declarations.
Anyway, I can change this to be void __iomem.
>
>> +{
>> + return readl(reg);
>> +}
>> +
>> +/**
>> + * clk_writel_default - default clock register write support function
>> + * @val: value to write
>> + * @reg: register to write to
>> + *
>> + * Default implementation for writing a clock register.
>> + */
>> +static void clk_writel_default(u32 val, u32 __iomem *reg)
>
> Same question as the above.
>
>> +{
>> + writel(val, reg);
>> +}
>> +
>> +struct clk_ll_ops clk_ll_ops_default = {
>> + .clk_readl = clk_readl_default,
>> + .clk_writel = clk_writel_default
>> +};
>> +
>> /*** locking ***/
>> static void clk_prepare_lock(void)
>> {
>> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
>> index 27a9765..cc5bee0 100644
>> --- a/include/linux/clk-provider.h
>> +++ b/include/linux/clk-provider.h
>> @@ -199,6 +199,24 @@ struct clk_hw {
>> const struct clk_init_data *init;
>> };
>>
>> +/**
>> + * struct clk_ll_ops - low-level register access ops for a clock
>> + *
>> + * @clk_readl: pointer to register read function
>
> Please remove the blank line above as mentioned before.
Yea I just copy pasted the comment sections....
>
>> + * @clk_writel: pointer to register write function
>> + *
>> + * Low-level register access ops are generally used by the basic clock types
>> + * (clk-gate, clk-mux, clk-divider etc.) to provide support for various
>> + * low-level hardware interfaces (direct MMIO, regmap etc.), but can also be
>> + * used by other hardware-specific clock drivers if needed.
>> + */
>> +struct clk_ll_ops {
>> + u32 (*clk_readl)(u32 __iomem *reg);
>> + void (*clk_writel)(u32 val, u32 __iomem *reg);
>> +};
>> +
>> +extern struct clk_ll_ops clk_ll_ops_default;
>> +
>> /*
>> * DOC: Basic clock implementations common to many platforms
>> *
>> --
>> 1.7.9.5
>>
>
>
> - Paul
>
next prev parent reply other threads:[~2013-12-20 11:17 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
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 [this message]
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
[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
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: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=52B42747.8090408@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).