linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Claudiu.Beznea@microchip.com>
To: <alexandre.belloni@bootlin.com>
Cc: <mturquette@baylibre.com>, <sboyd@kernel.org>,
	<robh+dt@kernel.org>, <mark.rutland@arm.com>,
	<Nicolas.Ferre@microchip.com>, <Ludovic.Desroches@microchip.com>,
	<linux-clk@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] clk: at91: sckc: add support for SAM9X60
Date: Tue, 19 Feb 2019 09:17:43 +0000	[thread overview]
Message-ID: <c00fb195-1688-6ac4-a606-5e08509a2c39@microchip.com> (raw)
In-Reply-To: <20190218212007.GW10129@piout.net>



On 18.02.2019 23:20, Alexandre Belloni wrote:
> On 14/02/2019 12:14:32+0000, Claudiu.Beznea@microchip.com wrote:
>> From: Claudiu Beznea <claudiu.beznea@microchip.com>
>>
>> Add support for SAM9X60.
>>
>> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
>> ---
>>  drivers/clk/at91/sckc.c | 30 ++++++++++++++++++++++++++++++
>>  1 file changed, 30 insertions(+)
>>
>> diff --git a/drivers/clk/at91/sckc.c b/drivers/clk/at91/sckc.c
>> index b7163d3a2269..b3075c51d260 100644
>> --- a/drivers/clk/at91/sckc.c
>> +++ b/drivers/clk/at91/sckc.c
>> @@ -459,6 +459,36 @@ static void __init of_at91sam9x5_sckc_setup(struct device_node *np)
>>  CLK_OF_DECLARE(at91sam9x5_clk_sckc, "atmel,at91sam9x5-sckc",
>>  	       of_at91sam9x5_sckc_setup);
>>  
>> +static const struct clk_slow_offsets at91sam9x60_offsets = {
>> +	.cr_rcen = AT91_SCKC_OFFSET_INVALID,
>> +	.cr_osc32en = 1,
>> +	.cr_osc32byp = 2,
>> +	.cr_oscsel = 24,
>> +};
>> +
>> +static void __init of_at91sam9x60_sckc_setup(struct device_node *np)
>> +{
>> +	struct device_node *childnp;
>> +	void (*clk_setup)(struct device_node *np, void __iomem *io,
>> +			  const struct clk_slow_offsets *offsets);
>> +	const struct of_device_id *clk_id;
>> +	void __iomem *regbase = of_iomap(np, 0);
>> +
>> +	if (!regbase)
>> +		return;
>> +
>> +	for_each_child_of_node(np, childnp) {
>> +		clk_id = of_match_node(sckc_clk_ids, childnp);
>> +		if (!clk_id)
>> +			continue;
>> +		clk_setup = clk_id->data;
>> +		clk_setup(childnp, regbase, &at91sam9x60_offsets);
>> +	}
> 
> You actually need to have new bindings. The sam9x60 registration should
> look more like the sama5d4 registration. I have a rework for the sam9x5
> sckc that I will send this week to have a proper binding (i.e: no
> children).

Does this means that this would also solve the problem I tried to address
with this patch?

> 
> However, there is a fundamental change in the sam9x60, previously, the
> sckc had only one output clock. the sam9x60 has both td_slck and
> md_slck. Both need to be accessible because they are input to the PMC.

I was guided by the fact that md_slck is generated by the always on slow RC
oscillator (part of slow clock controller) and since there is no control
for it on slow clock controller there is no need to be described by this
driver.

> 
> This means you will have to register the sckc with of_clk_hw_onecell_get
> as the get callback.

Ok, I'll look into it.

> 
> We could still decide to do the same with sam9x5 even if it has only one
> output clock.
> 

  reply	other threads:[~2019-02-19  9:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 12:14 [PATCH v2 0/3] add slow clock support for SAM9X60 Claudiu.Beznea
2019-02-14 12:14 ` [PATCH v2 1/3] clk: at91: sckc: add support to specify registers bit offsets Claudiu.Beznea
2019-02-18 21:08   ` Alexandre Belloni
2019-02-19  9:17     ` Claudiu.Beznea
2019-02-14 12:14 ` [PATCH v2 2/3] clk: at91: sckc: add support for SAM9X60 Claudiu.Beznea
2019-02-18 21:20   ` Alexandre Belloni
2019-02-19  9:17     ` Claudiu.Beznea [this message]
2019-02-20 11:06       ` Alexandre Belloni
2019-02-14 12:14 ` [PATCH v2 3/3] dt-bindings: clk: at91: add bindings for SAM9X60's slow clock controller Claudiu.Beznea
2019-02-18 20:04   ` Rob Herring

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=c00fb195-1688-6ac4-a606-5e08509a2c39@microchip.com \
    --to=claudiu.beznea@microchip.com \
    --cc=Ludovic.Desroches@microchip.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.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).