All of lore.kernel.org
 help / color / mirror / Atom feed
From: Priit Laes <plaes@plaes.org>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-clk@vger.kernel.org, linux-sunxi@googlegroups.com,
	Icenowy Zheng <icenowy@aosc.xyz>,
	Russell King <linux@armlinux.org.uk>,
	Chen-Yu Tsai <wens@csie.org>, Mark Rutland <mark.rutland@arm.com>,
	Rob Herring <robh+dt@kernel.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Philipp Zabel <p.zabel@pengutronix.de>
Subject: Re: [linux-sunxi] Re: [PATCH v2 1/6] clk: sunxi-ng: Add sun4i/sun7i CCU driver
Date: Thu, 20 Apr 2017 19:59:17 +0000	[thread overview]
Message-ID: <20170420195917.GA16113@plaes.org> (raw)
In-Reply-To: <20170407133805.aiythp3hdvuyhcrc@lukather>

On Fri, Apr 07, 2017 at 03:38:05PM +0200, Maxime Ripard wrote:
> Hi Priit,
> 
> On Tue, Apr 04, 2017 at 08:09:19PM +0000, Priit Laes wrote:
> > > > +/* Not documented on A10 */
> > > > +static SUNXI_CCU_GATE(pll_periph_sata_clk, "pll-periph-sata", "pll-periph",
> > > > +		      0x028, BIT(14), 0);
> > > 
> > > The rate doesn't come from pll-periph directly, does it?
> > 
> > So it uses hosc (24MHz parent clock) instead of pll-periph?
> 
> I never looked too much at this, but it looks more like the input is
> pll-periph-sata itself.

OK, I think I have now fixed most of the issues thanks to Maxime and Chen-Yu
and I'm almost ready to send out V3.

>From my side there is only single issue remaining - how to create "sata-ext"
clock?

[snip]
static struct ccu_div pll_periph_sata_clk = {
	.enable		= BIT(14),
	.div		= _SUNXI_CCU_DIV(0, 2),
	.common		= {
		.prediv		= 6,
		.reg		= 0x028,
		.features	= CCU_FEATURE_ALL_PREDIV,
		.hw.init	= CLK_HW_INIT("pll-periph-sata",
					      "pll-periph-base",
					      &ccu_nk_ops, 0),
	},
};

static const char* const sata_parents[] = {"pll-periph-sata", "sata-ext"};
static SUNXI_CCU_MUX_WITH_GATE(sata_clk, "sata", sata_parents,
			       0x0c8, 24, 1, BIT(31), 0);
[/snip]

Should I create a fixed-clock node in the dtsi:

sata-ext: clk@0 {
	#clock-cells = <0>;
	compatible = "fixed-clock";
	clock-frequency = <200000000>;
	clock-output-names = "sata-ext";
};

And would it also need pio definition?

Päikest,
Priit :)

WARNING: multiple messages have this Message-ID (diff)
From: Priit Laes <plaes-q/aMd4JkU83YtjvyW6yDsg@public.gmane.org>
To: Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	Icenowy Zheng <icenowy-ymACFijhrKM@public.gmane.org>,
	Russell King <linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>,
	Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Michael Turquette
	<mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>,
	Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Subject: Re: Re: [PATCH v2 1/6] clk: sunxi-ng: Add sun4i/sun7i CCU driver
Date: Thu, 20 Apr 2017 19:59:17 +0000	[thread overview]
Message-ID: <20170420195917.GA16113@plaes.org> (raw)
In-Reply-To: <20170407133805.aiythp3hdvuyhcrc@lukather>

On Fri, Apr 07, 2017 at 03:38:05PM +0200, Maxime Ripard wrote:
> Hi Priit,
> 
> On Tue, Apr 04, 2017 at 08:09:19PM +0000, Priit Laes wrote:
> > > > +/* Not documented on A10 */
> > > > +static SUNXI_CCU_GATE(pll_periph_sata_clk, "pll-periph-sata", "pll-periph",
> > > > +		      0x028, BIT(14), 0);
> > > 
> > > The rate doesn't come from pll-periph directly, does it?
> > 
> > So it uses hosc (24MHz parent clock) instead of pll-periph?
> 
> I never looked too much at this, but it looks more like the input is
> pll-periph-sata itself.

OK, I think I have now fixed most of the issues thanks to Maxime and Chen-Yu
and I'm almost ready to send out V3.

