All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@de.bosch.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Simon Horman <horms+renesas@verge.net.au>,
	<linux-renesas-soc@vger.kernel.org>,
	Dirk Behme <dirk.behme@gmail.com>
Subject: Re: [PATCH v2 09/10] ARM: dts: r8a779x: Add reset module support
Date: Wed, 11 May 2016 15:36:44 +0200	[thread overview]
Message-ID: <dbaad273-a2e9-6334-7446-9d350022b6db@de.bosch.com> (raw)
In-Reply-To: <CAMuHMdXE1fQzv+CDfRb8Tb-kMushBKAQ+dC+zR-vXLF2FjxMmg@mail.gmail.com>

Hi Geert,

On 11.05.2016 14:13, Geert Uytterhoeven wrote:
> Hi Dirk,
>
> On Wed, May 11, 2016 at 1:56 PM, Dirk Behme <dirk.behme@de.bosch.com> wrote:
>> On 11.05.2016 10:06, Geert Uytterhoeven wrote:
>>> On Wed, May 11, 2016 at 7:29 AM, Dirk Behme <dirk.behme@de.bosch.com>
>>> wrote:
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/misc/renesas,rcar-rst.txt
>>>> @@ -0,0 +1,15 @@
>>>> +Renesas RCar r8a779x reset module
>>>> +-----------------------------------------------------
>>>> +This binding defines the reset module found on Renesas RCar r8a779x
>>>> +SoCs. The reset module contains several reset related registers,
>>>> +the meaning of them is implementation dependent.
>>>> +
>>>> +Required properties:
>>>> +- compatible : "renesas,rcar-rst"
>>>> +- reg : Location and size of the reset module
>>>> +
>>>> +Example:
>>>> +       reset-controller@e6160000 {
>>>> +               compatible = "renesas,rcar-rst";
>>>> +               reg = <0 0xe6160000 0 0x200>;
>>>> +       };
>>>
>>>
>>> While I understand you want to match on a single comptible value, the RST
>>> module itself highly depends on the actual SoC.
>>> Furthermore, R-Car Gen1 doesn't have RST.
>>>
>>> Hence I'd go for requiring 2 compatible values:
>>>   - An SoC-specific one, e.g. "renesas,r8a7795-rst",
>>>   - A family-specific one, e.g. "renesas,rcar-gen3-rst".
>>>
>>> Your driver code can match against the two family-specific compatible
>>> values
>>> using of_find_matching_node().
>>
>> This way? See below [1].
>>
>> Best regards
>>
>> Dirk
>>
>> [1]
>>
>> --- a/drivers/misc/boot-mode-reg/rcar.c
>> +++ b/drivers/misc/boot-mode-reg/rcar.c
>> @@ -16,24 +16,43 @@
>>  #include <linux/io.h>
>>  #include <linux/module.h>
>>  #include <linux/of.h>
>> +#include <linux/of_address.h>
>>
>>  #include <misc/boot-mode-reg.h>
>>
>> -#define MODEMR 0xe6160060
>> +#define RCAR_RST_BASE 0xe6160000
>> +#define RCAR_RST_SIZE 0x200
>> +#define MODEMR 0x60
>> +
>> +static struct of_device_id rcar_rst_ids[] __initdata = {
>
> const
>
>> +       { .compatible = "renesas,rcar-gen2-rst" },
>> +       { .compatible = "renesas,rcar-gen3-rst" },
>> +       {}
>> +};
>>
>>  static int __init rcar_read_mode_pins(void)
>>  {
>> -       void __iomem *modemr;
>> +       void __iomem *reset;
>> +       struct device_node *np;
>>         int err = -ENOMEM;
>>         static u32 mode;
>>
>> -       modemr = ioremap_nocache(MODEMR, 4);
>> -       if (!modemr) {
>> -               pr_err("failed to map boot mode register");
>> +       np = of_find_matching_node(NULL, rcar_rst_ids);
>
> Yep, like this.
>
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/misc/renesas,rcar-rst.txt
>> @@ -0,0 +1,24 @@
>> +Renesas RCar r8a779x reset module
>
> R-Car Gen2 and Gen3
>
>> +-----------------------------------------------------
>> +This binding defines the reset module found on Renesas RCar r8a779x
>
> R-Car Gen2 and Gen3
>
>> +SoCs. The reset module contains several reset related registers,
>> +the meaning of them is implementation dependent.
>
> You may want to add more functionality from
> http://www.spinics.net/lists/linux-sh/msg44754.html


Just an understanding question:

Why do you prefer the solution with the drivers/misc/boot-mode-reg/ 
solution done in this patch series over the solution you proposed in

http://www.spinics.net/lists/linux-sh/msg44755.html

and the reset of that series?

Best regards

Dirk


>> +Required properties:
>> +- compatible : "renesas,rcar-gen2-rst" for RCar Gen2 or
>
> R-Car
>
>> +               "renesas,rcar-gen3-rst" for RCar Gen3
>
> R-Car
>
>> +              and additionally a SoC specific property like
>> +              "renesas,r8a7790-rst" or
>> +              "renesas,r8a7791-rst" or
>> +              "renesas,r8a7792-rst" or
>> +              "renesas,r8a7793-rst" or
>> +              "renesas,r8a7794-rst" or
>> +              "renesas,r8a7795-rst" or
>> +              "renesas,r8a7796-rst"
>
> The SoC-specific compatible values should be listed first.
>
>> +- reg : Location and size of the reset module
>> +
>> +Example:
>> +       reset-controller@e6160000 {
>> +               compatible = "renesas,rcar-gen3-rst", "renesas,r8a7795-rst";
>
> The SoC-specific compatible value should be listed first.
> The same is true for the actual dtsi files.
>
>> +               reg = <0 0xe6160000 0 0x200>;
>> +       };
>

  reply	other threads:[~2016-05-11 13:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11  5:29 [PATCH v2 00/10] ARM: renesas RCar: Add boot-mode-reg core support Dirk Behme
2016-05-11  5:29 ` [PATCH v2 01/10] boot-mode-reg: Add core Dirk Behme
2016-05-11  7:54   ` Geert Uytterhoeven
2016-05-11  8:39     ` Dirk Behme
2016-05-11  8:41       ` Geert Uytterhoeven
2016-05-11  8:55         ` Dirk Behme
2016-05-11  9:12           ` Geert Uytterhoeven
2016-05-11  5:29 ` [PATCH v2 02/10] boot-mode-reg: Add R-Car driver Dirk Behme
2016-05-11  5:29 ` [PATCH v2 03/10] arm: renesas: rcar-gen2: Obtain MD pin value using boot-mode-reg Dirk Behme
2016-05-11  5:29 ` [PATCH v2 04/10] arm: renesas: r8a7791: " Dirk Behme
2016-05-11  5:29 ` [PATCH v2 05/10] clk: renesas: rcar-gen2: " Dirk Behme
2016-05-11  5:29 ` [PATCH v2 06/10] arm: renesas: rcar-gen2: Remove unused rcar_gen2_read_mode_pins() Dirk Behme
2016-05-11  5:29 ` [PATCH v2 07/10] arm: renesas: rcar-gen3: Make boot-mode-reg Gen3 compatible Dirk Behme
2016-05-11  5:29 ` [PATCH v2 08/10] clk: renesas: rcar-gen3: Obtain MD pin value using boot-mode-reg Dirk Behme
2016-05-11  5:29 ` [PATCH v2 09/10] ARM: dts: r8a779x: Add reset module support Dirk Behme
2016-05-11  8:06   ` Geert Uytterhoeven
2016-05-11 11:56     ` Dirk Behme
2016-05-11 12:13       ` Geert Uytterhoeven
2016-05-11 13:36         ` Dirk Behme [this message]
2016-05-11 13:51           ` Geert Uytterhoeven
2016-05-11 14:22             ` Dirk Behme
2016-05-11  5:29 ` [PATCH v2 10/10] boot-mode-reg: Convert to device tree Dirk Behme

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=dbaad273-a2e9-6334-7446-9d350022b6db@de.bosch.com \
    --to=dirk.behme@de.bosch.com \
    --cc=dirk.behme@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=horms+renesas@verge.net.au \
    --cc=linux-renesas-soc@vger.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 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.