devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Simon Horman <horms@verge.net.au>,
	Magnus Damm <magnus.damm@gmail.com>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Michael Turquette <mturquette@baylibre.com>,
	Dirk Behme <dirk.behme@de.bosch.com>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Subject: Re: [PATCH/RFC v3 00/22] soc: renesas: Add R-Car RST driver for obtaining mode pin state
Date: Mon, 12 Sep 2016 15:16:40 -0700	[thread overview]
Message-ID: <20160912221640.GG7243@codeaurora.org> (raw)
In-Reply-To: <CAMuHMdWu34OQSS6J3bf=0-1TYULc=coiVomBjtBatwGta5F3HQ@mail.gmail.com>

On 09/01, Geert Uytterhoeven wrote:
> Hi Stephen,
> 
> On Thu, Jun 30, 2016 at 10:14 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> > On 06/01, Geert Uytterhoeven wrote:
> >> Currently the R-Car Clock Pulse Generator (CPG) drivers obtains the
> >> state of the mode pins either by a call from the board code, or directly
> >> by using a hardcoded register access. This is a bit messy, and creates a
> >> dependency between driver and platform code.
> >>
> >> This RFC patch series converts the various Renesas R-Car clock drivers
> >> and support code from reading the mode pin states using a hardcoded
> >> register access to using a new R-Car RST driver.
> >
> > Dumb question, can we use the nvmem reading APIs instead of an
> > SoC specific function to read the modes?
> 
> Thanks for your suggestion, the nvmem API indeed looks like a suitable API,
> as it does support read-only nvmems.
> 
> Unfortunately I also see a few disadvantages:
>   1. nvmem_init() is a subsys_initcall(), while most of our users (except for
>      the recent renesas-cpg-mssr driver) are clock drivers using
>      CLK_OF_DECLARE(), and are thus initialized from of_clk_init() at much
>      earlier time_init() time.
>      Of course the mvmem subsystem and/or the clock drivers can be changed, if
>      deemed useful.

Sounds like this is solvable.

>   2. Using the nvmem DT bindings means we have to add more DT glue from the
>      nvmem consumer(s) to the nvmem provider. As we need to provide backwards
>      compatibility with old DTSes, this means we need more C code or DT fixup
>      code to handle that.

Ah I wasn't aware we were keeping backwards compatibility around.


>   3. The nvmem subsystem may be overkill to provide access to a simple 32-bit
>      read-only register that never changes value after boot.

