Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1313432 > unrolled thread
| Started by | Rob Herring <robh@kernel.org> |
|---|---|
| First post | 2016-01-20 19:30 +0100 |
| Last post | 2016-01-26 08:40 +0100 |
| Articles | 7 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH v2 1/4] dt-bindings: power: reset: add document for reboot-mode driver Rob Herring <robh@kernel.org> - 2016-01-20 19:30 +0100
Re: [PATCH v2 1/4] dt-bindings: power: reset: add document for reboot-mode driver John Stultz <john.stultz@linaro.org> - 2016-01-20 19:50 +0100
Re: [PATCH v2 1/4] dt-bindings: power: reset: add document for reboot-mode driver Rob Herring <robh@kernel.org> - 2016-01-20 21:00 +0100
Re: [PATCH v2 1/4] dt-bindings: power: reset: add document for reboot-mode driver John Stultz <john.stultz@linaro.org> - 2016-01-20 21:30 +0100
Re: [PATCH v2 1/4] dt-bindings: power: reset: add document for reboot-mode driver Andy Yan <andy.yan@rock-chips.com> - 2016-01-21 07:30 +0100
Re: [PATCH v2 1/4] dt-bindings: power: reset: add document for reboot-mode driver Rob Herring <robh@kernel.org> - 2016-01-25 18:20 +0100
Re: [PATCH v2 1/4] dt-bindings: power: reset: add document for reboot-mode driver Andy Yan <andy.yan@rock-chips.com> - 2016-01-26 08:40 +0100
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Date | 2016-01-20 19:30 +0100 |
| Subject | Re: [PATCH v2 1/4] dt-bindings: power: reset: add document for reboot-mode driver |
| Message-ID | <qT5G1-1Wb-9@gated-at.bofh.it> |
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
> +
> +This driver get reboot mode arguments and call the write
> +interface to stores the magic value in special register
> +or ram . Then the bootloader can read it and take different
> +action according to the argument stored.
> +
> +Required properties:
> +- compatible: only support "syscon-reboot-mode" now.
> +
> +Each mode is represented as a sub-node of reboot_mode:
> +
> +Subnode required properties:
> +- linux,mode: reboot mode command,such as "loader", "recovery", "fastboot".
> +- loader,magic: magic number for the mode, this is vendor specific.
> +
> +Example:
> + reboot_mode {
reboot-mode instead please.
> + 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.
> +
> + 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.
We need to be clear what loader means. More specifically, it is boot
into bootloader shell.
> +
> + maskrom {
In theory, the bootrom could have multiple modes. This typically means a
USB download mode. So perhaps a more precise name would be
"rom-download".
In chips I'm familiar with the bootrom mode is selected via a different
mechanism than the secondary bootloader modes, but I suppose the same
mechanism could be used.
> + linux,mode = "maskrom";
> + loader,magic = <BOOT_MASKROM>;
> + };
> +
> + recovery {
> + linux,mode = "recovery";
> + loader,magic = <BOOT_RECOVERY>;
> + };
> +
> + fastboot {
> + linux,mode = "fastboot";
> + loader,magic = <BOOT_FASTBOOT>;
> + };
[toc] | [next] | [standalone]
| From | John Stultz <john.stultz@linaro.org> |
|---|---|
| Date | 2016-01-20 19:50 +0100 |
| Message-ID | <qT5Zn-24v-9@gated-at.bofh.it> |
| In reply to | #1313432 |
On Wed, Jan 20, 2016 at 10:28 AM, Rob Herring <robh@kernel.org> 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
>> +
>> +This driver get reboot mode arguments and call the write
>> +interface to stores the magic value in special register
>> +or ram . Then the bootloader can read it and take different
>> +action according to the argument stored.
>> +
>> +Required properties:
>> +- compatible: only support "syscon-reboot-mode" now.
>> +
>> +Each mode is represented as a sub-node of reboot_mode:
>> +
>> +Subnode required properties:
>> +- linux,mode: reboot mode command,such as "loader", "recovery", "fastboot".
>> +- loader,magic: magic number for the mode, this is vendor specific.
>> +
>> +Example:
>> + reboot_mode {
>
> reboot-mode instead please.
>
>> + 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.
>
>> +
>> + 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.
It seems like devices already have a number of various different
vendor specific commands. So this sort of flexibility helps us adapt
the driver to different hardware/system environments (which may use
different conventions then what Android commonly uses).
Unless I'm misunderstanding you and you're instead suggesting we can
dynamically parse the command mode from the node name?
That said, I agree we should try to push vendors to using the same
conventions when they are providing the same functionality. But I'm
not sure we should enforce that by making vendors introduce a new dt
binding for every new reboot command they want to implement.
thanks
-john
[toc] | [prev] | [next] | [standalone]
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Date | 2016-01-20 21:00 +0100 |
| Message-ID | <qT75a-2KF-31@gated-at.bofh.it> |
| In reply to | #1313437 |
On Wed, Jan 20, 2016 at 12:47 PM, John Stultz <john.stultz@linaro.org> wrote:
> On Wed, Jan 20, 2016 at 10:28 AM, Rob Herring <robh@kernel.org> 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
>>> +
>>> +This driver get reboot mode arguments and call the write
>>> +interface to stores the magic value in special register
>>> +or ram . Then the bootloader can read it and take different
>>> +action according to the argument stored.
>>> +
>>> +Required properties:
>>> +- compatible: only support "syscon-reboot-mode" now.
>>> +
>>> +Each mode is represented as a sub-node of reboot_mode:
>>> +
>>> +Subnode required properties:
>>> +- linux,mode: reboot mode command,such as "loader", "recovery", "fastboot".
>>> +- loader,magic: magic number for the mode, this is vendor specific.
>>> +
>>> +Example:
>>> + reboot_mode {
>>
>> reboot-mode instead please.
>>
>>> + 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.
>>
>>> +
>>> + 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.
>
>
> It seems like devices already have a number of various different
> vendor specific commands. So this sort of flexibility helps us adapt
> the driver to different hardware/system environments (which may use
> different conventions then what Android commonly uses).
>
> Unless I'm misunderstanding you and you're instead suggesting we can
> dynamically parse the command mode from the node name?
Yes, except it would be the property name. The driver could either
iterate over the properties of the reboot-mode node or lookup the
property when it has the reboot reason string. We generally like to
parse everything up front at probe, but the latter would be somewhat
easier to implement. Perhaps we would want to prefix nodes with
"mode-" or something.
Vendors can certainly still add their own (e.g.
vendor,halt-and-catch-fire = <0xdead>).
The question here really is will we ever need additional data for each
mode (in the DT) besides "magic". We can do some amount of extending
the property like allowing more that single 32-bit value. We can't mix
strings and integers though. If we don't need that, then lets go with
the more concise approach. This isn't really an evolving area.
Selecting boot mode/device has existed for a long time on PCs (it is
fixed list in the IPMI spec for example). So I can't imagine that we'd
have to extend this, but I'd like to hear thoughts on it. You had
mentioned the Galaxy Nexus having a value and a string, but I'd find
it surprising if the bootloader actually uses the string.
> That said, I agree we should try to push vendors to using the same
> conventions when they are providing the same functionality. But I'm
> not sure we should enforce that by making vendors introduce a new dt
> binding for every new reboot command they want to implement.
Either way they need to document it. It's either a new linux,mode
value or a new property name. Vendors are free to add whatever they
want, but for upstream it has to go thru review.
Rob
[toc] | [prev] | [next] | [standalone]
| From | John Stultz <john.stultz@linaro.org> |
|---|---|
| Date | 2016-01-20 21:30 +0100 |
| Message-ID | <qT7ya-3ae-15@gated-at.bofh.it> |
| In reply to | #1313482 |
On Wed, Jan 20, 2016 at 11:53 AM, Rob Herring <robh@kernel.org> wrote: > On Wed, Jan 20, 2016 at 12:47 PM, John Stultz <john.stultz@linaro.org> wrote: > The question here really is will we ever need additional data for each > mode (in the DT) besides "magic". We can do some amount of extending > the property like allowing more that single 32-bit value. We can't mix > strings and integers though. If we don't need that, then lets go with > the more concise approach. This isn't really an evolving area. > Selecting boot mode/device has existed for a long time on PCs (it is > fixed list in the IPMI spec for example). So I can't imagine that we'd > have to extend this, but I'd like to hear thoughts on it. You had > mentioned the Galaxy Nexus having a value and a string, but I'd find > it surprising if the bootloader actually uses the string. So I've been told the galaxy nexus and possibly other older TI hardware used only a string. And the HTC implementations I've seen have code for both a string and command to be placed, but usually don't actually copy anything to the string address (which suggest its not used by the bootloader, as you note). Either way, we'd have to extend or implement a new driver, but that's a bridge I think we can cross later when we see such hardware support upstream (rather then try to create a super driver that handles everything a creative firmware developer could come up with). thanks -john
[toc] | [prev] | [next] | [standalone]
| From | Andy Yan <andy.yan@rock-chips.com> |
|---|---|
| Date | 2016-01-21 07:30 +0100 |
| Message-ID | <qTgUO-1hr-9@gated-at.bofh.it> |
| In reply to | #1313432 |
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
>> +
>> +This driver get reboot mode arguments and call the write
>> +interface to stores the magic value in special register
>> +or ram . Then the bootloader can read it and take different
>> +action according to the argument stored.
>> +
>> +Required properties:
>> +- compatible: only support "syscon-reboot-mode" now.
>> +
>> +Each mode is represented as a sub-node of reboot_mode:
>> +
>> +Subnode required properties:
>> +- linux,mode: reboot mode command,such as "loader", "recovery", "fastboot".
>> +- loader,magic: magic number for the mode, this is vendor specific.
>> +
>> +Example:
>> + reboot_mode {
> reboot-mode instead please.
>
Sorry, I have already correct it in DT file, forget it here. It
will be changed in next version.
>> + 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?
>> +
>> + 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.
>
> 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.
>> +
>> + maskrom {
> In theory, the bootrom could have multiple modes. This typically means a
> USB download mode. So perhaps a more precise name would be
> "rom-download".
>
> In chips I'm familiar with the bootrom mode is selected via a different
> mechanism than the secondary bootloader modes, but I suppose the same
> mechanism could be used.
Yes , they use the same mechanism.
>> + linux,mode = "maskrom";
>> + loader,magic = <BOOT_MASKROM>;
>> + };
>> +
>> + recovery {
>> + linux,mode = "recovery";
>> + loader,magic = <BOOT_RECOVERY>;
>> + };
>> +
>> + fastboot {
>> + linux,mode = "fastboot";
>> + loader,magic = <BOOT_FASTBOOT>;
>> + };
>
>
>
[toc] | [prev] | [next] | [standalone]
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Date | 2016-01-25 18:20 +0100 |
| Message-ID | <qUSY4-7hD-47@gated-at.bofh.it> |
| In reply to | #1313943 |
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.
> >
> >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
[toc] | [prev] | [next] | [standalone]
| From | Andy Yan <andy.yan@rock-chips.com> |
|---|---|
| Date | 2016-01-26 08:40 +0100 |
| Message-ID | <qV6oh-KI-3@gated-at.bofh.it> |
| In reply to | #1317081 |
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
>
>
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web