All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Yan <andy.yan@rock-chips.com>
To: Rob Herring <robh@kernel.org>
Cc: heiko@sntech.de, arnd@arndb.de, john.stultz@linaro.org,
	linux@roeck-us.net, galak@codeaurora.org,
	ijc+devicetree@hellion.org.uk, catalin.marinas@arm.com,
	geert+renesas@glider.be, sre@kernel.org, olof@lixom.net,
	dbaryshkov@gmail.com, alexandre.belloni@free-electrons.com,
	jun.nie@linaro.org, pawel.moll@arm.com, f.fainelli@gmail.com,
	will.deacon@arm.com, linux-rockchip@lists.infradead.org,
	devicetree@vger.kernel.org, linux-pm@vger.kernel.org,
	linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org,
	lorenzo.pieralisi@arm.com, moritz.fischer@ettus.com,
	cernekee@gmail.com, linux-kernel@vger.kernel.org,
	dwmw2@infradead.org, mark.rutland@arm.com,
	maxime.ripard@free-electrons.com
Subject: Re: [PATCH v2 1/4] dt-bindings: power: reset: add document for reboot-mode driver
Date: Tue, 26 Jan 2016 15:35:33 +0800	[thread overview]
Message-ID: <56A721C5.4050606@rock-chips.com> (raw)
In-Reply-To: <20160125171134.GA21713@rob-hp-laptop>

Hi Rob:

On 2016年01月26日 01:11, Rob Herring wrote:
> On Thu, Jan 21, 2016 at 02:27:57PM +0800, Andy Yan wrote:
>> Hi Rob:
>>     thanks for your review.
>> On 2016年01月21日 02:28, Rob Herring wrote:
>>> On Tue, Jan 12, 2016 at 07:29:49PM +0800, Andy Yan wrote:
>>>> add device tree binding document for reboot-mode driver
>>>>
>>>> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
>>>>
>>>> ---
>>>>
>>>> Changes in v2: None
>>>> Changes in v1: None
>>>>
>>>>   .../bindings/power/reset/reboot-mode.txt           | 41 +++++++++++++++++
>>>>   .../bindings/power/reset/syscon-reboot-mode.txt    | 52 ++++++++++++++++++++++
>>>>   2 files changed, 93 insertions(+)
>>>>   create mode 100644 Documentation/devicetree/bindings/power/reset/reboot-mode.txt
>>>>   create mode 100644 Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/power/reset/reboot-mode.txt b/Documentation/devicetree/bindings/power/reset/reboot-mode.txt
>>>> new file mode 100644
>>>> index 0000000..81d9f66
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/power/reset/reboot-mode.txt
>>>> @@ -0,0 +1,41 @@
>>>> +Generic reboot mode core map driver
> [...]
>
>>>> +		compatible = "syscon-reboot-mode";
>>>> +		offset = <0x40>;
>>> This doc by itself is a little confusing. For example, is a child of the
>>> syscon node? I would remove offset (and perhaps compatible) from this
>>> example.
>>     Yes, is a child of a syscon mapped node. For example, Rockchip platform
>> use a register of PMU(rk3066/rk3288) or GRF(rk3036), PMU and GRF are aleady
>> mapped by syscon.
>>     offset and compatible are used by write interface driver like
>> syscon-reboot-mode.c. If you don't like it appear in the core map doc, I
>> will move it to the syscon-reboot-mode.txt?
> Yes, try to make this doc stand on its own. It will obviously be
> incomplete lacking information on where in the DT it goes. So perhaps a
> note stating reboot-mode node location is defined in platform specific
> binding docs.
>
>>>> +
>>>> +		loader {
>>>> +			linux,mode = "loader";
>>>> +			loader,magic = <BOOT_LOADER>;
>>>> +		};
>>> Sorry, my previous suggestion was not clear. I'm suggesting get rid of
>>> the subnodes and just do properties like this:
>>>
>>> loader = <BOOT_LOADER>;
>>> maskrom = <BOOT_MASKROM>;
>>>
>>> That's the same amount of information unless node names and linux,mode
>>> values are going to diverge. Do they need to? I can't see a reason.
>>      Because the command"linux,mode" and value"loader,magic" is vendor
>> specific. I don't know what commands and how many mode other platform will
>> use. So as John says in his reply, this sort of flexibility help us adapt
>> the driver to different hardware/system environments.
> The only part of "reboot to fastboot" that is vendor specific would be
> the magic value. While we can have custom modes, we should standardize
> the common ones as much as possible. As I pointed out in my reply to
> John, we can still support vendor specific modes with just a property.

     Based your reply to John, I rebuild the code like bellow, I hope this
     is what you mean.

     DTS file:
     reboot-mode {
                         compatible = "syscon-reboot-mode";
                         offset = <0x94>;
                         mode-normal = <BOOT_NORMAL>;
                         mode-recovery = <BOOT_RECOVERY>;
                         mode-fastboot = <BOOT_FASTBOOT>;
                         mode-loader = <BOOT_LOADER>;
                         mode-maskrom = <BOOT_MASKROM>;
                 };


    driver:

     #define PREFIX "mode-"

     struct property *prop;
     size_t len = strlen(PREFIX);
     for_each_property_of_node(dev->of_node, prop) {
                 if (len > strlen(prop->name) || strncmp(prop->name, 
PREFIX, len))
                         continue;
                 info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
                 if (!info)
                         return -ENOMEM;
                 strcpy(info->mode, prop->name + len);
                 if (of_property_read_u32(dev->of_node, prop->name, 
&info->magic)) {
                         dev_err(dev, "reboot mode %s without magic 
number\n",
                                 info->mode);
                         devm_kfree(dev, info);
                         continue;
                 }
                 list_add_tail(&info->list, &reboot->head);
         }