>From my side there is only single issue remaining - how to create "sata-ext"
clock?

[snip]
static struct ccu_div pll_periph_sata_clk = {
	.enable		= BIT(14),
	.div		= _SUNXI_CCU_DIV(0, 2),
	.common		= {
		.prediv		= 6,
		.reg		= 0x028,
		.features	= CCU_FEATURE_ALL_PREDIV,
		.hw.init	= CLK_HW_INIT("pll-periph-sata",
					      "pll-periph-base",
					      &ccu_nk_ops, 0),
	},
};

static const char* const sata_parents[] = {"pll-periph-sata", "sata-ext"};
static SUNXI_CCU_MUX_WITH_GATE(sata_clk, "sata", sata_parents,
			       0x0c8, 24, 1, BIT(31), 0);
[/snip]

Should I create a fixed-clock node in the dtsi:

sata-ext: clk@0 {
	#clock-cells = <0>;
	compatible = "fixed-clock";
	clock-frequency = <200000000>;
	clock-output-names = "sata-ext";
};

And would it also need pio definition?

Päikest,
Priit :)

-- 
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

WARNING: multiple messages have this Message-ID (diff)
From: plaes@plaes.org (Priit Laes)
To: linux-arm-kernel@lists.infradead.org
Subject: [linux-sunxi] Re: [PATCH v2 1/6] clk: sunxi-ng: Add sun4i/sun7i CCU driver
Date: Thu, 20 Apr 2017 19:59:17 +0000	[thread overview]
Message-ID: <20170420195917.GA16113@plaes.org> (raw)
In-Reply-To: <20170407133805.aiythp3hdvuyhcrc@lukather>

On Fri, Apr 07, 2017 at 03:38:05PM +0200, Maxime Ripard wrote:
> Hi Priit,
> 
> On Tue, Apr 04, 2017 at 08:09:19PM +0000, Priit Laes wrote:
> > > > +/* Not documented on A10 */
> > > > +static SUNXI_CCU_GATE(pll_periph_sata_clk, "pll-periph-sata", "pll-periph",
> > > > +		      0x028, BIT(14), 0);
> > > 
> > > The rate doesn't come from pll-periph directly, does it?
> > 
> > So it uses hosc (24MHz parent clock) instead of pll-periph?
> 
> I never looked too much at this, but it looks more like the input is
> pll-periph-sata itself.

OK, I think I have now fixed most of the issues thanks to Maxime and Chen-Yu
and I'm almost ready to send out V3.

>From my side there is only single issue remaining - how to create "sata-ext"
clock?

[snip]
static struct ccu_div pll_periph_sata_clk = {
	.enable		= BIT(14),
	.div		= _SUNXI_CCU_DIV(0, 2),
	.common		= {
		.prediv		= 6,
		.reg		= 0x028,
		.features	= CCU_FEATURE_ALL_PREDIV,
		.hw.init	= CLK_HW_INIT("pll-periph-sata",
					      "pll-periph-base",
					      &ccu_nk_ops, 0),
	},
};

static const char* const sata_parents[] = {"pll-periph-sata", "sata-ext"};
static SUNXI_CCU_MUX_WITH_GATE(sata_clk, "sata", sata_parents,
			       0x0c8, 24, 1, BIT(31), 0);
[/snip]

Should I create a fixed-clock node in the dtsi:

sata-ext: clk at 0 {
	#clock-cells = <0>;
	compatible = "fixed-clock";
	clock-frequency = <200000000>;
	clock-output-names = "sata-ext";
};

And would it also need pio definition?

