diff mbox

ARM: shmobile: kzm9g: enable restarting

Message ID 1342764990-30715-1-git-send-email-koba@kmckk.co.jp (mailing list archive)
State Superseded
Headers show

Commit Message

Tetsuyuki Kobayashi July 20, 2012, 6:16 a.m. UTC
From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>

Do soft-power-on-reset in sys_reboot system call.

How to test this patch
  Execute "sudo reboot" from command line. The system will start shutdown
  sequence and finally reboot and U-Boot restarts.

Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Simon Horman <horms@verge.net.au>
Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
---
This patch is based on renesas.git next branch.

 arch/arm/mach-shmobile/board-kzm9g.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Simon Horman July 23, 2012, 1:21 a.m. UTC | #1
On Fri, Jul 20, 2012 at 03:16:30PM +0900, Tetsuyuki Kobayshi wrote:
> From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
> 
> Do soft-power-on-reset in sys_reboot system call.
> 
> How to test this patch
>   Execute "sudo reboot" from command line. The system will start shutdown
>   sequence and finally reboot and U-Boot restarts.

Hi Kobayashi-san,

I am testing using Iwamatsu-san's uboot which can be found at
http://git.denx.de/?p=u-boot/u-boot-sh.git

I am using the next branch of Rafael's renesas branch,
commit 45c7a01f070146e08f5c838315ffca5ade6e3844 ("Merge branch
'renesas-marzen' into renesas-board").

I am using the default config with the following also enabled.

	CONFIG_ARM_APPENDED_DTB=y
	CONFIG_CMDLINE_FORCE=y

This patch seems to work fine when booting a uImage from uBoot using
bootp;bootm.  But it seems to prevent the board from booting a zImage from
uBoot using bootp;bootz.  I am unsure why.

Note that I am referring to the first boot: a cold start.
Not booting for a second time after issuing the reboot command in Linux.

> Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Cc: Simon Horman <horms@verge.net.au>
> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
> ---
> This patch is based on renesas.git next branch.
> 
>  arch/arm/mach-shmobile/board-kzm9g.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
> index 53b7ea9..fd21fb6 100644
> --- a/arch/arm/mach-shmobile/board-kzm9g.c
> +++ b/arch/arm/mach-shmobile/board-kzm9g.c
> @@ -763,6 +763,13 @@ static void __init kzm_init(void)
>  	platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));
>  }
>  
> +static void kzm9g_restart(char mode, const char *cmd)
> +{
> +#define RESCNT2 0xe6188020
> +	/* Do soft power on reset */
> +	writel((1 << 31), RESCNT2);
> +}
> +
>  static const char *kzm9g_boards_compat_dt[] __initdata = {
>  	"renesas,kzm9g",
>  	NULL,
> @@ -777,5 +784,6 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g")
>  	.init_machine	= kzm_init,
>  	.init_late	= shmobile_init_late,
>  	.timer		= &shmobile_timer,
> +	.restart	= kzm9g_restart,
>  	.dt_compat	= kzm9g_boards_compat_dt,
>  MACHINE_END
> -- 
> 1.7.9.5
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tetsuyuki Kobayashi July 23, 2012, 2:37 a.m. UTC | #2
Thank you, Simon-san.
I have never used bootz command to boot zImage. I will try it.

(2012/07/23 10:21), Simon Horman wrote:
> On Fri, Jul 20, 2012 at 03:16:30PM +0900, Tetsuyuki Kobayshi wrote:
>> From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
>>
>> Do soft-power-on-reset in sys_reboot system call.
>>
>> How to test this patch
>>    Execute "sudo reboot" from command line. The system will start shutdown
>>    sequence and finally reboot and U-Boot restarts.
>
> Hi Kobayashi-san,
>
> I am testing using Iwamatsu-san's uboot which can be found at
> http://git.denx.de/?p=u-boot/u-boot-sh.git
>
> I am using the next branch of Rafael's renesas branch,
> commit 45c7a01f070146e08f5c838315ffca5ade6e3844 ("Merge branch
> 'renesas-marzen' into renesas-board").
>
> I am using the default config with the following also enabled.
>
> 	CONFIG_ARM_APPENDED_DTB=y
> 	CONFIG_CMDLINE_FORCE=y
>
> This patch seems to work fine when booting a uImage from uBoot using
> bootp;bootm.  But it seems to prevent the board from booting a zImage from
> uBoot using bootp;bootz.  I am unsure why.
>
> Note that I am referring to the first boot: a cold start.
> Not booting for a second time after issuing the reboot command in Linux.
>
>> Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
>> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>> Cc: Simon Horman <horms@verge.net.au>
>> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
>> ---
>> This patch is based on renesas.git next branch.
>>
>>   arch/arm/mach-shmobile/board-kzm9g.c |    8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
>> index 53b7ea9..fd21fb6 100644
>> --- a/arch/arm/mach-shmobile/board-kzm9g.c
>> +++ b/arch/arm/mach-shmobile/board-kzm9g.c
>> @@ -763,6 +763,13 @@ static void __init kzm_init(void)
>>   	platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));
>>   }
>>
>> +static void kzm9g_restart(char mode, const char *cmd)
>> +{
>> +#define RESCNT2 0xe6188020
>> +	/* Do soft power on reset */
>> +	writel((1 << 31), RESCNT2);
>> +}
>> +
>>   static const char *kzm9g_boards_compat_dt[] __initdata = {
>>   	"renesas,kzm9g",
>>   	NULL,
>> @@ -777,5 +784,6 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g")
>>   	.init_machine	= kzm_init,
>>   	.init_late	= shmobile_init_late,
>>   	.timer		= &shmobile_timer,
>> +	.restart	= kzm9g_restart,
>>   	.dt_compat	= kzm9g_boards_compat_dt,
>>   MACHINE_END
>> --
>> 1.7.9.5
>>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tetsuyuki Kobayashi July 23, 2012, 8:47 a.m. UTC | #3
Hi, Simon-san

I tried bootz command to boot zImage with dtb.
I used tftpboot instead of bootp.
It works fine with me with/without this patch.


(2012/07/23 11:37), Tetsuyuki Kobayashi wrote:
> Thank you, Simon-san.
> I have never used bootz command to boot zImage. I will try it.
>
> (2012/07/23 10:21), Simon Horman wrote:
>> On Fri, Jul 20, 2012 at 03:16:30PM +0900, Tetsuyuki Kobayshi wrote:
>>> From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
>>>
>>> Do soft-power-on-reset in sys_reboot system call.
>>>
>>> How to test this patch
>>>    Execute "sudo reboot" from command line. The system will start
>>> shutdown
>>>    sequence and finally reboot and U-Boot restarts.
>>
>> Hi Kobayashi-san,
>>
>> I am testing using Iwamatsu-san's uboot which can be found at
>> http://git.denx.de/?p=u-boot/u-boot-sh.git
>>
>> I am using the next branch of Rafael's renesas branch,
>> commit 45c7a01f070146e08f5c838315ffca5ade6e3844 ("Merge branch
>> 'renesas-marzen' into renesas-board").
>>
>> I am using the default config with the following also enabled.
>>
>>     CONFIG_ARM_APPENDED_DTB=y
>>     CONFIG_CMDLINE_FORCE=y
>>
>> This patch seems to work fine when booting a uImage from uBoot using
>> bootp;bootm.  But it seems to prevent the board from booting a zImage
>> from
>> uBoot using bootp;bootz.  I am unsure why.
>>
>> Note that I am referring to the first boot: a cold start.
>> Not booting for a second time after issuing the reboot command in Linux.
>>
>>> Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
>>> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>>> Cc: Simon Horman <horms@verge.net.au>
>>> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
>>> ---
>>> This patch is based on renesas.git next branch.
>>>
>>>   arch/arm/mach-shmobile/board-kzm9g.c |    8 ++++++++
>>>   1 file changed, 8 insertions(+)
>>>
>>> diff --git a/arch/arm/mach-shmobile/board-kzm9g.c
>>> b/arch/arm/mach-shmobile/board-kzm9g.c
>>> index 53b7ea9..fd21fb6 100644
>>> --- a/arch/arm/mach-shmobile/board-kzm9g.c
>>> +++ b/arch/arm/mach-shmobile/board-kzm9g.c
>>> @@ -763,6 +763,13 @@ static void __init kzm_init(void)
>>>       platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));
>>>   }
>>>
>>> +static void kzm9g_restart(char mode, const char *cmd)
>>> +{
>>> +#define RESCNT2 0xe6188020
>>> +    /* Do soft power on reset */
>>> +    writel((1 << 31), RESCNT2);
>>> +}
>>> +
>>>   static const char *kzm9g_boards_compat_dt[] __initdata = {
>>>       "renesas,kzm9g",
>>>       NULL,
>>> @@ -777,5 +784,6 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g")
>>>       .init_machine    = kzm_init,
>>>       .init_late    = shmobile_init_late,
>>>       .timer        = &shmobile_timer,
>>> +    .restart    = kzm9g_restart,
>>>       .dt_compat    = kzm9g_boards_compat_dt,
>>>   MACHINE_END
>>> --
>>> 1.7.9.5
>>>
>>
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Simon Horman July 23, 2012, 8:57 a.m. UTC | #4
On Mon, Jul 23, 2012 at 05:47:07PM +0900, Tetsuyuki Kobayashi wrote:
> Hi, Simon-san
> 
> I tried bootz command to boot zImage with dtb.
> I used tftpboot instead of bootp.
> It works fine with me with/without this patch.

Thanks, I guess that there was something wrong with my test.

Acked-by: Simon Horman <horms@verge.net.au>
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Simon Horman Aug. 25, 2012, 6:17 a.m. UTC | #5
On Mon, Jul 23, 2012 at 05:57:36PM +0900, Simon Horman wrote:
> On Mon, Jul 23, 2012 at 05:47:07PM +0900, Tetsuyuki Kobayashi wrote:
> > Hi, Simon-san
> > 
> > I tried bootz command to boot zImage with dtb.
> > I used tftpboot instead of bootp.
> > It works fine with me with/without this patch.
> 
> Thanks, I guess that there was something wrong with my test.

Hi Kobayashi-san,

I have queued this change up in the kzm9g branch of my renesas tree,
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git

I will endeavour to get it included in 3.7.

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index 53b7ea9..fd21fb6 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -763,6 +763,13 @@  static void __init kzm_init(void)
 	platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));
 }
 
+static void kzm9g_restart(char mode, const char *cmd)
+{
+#define RESCNT2 0xe6188020
+	/* Do soft power on reset */
+	writel((1 << 31), RESCNT2);
+}
+
 static const char *kzm9g_boards_compat_dt[] __initdata = {
 	"renesas,kzm9g",
 	NULL,
@@ -777,5 +784,6 @@  DT_MACHINE_START(KZM9G_DT, "kzm9g")
 	.init_machine	= kzm_init,
 	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
+	.restart	= kzm9g_restart,
 	.dt_compat	= kzm9g_boards_compat_dt,
 MACHINE_END