The nvmem subsystem is designed to read values from things that
mostly never change. Overkill may be true, but the nice thing
about using nvmem APIs is that the driver doesn't have to use
some platform specific function that duplicates similar
functionality. It's unfortunate that backwards incompatibility
limits our ability to move to common linux frameworks when they
are created after the binding is used.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2016-09-12 22:16 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 19:20 [PATCH/RFC v3 00/22] soc: renesas: Add R-Car RST driver for obtaining mode pin state Geert Uytterhoeven
2016-06-01 19:20 ` [PATCH/RFC v3 01/22] reset: Add renesas,rst DT bindings Geert Uytterhoeven
2016-06-02  5:40   ` Dirk Behme
2016-06-02 21:47   ` Laurent Pinchart
2016-06-10  7:52     ` Geert Uytterhoeven
2016-06-01 19:21 ` [PATCH/RFC v3 02/22] soc: renesas: Add R-Car RST driver Geert Uytterhoeven
2016-06-02  5:42   ` Dirk Behme
2016-06-10  7:58     ` Geert Uytterhoeven
2016-06-10  8:38       ` Dirk Behme
2016-06-10 13:08       ` Laurent Pinchart
2016-06-02 21:58   ` Laurent Pinchart
2016-06-10  7:54     ` Geert Uytterhoeven
     [not found] ` <1464808880-343-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2016-06-01 19:21   ` [PATCH/RFC v3 03/22] ARM: dts: r8a7778: Add device node for RESET/WDT module Geert Uytterhoeven
2016-06-01 19:21   ` [PATCH/RFC v3 04/22] ARM: dts: r8a7779: " Geert Uytterhoeven
2016-06-01 19:21   ` [PATCH/RFC v3 11/22] clk: renesas: r8a7778: Obtain mode pin values using R-Car RST driver Geert Uytterhoeven
2016-06-01 19:21   ` [PATCH/RFC v3 12/22] clk: renesas: r8a7779: Obtain mode pin values from " Geert Uytterhoeven
2016-06-01 19:21   ` [PATCH/RFC v3 16/22] clk: renesas: rcar-gen3-cpg: Remove obsolete rcar_gen3_read_mode_pins() Geert Uytterhoeven
     [not found]     ` <1464808880-343-17-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2016-06-02 22:02       ` Laurent Pinchart
2016-06-01 19:21   ` [PATCH/RFC v3 21/22] clk: renesas: r8a7779: Remove obsolete r8a7779_clocks_init() Geert Uytterhoeven
2016-06-01 19:21 ` [PATCH/RFC v3 05/22] ARM: dts: r8a7790: Add device node for RST module Geert Uytterhoeven
2016-06-01 19:21 ` [PATCH/RFC v3 06/22] ARM: dts: r8a7791: " Geert Uytterhoeven
2016-06-01 19:21 ` [PATCH/RFC v3 07/22] ARM: dts: r8a7793: " Geert Uytterhoeven
2016-06-01 19:21 ` [PATCH/RFC v3 08/22] ARM: dts: r8a7794: " Geert Uytterhoeven
2016-06-01 19:21 ` [PATCH/RFC v3 09/22] arm64: renesas: r8a7795 dtsi: " Geert Uytterhoeven
2016-06-01 19:21 ` [PATCH/RFC v3 10/22] arm64: renesas: r8a7796 " Geert Uytterhoeven
2016-06-01 19:21 ` [PATCH/RFC v3 13/22] clk: renesas: rcar-gen2: Obtain mode pin values using RST driver Geert Uytterhoeven
2016-06-01 19:21 ` [PATCH/RFC v3 14/22] clk: renesas: r8a7795: Obtain mode pin values from R-Car " Geert Uytterhoeven
2016-06-02 22:01   ` Laurent Pinchart
2016-06-01 19:21 ` [PATCH/RFC v3 15/22] clk: renesas: r8a7796: " Geert Uytterhoeven
2016-06-02 22:02   ` Laurent Pinchart
2016-06-01 19:21 ` [PATCH/RFC v3 17/22] ARM: shmobile: r8a7778: Stop passing mode pins state to clock driver Geert Uytterhoeven
2016-06-01 19:21 ` [PATCH/RFC v3 18/22] ARM: shmobile: r8a7779: " Geert Uytterhoeven
2016-06-01 19:21 ` [PATCH/RFC v3 19/22] ARM: shmobile: rcar-gen2: " Geert Uytterhoeven
2016-06-01 19:21 ` [PATCH/RFC v3 20/22] clk: renesas: r8a7778: Remove obsolete r8a7778_clocks_init() Geert Uytterhoeven
2016-06-02  5:54   ` Dirk Behme
2016-06-02  7:13     ` Geert Uytterhoeven
2016-06-01 19:21 ` [PATCH/RFC v3 22/22] clk: renesas: rcar-gen2: Remove obsolete rcar_gen2_clocks_init() Geert Uytterhoeven
2016-06-02  5:57 ` [PATCH/RFC v3 00/22] soc: renesas: Add R-Car RST driver for obtaining mode pin state Dirk Behme
2016-06-30 20:14 ` Stephen Boyd
2016-09-01 11:46   ` Geert Uytterhoeven
2016-09-12 22:16     ` Stephen Boyd [this message]
2016-09-13  6:48       ` Geert Uytterhoeven

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=20160912221640.GG7243@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dirk.behme@de.bosch.com \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=horms@verge.net.au \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=srinivas.kandagatla@linaro.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).