>>> We need to be clear what loader means. More specifically, it is boot
>>> into bootloader shell.
>>      Actually, Rockchip platform will reboot into a bootloader download mode
>> with this command. This mode can download faster than maskrom download mode.
> My point is proven. I assumed one thing and you meant something else.
> Doesn't matter what the mode is, just needs to be clear.
>
> Rob
>
>
>



WARNING: multiple messages have this Message-ID (diff)
From: andy.yan@rock-chips.com (Andy Yan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/4] dt-bindings: power: reset: add document for reboot-mode driver
Date: Tue, 26 Jan 2016 15:35:33 +0800	[thread overview]
Message-ID: <56A721C5.4050606@rock-chips.com> (raw)
In-Reply-To: <20160125171134.GA21713@rob-hp-laptop>

Hi Rob:

On 2016?01?26? 01:11, Rob Herring wrote:
> On Thu, Jan 21, 2016 at 02:27:57PM +0800, Andy Yan wrote:
>> Hi Rob:
>>     thanks for your review.
>> On 2016?01?21? 02:28, Rob Herring wrote:
>>> On Tue, Jan 12, 2016 at 07:29:49PM +0800, Andy Yan wrote:
>>>> add device tree binding document for reboot-mode driver
>>>>
>>>> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
>>>>
>>>> ---
>>>>
>>>> Changes in v2: None
>>>> Changes in v1: None
>>>>
>>>>   .../bindings/power/reset/reboot-mode.txt           | 41 +++++++++++++++++
>>>>   .../bindings/power/reset/syscon-reboot-mode.txt    | 52 ++++++++++++++++++++++
>>>>   2 files changed, 93 insertions(+)
>>>>   create mode 100644 Documentation/devicetree/bindings/power/reset/reboot-mode.txt
>>>>   create mode 100644 Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/power/reset/reboot-mode.txt b/Documentation/devicetree/bindings/power/reset/reboot-mode.txt
>>>> new file mode 100644
>>>> index 0000000..81d9f66
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/power/reset/reboot-mode.txt
>>>> @@ -0,0 +1,41 @@
>>>> +Generic reboot mode core map driver
> [...]
>
>>>> +		compatible = "syscon-reboot-mode";
>>>> +		offset = <0x40>;
>>> This doc by itself is a little confusing. For example, is a child of the
>>> syscon node? I would remove offset (and perhaps compatible) from this
>>> example.
>>     Yes, is a child of a syscon mapped node. For example, Rockchip platform
>> use a register of PMU(rk3066/rk3288) or GRF(rk3036), PMU and GRF are aleady
>> mapped by syscon.
>>     offset and compatible are used by write interface driver like
>> syscon-reboot-mode.c. If you don't like it appear in the core map doc, I
>> will move it to the syscon-reboot-mode.txt?
> Yes, try to make this doc stand on its own. It will obviously be
> incomplete lacking information on where in the DT it goes. So perhaps a
> note stating reboot-mode node location is defined in platform specific
> binding docs.
>
>>>> +
>>>> +		loader {
>>>> +			linux,mode = "loader";
>>>> +			loader,magic = <BOOT_LOADER>;
>>>> +		};
>>> Sorry, my previous suggestion was not clear. I'm suggesting get rid of
>>> the subnodes and just do properties like this:
>>>
>>> loader = <BOOT_LOADER>;
>>> maskrom = <BOOT_MASKROM>;
>>>
>>> That's the same amount of information unless node names and linux,mode
>>> values are going to diverge. Do they need to? I can't see a reason.
>>      Because the command"linux,mode" and value"loader,magic" is vendor
>> specific. I don't know what commands and how many mode other platform will
>> use. So as John says in his reply, this sort of flexibility help us adapt
>> the driver to different hardware/system environments.
> The only part of "reboot to fastboot" that is vendor specific would be
> the magic value. While we can have custom modes, we should standardize
> the common ones as much as possible. As I pointed out in my reply to
> John, we can still support vendor specific modes with just a property.

     Based your reply to John, I rebuild the code like bellow, I hope this
     is what you mean.

     DTS file:
     reboot-mode {
                         compatible = "syscon-reboot-mode";
                         offset = <0x94>;
                         mode-normal = <BOOT_NORMAL>;
                         mode-recovery = <BOOT_RECOVERY>;
                         mode-fastboot = <BOOT_FASTBOOT>;
                         mode-loader = <BOOT_LOADER>;
                         mode-maskrom = <BOOT_MASKROM>;
                 };


    driver:

     #define PREFIX "mode-"

     struct property *prop;
     size_t len = strlen(PREFIX);
     for_each_property_of_node(dev->of_node, prop) {
                 if (len > strlen(prop->name) || strncmp(prop->name, 
PREFIX, len))
                         continue;
                 info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
                 if (!info)
                         return -ENOMEM;
                 strcpy(info->mode, prop->name + len);
                 if (of_property_read_u32(dev->of_node, prop->name, 
&info->magic)) {
                         dev_err(dev, "reboot mode %s without magic 
number\n",
                                 info->mode);
                         devm_kfree(dev, info);
                         continue;
                 }
                 list_add_tail(&info->list, &reboot->head);
         }


