From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Yan Subject: Re: [PATCH v2 1/4] dt-bindings: power: reset: add document for reboot-mode driver Date: Thu, 21 Jan 2016 14:27:57 +0800 Message-ID: <56A07A6D.3010406@rock-chips.com> References: <1452598029-8222-1-git-send-email-andy.yan@rock-chips.com> <1452598189-8272-1-git-send-email-andy.yan@rock-chips.com> <20160120182840.GA15741@rob-hp-laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <20160120182840.GA15741@rob-hp-laptop> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Rob Herring Cc: heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org, arnd-r2nGTMty4D4@public.gmane.org, john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org, galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org, catalin.marinas-5wv7dgnIgG8@public.gmane.org, geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org, sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org, dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org, jun.nie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, pawel.moll-5wv7dgnIgG8@public.gmane.org, f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, will.deacon-5wv7dgnIgG8@public.gmane.org, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org, moritz.fischer-+aYTwkv1SeIAvxtiuMwx3w@public.gmane.org, cernekee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org List-Id: linux-pm@vger.kernel.org Hi Rob: thanks for your review. On 2016=E5=B9=B401=E6=9C=8821=E6=97=A5 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 >> >> --- >> >> 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/r= eboot-mode.txt >> create mode 100644 Documentation/devicetree/bindings/power/reset/s= yscon-reboot-mode.txt >> >> diff --git a/Documentation/devicetree/bindings/power/reset/reboot-mo= de.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", "fa= stboot". >> +- 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=20 will be changed in next version. >> + compatible =3D "syscon-reboot-mode"; >> + offset =3D <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=20 platform use a register of PMU(rk3066/rk3288) or GRF(rk3036), PMU and=20 GRF are aleady mapped by syscon. offset and compatible are used by write interface driver like=20 syscon-reboot-mode.c. If you don't like it appear in the core map doc, = I=20 will move it to the syscon-reboot-mode.txt? >> + >> + loader { >> + linux,mode =3D "loader"; >> + loader,magic =3D ; >> + }; > Sorry, my previous suggestion was not clear. I'm suggesting get rid o= f > the subnodes and just do properties like this: > > loader =3D ; > maskrom =3D ; > > That's the same amount of information unless node names and linux,mod= e > 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=20 specific. I don't know what commands and how many mode other platform=20 will use. So as John says in his reply, this sort of flexibility help u= s=20 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= =20 mode with this command. This mode can download faster than maskrom=20 download mode. >> + >> + maskrom { > In theory, the bootrom could have multiple modes. This typically mean= s 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 differe= nt > mechanism than the secondary bootloader modes, but I suppose the same > mechanism could be used. Yes , they use the same mechanism. >> + linux,mode =3D "maskrom"; >> + loader,magic =3D ; >> + }; >> + >> + recovery { >> + linux,mode =3D "recovery"; >> + loader,magic =3D ; >> + }; >> + >> + fastboot { >> + linux,mode =3D "fastboot"; >> + loader,magic =3D ; >> + }; > > > -- To unsubscribe from this list: send the line "unsubscribe devicetree" i= n the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: andy.yan@rock-chips.com (Andy Yan) Date: Thu, 21 Jan 2016 14:27:57 +0800 Subject: [PATCH v2 1/4] dt-bindings: power: reset: add document for reboot-mode driver In-Reply-To: <20160120182840.GA15741@rob-hp-laptop> References: <1452598029-8222-1-git-send-email-andy.yan@rock-chips.com> <1452598189-8272-1-git-send-email-andy.yan@rock-chips.com> <20160120182840.GA15741@rob-hp-laptop> Message-ID: <56A07A6D.3010406@rock-chips.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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 >> >> --- >> >> 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 = ; >> + }; > Sorry, my previous suggestion was not clear. I'm suggesting get rid of > the subnodes and just do properties like this: > > loader = ; > 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 = ; >> + }; >> + >> + recovery { >> + linux,mode = "recovery"; >> + loader,magic = ; >> + }; >> + >> + fastboot { >> + linux,mode = "fastboot"; >> + loader,magic = ; >> + }; > > > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758751AbcAUG2R (ORCPT ); Thu, 21 Jan 2016 01:28:17 -0500 Received: from regular1.263xmail.com ([211.150.99.139]:43071 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751591AbcAUG2N (ORCPT ); Thu, 21 Jan 2016 01:28:13 -0500 X-263anti-spam: KSV:0;BIG:0;ABS:1;DNS:0;ATT:0;SPF:S; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 1 X-SKE-CHECKED: 1 X-ADDR-CHECKED: 0 X-RL-SENDER: andy.yan@rock-chips.com X-FST-TO: maxime.ripard@free-electrons.com X-SENDER-IP: 121.15.173.1 X-LOGIN-NAME: andy.yan@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH v2 1/4] dt-bindings: power: reset: add document for reboot-mode driver To: Rob Herring References: <1452598029-8222-1-git-send-email-andy.yan@rock-chips.com> <1452598189-8272-1-git-send-email-andy.yan@rock-chips.com> <20160120182840.GA15741@rob-hp-laptop> 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 From: Andy Yan Message-ID: <56A07A6D.3010406@rock-chips.com> Date: Thu, 21 Jan 2016 14:27:57 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20160120182840.GA15741@rob-hp-laptop> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> >> --- >> >> 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 = ; >> + }; > Sorry, my previous suggestion was not clear. I'm suggesting get rid of > the subnodes and just do properties like this: > > loader = ; > 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 = ; >> + }; >> + >> + recovery { >> + linux,mode = "recovery"; >> + loader,magic = ; >> + }; >> + >> + fastboot { >> + linux,mode = "fastboot"; >> + loader,magic = ; >> + }; > > >