From: Priit Laes <plaes@plaes.org>
To: Olliver Schinagl <oliver@schinagl.nl>
Cc: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@codeaurora.org>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>,
Chen-Yu Tsai <wens@csie.org>,
Russell King <linux@armlinux.org.uk>,
Philipp Zabel <p.zabel@pengutronix.de>,
linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com,
Jonathan Liu <net147@gmail.com>
Subject: Re: [linux-sunxi] [PATCH v5 2/6] clk: sunxi-ng: Add sun4i/sun7i CCU driver
Date: Fri, 14 Jul 2017 13:48:54 +0000 [thread overview]
Message-ID: <20170714134854.GA7579@plaes.org> (raw)
In-Reply-To: <d178101c-bcc7-3914-481e-1edc4f5d7b60@schinagl.nl>
On Thu, Jul 13, 2017 at 09:46:57PM +0200, Olliver Schinagl wrote:
> Hey Priit,
>
> On 07/13/17 21:23, Priit Laes wrote:
> > On Mon, Jul 10, 2017 at 11:45:32AM +0200, Olliver Schinagl wrote:
> >> Hi Pleas,
> >>
> >> again, but this time with content :)
> >>
> >> On 04-07-17 22:04, Priit Laes wrote:
> >>> Introduce a clock controller driver for sun4i A10 and sun7i A20
> >>> series SoCs.
> > [ ... ]
> >
> >>> +++ b/drivers/clk/sunxi-ng/Kconfig
> >>> @@ -11,6 +11,19 @@ config SUN50I_A64_CCU
> >>> default ARM64 && ARCH_SUNXI
> >>> depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST
> >>>
> >>> +config SUNXI_A10_CCU
> >> I understand why you say sunXi here (it's support for both sun4i and sun7i)
> >> but then why A10, as it also supports the A20.
> >>
> >> I guess the CCU is identical on the A20 and the A10, right? Thus would it
> >> not be sensible to just call it sun4i_ccu (like we do for sun5i_ccu below?
> > No, it's not identical.
> But then saying SUNXI_A10_CCU is not correct? Since it is not identical
> on the A20? So what does the A10 stand for?
There's no easy way it supports both SUN4I_A10 and SUN7I_A20, therefore
I used SUNXI_A10 where SUNXI may indicate it's not only for SUN4I and
I'm currently keeping it as is...
[ ... ]
> >>> +/* Not present on A20 */
> >>> +static SUNXI_CCU_GATE(axi_dram_clk, "axi-dram", "ahb",
> >>> + 0x05c, BIT(31), 0);
> >> Same here I guess, two defines make this a bit more readable.
> > You mean SUN4I_CCU_GATE? and SUN7I_CCU_GATE defines?
> > I don't think it makes things more readable...
> you think 0x05c and BIT(31) are easier to read? I'll do a pop quiz in 6
> months from now and see if you remember :p
Can you give an example on how it should be written?
> >
> >>> +
> >>> +static SUNXI_CCU_GATE(ahb_otg_clk, "ahb-otg", "ahb",
> > ...
> >>> + 0x060, BIT(14), CLK_IS_CRITICAL);
> >> <snip>
> >>
> >>> +static struct ccu_reset_map sun7i_a20_ccu_resets[] = {
> >>> + [RST_USB_PHY0] = { 0x0cc, BIT(0) },
> >>> + [RST_USB_PHY1] = { 0x0cc, BIT(1) },
> >>> + [RST_USB_PHY2] = { 0x0cc, BIT(2) },
> >>> + [RST_GPS] = { 0x0d0, BIT(0) },
> >>> + [RST_DE_BE0] = { 0x104, BIT(30) },
> >>> + [RST_DE_BE1] = { 0x108, BIT(30) },
> >>> + [RST_DE_FE0] = { 0x10c, BIT(30) },
> >>> + [RST_DE_FE1] = { 0x110, BIT(30) },
> >>> + [RST_DE_MP] = { 0x114, BIT(30) },
> >>> + [RST_TCON0] = { 0x118, BIT(30) },
> >>> + [RST_TCON1] = { 0x11c, BIT(30) },
> >> You are missing the TV encoder reset:
> >> + [RST_TVE0] = { 0x118, BIT(29) },
> >> + [RST_TVE1] = { 0x11c, BIT(29) },
> >>
> >> (to match your table i did not use defines :p)
> > Where did you get this information?
> > This is not present in any datasheets I have:
> > * A10 - 1.50
> > * A20 - 1.4
> It is actually from the A13. In the A13 all the other bits match up. We
> know from both that TCON0 is at 0x118 with its reset at BIT(30) and
> TCON1 has its reset 0x11c. From the A13 datasheet we gather that TCON(0)
> and TV(0) are at 0x118 with RST_TV on BIT(31) and thus it is only
> logical that that for the TVE1 we have the rest at 0x11c.
>
> But this is writing from the top of my head, I think we can also find it
> in the 3.4 sources if I recall correctly.
Thanks, added the reset bits for TVE0/1.
Päikest,
Priit :)
next prev parent reply other threads:[~2017-07-14 13:48 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 20:04 [PATCH v5 0/6] ARM: sunxi: Convert sun4i/sun7i series SoCs to sunxi-ng CCU Priit Laes
[not found] ` <cover.23e9103a2becf2261d7e145bb1516221a5cfb8a4.1499197129.git-series.plaes-q/aMd4JkU83YtjvyW6yDsg@public.gmane.org>
2017-07-04 20:04 ` [PATCH v5 1/6] clk: sunxi-ng: div: Add support for fixed post-divider Priit Laes
[not found] ` <805048a548031cafc890e6ea06ee773bdfb199d0.1499197129.git-series.plaes-q/aMd4JkU83YtjvyW6yDsg@public.gmane.org>
2017-07-05 4:06 ` Chen-Yu Tsai
2017-07-05 7:43 ` Maxime Ripard
2017-07-10 8:13 ` Olliver Schinagl
2017-07-04 20:04 ` [PATCH v5 2/6] clk: sunxi-ng: Add sun4i/sun7i CCU driver Priit Laes
[not found] ` <65066c74b8dedfeb8de27d90b5fecfea3a700178.1499197129.git-series.plaes-q/aMd4JkU83YtjvyW6yDsg@public.gmane.org>
2017-07-09 12:25 ` Jonathan Liu
[not found] ` <CANwerB0d+2rU9gnCSKP4wwXZpzEsHXP6LtBYvxD+GnQAj6QHVQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-13 19:12 ` Priit Laes
2017-07-10 9:45 ` [linux-sunxi] " Olliver Schinagl
[not found] ` <5099cd90-e019-8a65-38e5-02b3c939a7a8-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org>
2017-07-13 19:23 ` Priit Laes
[not found] ` <20170713192358.GB22375-q/aMd4JkU83YtjvyW6yDsg@public.gmane.org>
2017-07-13 19:46 ` Olliver Schinagl
2017-07-14 13:48 ` Priit Laes [this message]
2017-07-04 20:04 ` [PATCH v5 3/6] dt-bindings: List devicetree binding for the CCU of Allwinner A20 Priit Laes
[not found] ` <68788c4452291977ab16168d89cb91c4611e1a41.1499197129.git-series.plaes-q/aMd4JkU83YtjvyW6yDsg@public.gmane.org>
2017-07-05 4:07 ` Chen-Yu Tsai
2017-07-04 20:04 ` [PATCH v5 4/6] dt-bindings: List devicetree binding for the CCU of Allwinner A10 Priit Laes
[not found] ` <0f68552ad8214115634d649ed34ea450461f9b5d.1499197129.git-series.plaes-q/aMd4JkU83YtjvyW6yDsg@public.gmane.org>
2017-07-05 4:07 ` Chen-Yu Tsai
2017-07-04 20:05 ` [PATCH v5 5/6] ARM: sun7i: Convert to CCU Priit Laes
[not found] ` <2ff8930c51b90a0bb875ecc6c4737f44b3314e7f.1499197129.git-series.plaes-q/aMd4JkU83YtjvyW6yDsg@public.gmane.org>
2017-07-10 11:23 ` [linux-sunxi] " Olliver Schinagl
[not found] ` <4091e67f-6207-26ef-85f1-e9ff509dd3b7-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org>
2017-07-10 11:55 ` Maxime Ripard
2017-07-10 12:24 ` [linux-sunxi] " Olliver Schinagl
2017-07-04 20:05 ` [PATCH v5 6/6] ARM: sun4i: " Priit Laes
[not found] ` <796d0ecb0fe0204891387910b8222bfa43a93326.1499197129.git-series.plaes-q/aMd4JkU83YtjvyW6yDsg@public.gmane.org>
2017-07-10 11:44 ` Olliver Schinagl
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=20170714134854.GA7579@plaes.org \
--to=plaes@plaes.org \
--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=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=net147@gmail.com \
--cc=oliver@schinagl.nl \
--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 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).