>>> We need to be clear what loader means. More specifically, it is boot
>>> into bootloader shell.
>>      Actually, Rockchip platform will reboot into a bootloader download mode
>> with this command. This mode can download faster than maskrom download mode.
> My point is proven. I assumed one thing and you meant something else.
> Doesn't matter what the mode is, just needs to be clear.
>
> Rob
>
>
>

  reply	other threads:[~2016-01-26  7:35 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-12 11:27 [PATCH v2 0/4] add reboot mode driver Andy Yan
2016-01-12 11:27 ` Andy Yan
2016-01-12 11:27 ` Andy Yan
     [not found] ` <1452598029-8222-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-01-12 11:29   ` [PATCH v2 1/4] dt-bindings: power: reset: add document for reboot-mode driver Andy Yan
2016-01-12 11:29     ` Andy Yan
2016-01-12 11:29     ` Andy Yan
2016-01-15 22:41     ` John Stultz
2016-01-15 22:41       ` John Stultz
2016-01-15 22:41       ` John Stultz
     [not found]       ` <CALAqxLUxh3=LhoHxqiRm_5L4G6m1Vctp=aUg+9_uAtLkFwW9bw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-01-19  8:31         ` Andy Yan
2016-01-19  8:31           ` Andy Yan
2016-01-19  8:31           ` Andy Yan
2016-01-20 18:28     ` Rob Herring
2016-01-20 18:28       ` Rob Herring
2016-01-20 18:47       ` John Stultz
2016-01-20 18:47         ` John Stultz
2016-01-20 18:47         ` John Stultz
2016-01-20 19:53         ` Rob Herring
2016-01-20 19:53           ` Rob Herring
2016-01-20 19:53           ` Rob Herring
2016-01-20 20:25           ` John Stultz
2016-01-20 20:25             ` John Stultz
2016-01-20 20:25             ` John Stultz
2016-01-21  6:27       ` Andy Yan
2016-01-21  6:27         ` Andy Yan
2016-01-21  6:27         ` Andy Yan
2016-01-25 17:11         ` Rob Herring
2016-01-25 17:11           ` Rob Herring
2016-01-26  7:35           ` Andy Yan [this message]
2016-01-26  7:35             ` Andy Yan
2016-01-12 11:31 ` [PATCH v2 2/4] power: reset: add reboot mode driver Andy Yan
2016-01-12 11:31   ` Andy Yan
2016-01-15 20:27   ` John Stultz
2016-01-15 20:27     ` John Stultz
2016-01-15 20:27     ` John Stultz
2016-01-19  8:38     ` Andy Yan
2016-01-19  8:38       ` Andy Yan
2016-01-19  8:38       ` Andy Yan
2016-01-21  8:37   ` Matthias Brugger
2016-01-21  8:37     ` Matthias Brugger
     [not found]   ` <1452598319-8324-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-01-27 10:53     ` Moritz Fischer
2016-01-27 10:53       ` Moritz Fischer
2016-01-27 10:53       ` Moritz Fischer
2016-02-02  7:31       ` Andy Yan
2016-02-02  7:31         ` Andy Yan
2016-02-02  7:31         ` Andy Yan
2016-01-12 11:32 ` [PATCH v2 3/4] ARM: dts: rockchip: add syscon-reboot-mode node Andy Yan
2016-01-12 11:32   ` Andy Yan
     [not found]   ` <1452598378-8371-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-01-21  8:38     ` Matthias Brugger
2016-01-21  8:38       ` Matthias Brugger
2016-01-21  8:38       ` Matthias Brugger
2016-01-12 11:33 ` [PATCH v2 4/4] ARM64: dts: rockchip: add syscon-reboot-mode DT node Andy Yan
2016-01-12 11:33   ` Andy Yan
2016-01-13  2:17 ` [PATCH v2 0/4] add reboot mode driver Caesar Wang
2016-01-13  2:17   ` Caesar Wang

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=56A721C5.4050606@rock-chips.com \
    --to=andy.yan@rock-chips.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=cernekee@gmail.com \
    --cc=dbaryshkov@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=f.fainelli@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=geert+renesas@glider.be \
    --cc=heiko@sntech.de \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=john.stultz@linaro.org \
    --cc=jun.nie@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linux@roeck-us.net \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=moritz.fischer@ettus.com \
    --cc=olof@lixom.net \
    --cc=pawel.moll@arm.com \
    --cc=robh@kernel.org \
    --cc=sre@kernel.org \
    --cc=will.deacon@arm.com \
    /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.