P?ikest,
Priit :)

  reply	other threads:[~2017-04-20 19:59 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-26 17:20 [PATCH v2 0/6] ARM: sunxi: Convert sun4i/sun7i series SoCs to sunxi-ng Priit Laes
2017-03-26 17:20 ` Priit Laes
2017-03-26 17:20 ` Priit Laes
2017-03-26 17:20 ` [PATCH v2 1/6] clk: sunxi-ng: Add sun4i/sun7i CCU driver Priit Laes
2017-03-26 17:20   ` Priit Laes
2017-03-26 17:20   ` Priit Laes
2017-03-27  7:54   ` Maxime Ripard
2017-03-27  7:54     ` Maxime Ripard
2017-03-27  7:54     ` Maxime Ripard
2017-04-04 20:09     ` [linux-sunxi] " Priit Laes
2017-04-04 20:09       ` Priit Laes
2017-04-04 20:09       ` Priit Laes
2017-04-07 13:38       ` [linux-sunxi] " Maxime Ripard
2017-04-07 13:38         ` Maxime Ripard
2017-04-07 13:38         ` Maxime Ripard
2017-04-20 19:59         ` Priit Laes [this message]
2017-04-20 19:59           ` [linux-sunxi] " Priit Laes
2017-04-20 19:59           ` Priit Laes
2017-04-21  1:46           ` [linux-sunxi] " Chen-Yu Tsai
2017-04-21  1:46             ` Chen-Yu Tsai
2017-04-21  1:46             ` Chen-Yu Tsai
2017-04-22 12:33   ` [linux-sunxi] " Jonathan Liu
2017-04-22 12:33     ` Jonathan Liu
2017-04-22 12:33     ` Jonathan Liu
2017-04-22 14:46   ` [linux-sunxi] " Jonathan Liu
2017-04-22 14:46     ` Jonathan Liu
2017-04-22 14:46     ` Jonathan Liu
2017-03-26 17:20 ` [PATCH v2 2/6] ARM: sun7i: Convert to CCU Priit Laes
2017-03-26 17:20   ` Priit Laes
2017-03-26 17:20   ` Priit Laes
2017-03-26 17:20 ` [PATCH v2 3/6] ARM: sun4i: " Priit Laes
2017-03-26 17:20   ` Priit Laes
2017-03-26 17:20   ` Priit Laes
2017-12-11 22:22   ` [linux-sunxi] " Kevin Hilman
2017-12-11 22:22     ` Kevin Hilman
2017-12-11 22:22     ` Kevin Hilman
2017-12-12  6:12     ` [linux-sunxi] " Priit Laes
2017-12-12  6:12       ` Priit Laes
2017-12-12  6:12       ` Priit Laes
2017-12-12 17:26     ` [linux-sunxi] " Priit Laes
2017-12-12 17:26       ` Priit Laes
2017-12-12 17:26       ` Priit Laes
2017-12-12 21:24       ` [linux-sunxi] " Kevin Hilman
2017-12-12 21:24         ` Kevin Hilman
2017-12-13 13:44         ` Maxime Ripard
2017-12-13 13:44           ` Maxime Ripard
2017-12-13 13:44           ` Maxime Ripard
2017-12-13 17:09         ` [linux-sunxi] " Priit Laes
2017-12-13 17:09           ` Priit Laes
2017-12-13 17:09           ` Priit Laes
2017-12-13 17:13           ` [linux-sunxi] " Priit Laes
2017-12-13 17:13             ` Priit Laes
2017-12-13 19:46             ` Kevin Hilman
2017-12-13 19:46               ` Kevin Hilman
2017-12-13 19:46               ` Kevin Hilman
2018-01-05 16:10               ` [linux-sunxi] " Kevin Hilman
2018-01-05 16:10                 ` Kevin Hilman
2018-01-08  9:15                 ` Chen-Yu Tsai
2018-01-08  9:15                   ` Chen-Yu Tsai
2018-01-08  9:15                   ` Chen-Yu Tsai
2017-03-26 17:20 ` [PATCH v2 4/6] dt-bindings: List devicetree binding for the CCU of Allwinner A20 Priit Laes
2017-03-26 17:20   ` Priit Laes
2017-03-26 17:20   ` Priit Laes
2017-03-26 17:20 ` [PATCH v2 5/6] dt-bindings: List devicetree binding for the CCU of Allwinner A10 Priit Laes
2017-03-26 17:20   ` Priit Laes
2017-03-26 17:20   ` Priit Laes
2017-03-30 23:19   ` Rob Herring
2017-03-30 23:19     ` Rob Herring
2017-03-30 23:19     ` Rob Herring
2017-03-26 17:20 ` [PATCH v2 6/6] clk: sunxi-ng: Display index when clock registration fails Priit Laes
2017-03-26 17:20   ` Priit Laes
2017-03-26 17:20   ` Priit Laes

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=20170420195917.GA16113@plaes.org \
    --to=plaes@plaes.org \
    --cc=devicetree@vger.kernel.org \
    --cc=icenowy@aosc.xyz \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=wens@csie.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.