From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Yan Subject: Re: [PATCH v2 2/4] power: reset: add reboot mode driver Date: Tue, 19 Jan 2016 16:38:20 +0800 Message-ID: <569DF5FC.1080402@rock-chips.com> References: <1452598029-8222-1-git-send-email-andy.yan@rock-chips.com> <1452598319-8324-1-git-send-email-andy.yan@rock-chips.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from regular1.263xmail.com ([211.150.99.130]:50124 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757322AbcASIi0 (ORCPT ); Tue, 19 Jan 2016 03:38:26 -0500 In-Reply-To: Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: John Stultz Cc: =?UTF-8?Q?Heiko_St=c3=bcbner?= , Arnd Bergmann , linux@roeck-us.net, Kumar Gala , Ian Campbell , Rob Herring , Catalin Marinas , geert+renesas@glider.be, sre@kernel.org, Olof Johansson , dbaryshkov@gmail.com, Alexandre Belloni , jun.nie@linaro.org, =?UTF-8?Q?Pawe=c5=82_Moll?= , f.fainelli@gmail.com, Will Deacon , linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, Linux PM list , Russell King - ARM Linux , "linux-arm-kernel@lists.infradead.org" , lorenzo.pieralisi@arm.com, moritz.fischer@ettus.com, cernekee@gmail.com, lkml Hi John: On 2016=E5=B9=B401=E6=9C=8816=E6=97=A5 04:27, John Stultz wrote: > On Tue, Jan 12, 2016 at 3:31 AM, Andy Yan w= rote: >> This driver parse the reboot commands like "reboot loader" >> and "reboot recovery" to get a boot mode described in the >> device tree , then call the write interfae to store the boot >> mode in some persistent storage like special register or ram, >> which can be read by the bootloader after system reboot, then >> the bootloader can take different action according to the mode >> stored. >> >> This is commonly used on Android based devices, which in order >> to reboot the device into fastboot or recovery mode. >> >> Signed-off-by: Andy Yan > > Hey Andy! > Thanks for keeping this work going! I've just successfully reworke= d > my Nexus7 tree to use your implementation (using the syscon version, > setting up a syscon for IMEM as Bjorn had requested earlier). > > All is working well so far! > > The one thing I was working on supporting with my own version that > seems to be missing here are for devices that use string based codes, > rather then magic numbers. > > This was mostly a theoretical issue. I think the Galaxy Nexus used it= , > and when I was looking at some of the HTC devices, they support a tex= t > based reason along with the magic code, but at least in some > implementations the text mode isn't used, so I suspect there its just > for extra debugging. So this may not be critical to solve until > someone tries to add support for such a device. > > Anyway, I'm going to look at porting this to the HiKey board next > (which just uses reserved ram, not syscon), so I'll try to do a an > SRAM driver implementaiton to see how that goes. > > thanks! > -john > > > > Very glad to hear news from you. And welcome your SRAM based driver=20 implementation. From mboxrd@z Thu Jan 1 00:00:00 1970 From: andy.yan@rock-chips.com (Andy Yan) Date: Tue, 19 Jan 2016 16:38:20 +0800 Subject: [PATCH v2 2/4] power: reset: add reboot mode driver In-Reply-To: References: <1452598029-8222-1-git-send-email-andy.yan@rock-chips.com> <1452598319-8324-1-git-send-email-andy.yan@rock-chips.com> Message-ID: <569DF5FC.1080402@rock-chips.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi John: On 2016?01?16? 04:27, John Stultz wrote: > On Tue, Jan 12, 2016 at 3:31 AM, Andy Yan wrote: >> This driver parse the reboot commands like "reboot loader" >> and "reboot recovery" to get a boot mode described in the >> device tree , then call the write interfae to store the boot >> mode in some persistent storage like special register or ram, >> which can be read by the bootloader after system reboot, then >> the bootloader can take different action according to the mode >> stored. >> >> This is commonly used on Android based devices, which in order >> to reboot the device into fastboot or recovery mode. >> >> Signed-off-by: Andy Yan > > Hey Andy! > Thanks for keeping this work going! I've just successfully reworked > my Nexus7 tree to use your implementation (using the syscon version, > setting up a syscon for IMEM as Bjorn had requested earlier). > > All is working well so far! > > The one thing I was working on supporting with my own version that > seems to be missing here are for devices that use string based codes, > rather then magic numbers. > > This was mostly a theoretical issue. I think the Galaxy Nexus used it, > and when I was looking at some of the HTC devices, they support a text > based reason along with the magic code, but at least in some > implementations the text mode isn't used, so I suspect there its just > for extra debugging. So this may not be critical to solve until > someone tries to add support for such a device. > > Anyway, I'm going to look at porting this to the HiKey board next > (which just uses reserved ram, not syscon), so I'll try to do a an > SRAM driver implementaiton to see how that goes. > > thanks! > -john > > > > Very glad to hear news from you. And welcome your SRAM based driver implementation. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932637AbcASIi3 (ORCPT ); Tue, 19 Jan 2016 03:38:29 -0500 Received: from regular1.263xmail.com ([211.150.99.130]:50124 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757322AbcASIi0 (ORCPT ); Tue, 19 Jan 2016 03:38:26 -0500 X-263anti-spam: KSV:0;BIG:0;ABS:1;DNS:S;ATT:S;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-MAE-MAIL_UID: 00569df5fc01d7a4@maes@c4470be435b7fd8a X-MAE-ID: 223.6.254.61 X-RL-SENDER: andy.yan@rock-chips.com X-LOGIN-NAME: andy.yan@rock-chips.com X-SENDER-IP: 121.15.173.1 Subject: Re: [PATCH v2 2/4] power: reset: add reboot mode driver To: John Stultz References: <1452598029-8222-1-git-send-email-andy.yan@rock-chips.com> <1452598319-8324-1-git-send-email-andy.yan@rock-chips.com> Cc: =?UTF-8?Q?Heiko_St=c3=bcbner?= , Arnd Bergmann , linux@roeck-us.net, Kumar Gala , Ian Campbell , Rob Herring , Catalin Marinas , geert+renesas@glider.be, sre@kernel.org, Olof Johansson , dbaryshkov@gmail.com, Alexandre Belloni , jun.nie@linaro.org, =?UTF-8?Q?Pawe=c5=82_Moll?= , f.fainelli@gmail.com, Will Deacon , linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, Linux PM list , Russell King - ARM Linux , "linux-arm-kernel@lists.infradead.org" , lorenzo.pieralisi@arm.com, moritz.fischer@ettus.com, cernekee@gmail.com, lkml , dwmw2@infradead.org, Mark Rutland , maxime.ripard@free-electrons.com, Bjorn Andersson From: Andy Yan Message-ID: <569DF5FC.1080402@rock-chips.com> Date: Tue, 19 Jan 2016 16:38:20 +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: 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 John: On 2016年01月16日 04:27, John Stultz wrote: > On Tue, Jan 12, 2016 at 3:31 AM, Andy Yan wrote: >> This driver parse the reboot commands like "reboot loader" >> and "reboot recovery" to get a boot mode described in the >> device tree , then call the write interfae to store the boot >> mode in some persistent storage like special register or ram, >> which can be read by the bootloader after system reboot, then >> the bootloader can take different action according to the mode >> stored. >> >> This is commonly used on Android based devices, which in order >> to reboot the device into fastboot or recovery mode. >> >> Signed-off-by: Andy Yan > > Hey Andy! > Thanks for keeping this work going! I've just successfully reworked > my Nexus7 tree to use your implementation (using the syscon version, > setting up a syscon for IMEM as Bjorn had requested earlier). > > All is working well so far! > > The one thing I was working on supporting with my own version that > seems to be missing here are for devices that use string based codes, > rather then magic numbers. > > This was mostly a theoretical issue. I think the Galaxy Nexus used it, > and when I was looking at some of the HTC devices, they support a text > based reason along with the magic code, but at least in some > implementations the text mode isn't used, so I suspect there its just > for extra debugging. So this may not be critical to solve until > someone tries to add support for such a device. > > Anyway, I'm going to look at porting this to the HiKey board next > (which just uses reserved ram, not syscon), so I'll try to do a an > SRAM driver implementaiton to see how that goes. > > thanks! > -john > > > > Very glad to hear news from you. And welcome your SRAM based driver implementation.