linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* ARM926 Software reset problems
@ 2009-11-13 11:32 Ricardo Martínez
  2009-11-13 12:20 ` Russell King - ARM Linux
  0 siblings, 1 reply; 7+ messages in thread
From: Ricardo Martínez @ 2009-11-13 11:32 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all,
 
I'm trying to soft reset an ARM926EJ.
 
I'm using 
    cpu_arm926_reset(ulong address) function which:
           - flushes I/D caches
            - jumps to "address", whose value in my case is NOR flash base
address where U-Boot stays (after remapping).
 
    But it sometimes work, but most times hangs. Can this be caused by MMU
not being switched off? 
 
Any other hints?
 
If you think it might be caused by MMU, how can MMU be disabled?
 
Is there any other prefered method to soft reboot ARM926 from Linux? I've
taken a look at some PXA, OMAP & AT91 code about soft rebooting. It seems
they use Watchdog timer to reset, but my CPU does not have a watchdog.
 
Thanks in advance,
Ricardo Martinez
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* ARM926 Software reset problems
  2009-11-13 11:32 ARM926 Software reset problems Ricardo Martínez
@ 2009-11-13 12:20 ` Russell King - ARM Linux
  2009-11-13 14:41   ` Ricardo Martínez
  0 siblings, 1 reply; 7+ messages in thread
From: Russell King - ARM Linux @ 2009-11-13 12:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 13, 2009 at 12:32:16PM +0100, Ricardo Mart?nez wrote:
> I'm using 
>     cpu_arm926_reset(ulong address) function which:
>            - flushes I/D caches
>             - jumps to "address", whose value in my case is NOR flash base
> address where U-Boot stays (after remapping).

You should not be using this directly.  Software rebooting has a specific
sequence, and the above is the very last step.

>     But it sometimes work, but most times hangs. Can this be caused by MMU
> not being switched off? 

cpu_arm926_reset() turns the MMU and caches off.

> Is there any other prefered method to soft reboot ARM926 from Linux? I've
> taken a look at some PXA, OMAP & AT91 code about soft rebooting. It seems
> they use Watchdog timer to reset, but my CPU does not have a watchdog.

Don't call cpu_arm926_reset() directly.  Use kernel_restart() instead,
or even better the reboot syscall from userspace.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* ARM926 Software reset problems
  2009-11-13 12:20 ` Russell King - ARM Linux
@ 2009-11-13 14:41   ` Ricardo Martínez
  2009-11-13 14:51     ` Russell King - ARM Linux
  2009-11-13 14:59     ` Dieter Kiermaier
  0 siblings, 2 replies; 7+ messages in thread
From: Ricardo Martínez @ 2009-11-13 14:41 UTC (permalink / raw)
  To: linux-arm-kernel


Hi Russell,

Thanks for your help.

I'm one step further. kernel_restart() uses arch_reset() which is hardware
dependent.

Most ARM9 make arch_reset() through Watchdog peripheral. But the CPU I'm
using does not have Watchdog timer.

I was trying to find an alternative, based only on software, but It may be
not posible.

For example, in u-boot command line I can do reset just jumping back to
start of u-boot code. This is more or less what "cpu_arm926_reset" does, but
most times system hangs.

Thanks,
Ricardo Martinez


-----Mensaje original-----
De: Russell King - ARM Linux [mailto:linux at arm.linux.org.uk] 
Enviado el: viernes, 13 de noviembre de 2009 13:21
Para: Ricardo Mart?nez
CC: linux-arm-kernel at lists.infradead.org
Asunto: Re: ARM926 Software reset problems

On Fri, Nov 13, 2009 at 12:32:16PM +0100, Ricardo Mart?nez wrote:
> I'm using 
>     cpu_arm926_reset(ulong address) function which:
>            - flushes I/D caches
>             - jumps to "address", whose value in my case is NOR flash 
> base address where U-Boot stays (after remapping).

You should not be using this directly.  Software rebooting has a specific
sequence, and the above is the very last step.

>     But it sometimes work, but most times hangs. Can this be caused by 
> MMU not being switched off?

cpu_arm926_reset() turns the MMU and caches off.

> Is there any other prefered method to soft reboot ARM926 from Linux? 
> I've taken a look at some PXA, OMAP & AT91 code about soft rebooting. 
> It seems they use Watchdog timer to reset, but my CPU does not have a
watchdog.

Don't call cpu_arm926_reset() directly.  Use kernel_restart() instead, or
even better the reboot syscall from userspace.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* ARM926 Software reset problems
  2009-11-13 14:41   ` Ricardo Martínez
@ 2009-11-13 14:51     ` Russell King - ARM Linux
  2009-11-13 14:59     ` Dieter Kiermaier
  1 sibling, 0 replies; 7+ messages in thread
From: Russell King - ARM Linux @ 2009-11-13 14:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 13, 2009 at 03:41:17PM +0100, Ricardo Mart?nez wrote:
> I'm one step further. kernel_restart() uses arch_reset() which is hardware
> dependent.

kernel_restart() is not hardware dependent.  The backend of it (arch_reset)
is because platforms reboot in their own specific manner.  It is up to the
platform support implementer to make arch_reset() do the right thing on
their platform.

However, none of cpu_*reset nor arch_reset are intended to be called
directly.  You _MUST_ call kernel_restart() to initiate a restart.  No
other option will do - everything else is not supported and unreliable.

> Most ARM9 make arch_reset() through Watchdog peripheral. But the CPU I'm
> using does not have Watchdog timer.

So why are you trying to make arch_reset() work through a non-existent
watchdog?

Just point arch_reset() at cpu_reset() like this:

static void arch_reset(char mode, const char *cmd)
{
	cpu_reset(0);
}

as many other platforms do, and just call kernel_restart().

^ permalink raw reply	[flat|nested] 7+ messages in thread

* ARM926 Software reset problems
  2009-11-13 14:41   ` Ricardo Martínez
  2009-11-13 14:51     ` Russell King - ARM Linux
@ 2009-11-13 14:59     ` Dieter Kiermaier
  2009-11-13 16:31       ` Ricardo Martínez
  1 sibling, 1 reply; 7+ messages in thread
From: Dieter Kiermaier @ 2009-11-13 14:59 UTC (permalink / raw)
  To: linux-arm-kernel

Am Freitag 13 November 2009 15:41:17 schrieb Ricardo Mart?nez:
> 
> Hi Russell,
> 
> Thanks for your help.
> 
> I'm one step further. kernel_restart() uses arch_reset() which is hardware
> dependent.
> 
> Most ARM9 make arch_reset() through Watchdog peripheral. But the CPU I'm
> using does not have Watchdog timer.
> 
> I was trying to find an alternative, based only on software, but It may be
> not posible.
> 

Maybe there is another way. Please read the hardware manual careful.
I now it from my last CPU (netsilicon ARM 926) that you have to write e.g.
the CPU PLL register to fire a hardware reset.
What CPU are you using?

Dieter

> For example, in u-boot command line I can do reset just jumping back to
> start of u-boot code. This is more or less what "cpu_arm926_reset" does, but
> most times system hangs.
> 
> Thanks,
> Ricardo Martinez
> 
> 
> -----Mensaje original-----
> De: Russell King - ARM Linux [mailto:linux at arm.linux.org.uk] 
> Enviado el: viernes, 13 de noviembre de 2009 13:21
> Para: Ricardo Mart?nez
> CC: linux-arm-kernel at lists.infradead.org
> Asunto: Re: ARM926 Software reset problems
> 
> On Fri, Nov 13, 2009 at 12:32:16PM +0100, Ricardo Mart?nez wrote:
> > I'm using 
> >     cpu_arm926_reset(ulong address) function which:
> >            - flushes I/D caches
> >             - jumps to "address", whose value in my case is NOR flash 
> > base address where U-Boot stays (after remapping).
> 
> You should not be using this directly.  Software rebooting has a specific
> sequence, and the above is the very last step.
> 
> >     But it sometimes work, but most times hangs. Can this be caused by 
> > MMU not being switched off?
> 
> cpu_arm926_reset() turns the MMU and caches off.
> 
> > Is there any other prefered method to soft reboot ARM926 from Linux? 
> > I've taken a look at some PXA, OMAP & AT91 code about soft rebooting. 
> > It seems they use Watchdog timer to reset, but my CPU does not have a
> watchdog.
> 
> Don't call cpu_arm926_reset() directly.  Use kernel_restart() instead, or
> even better the reboot syscall from userspace.
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* ARM926 Software reset problems
  2009-11-13 14:59     ` Dieter Kiermaier
@ 2009-11-13 16:31       ` Ricardo Martínez
  2009-11-13 16:37         ` Russell King - ARM Linux
  0 siblings, 1 reply; 7+ messages in thread
From: Ricardo Martínez @ 2009-11-13 16:31 UTC (permalink / raw)
  To: linux-arm-kernel

 
Thanks very much

Russell: now it works, thank you very much. But ... it is still under test
because it sometimes hangs. For example, if I "flashcp" and overwrite
"uImage" and then reboot, it usually hangs. And upgrading kernel image is
something needed (not really often, of course) by my application.

Dieter: CPU is application specific, from a small vendor. Now, reset is
asserted by an external component, an FPGA. CPU writes a command throug SPI
in this FPGA and FPGA asserts RESET line. We want to get rid of any external
components for reset.

Thanks
Ricardo Martinez


-----Mensaje original-----
De: Dieter Kiermaier [mailto:dk-arm-linux at gmx.de] 
Enviado el: viernes, 13 de noviembre de 2009 16:00
Para: linux-arm-kernel at lists.infradead.org
CC: Ricardo Mart?nez
Asunto: Re: ARM926 Software reset problems

Am Freitag 13 November 2009 15:41:17 schrieb Ricardo Mart?nez:
> 
> Hi Russell,
> 
> Thanks for your help.
> 
> I'm one step further. kernel_restart() uses arch_reset() which is 
> hardware dependent.
> 
> Most ARM9 make arch_reset() through Watchdog peripheral. But the CPU 
> I'm using does not have Watchdog timer.
> 
> I was trying to find an alternative, based only on software, but It 
> may be not posible.
> 

Maybe there is another way. Please read the hardware manual careful.
I now it from my last CPU (netsilicon ARM 926) that you have to write e.g.
the CPU PLL register to fire a hardware reset.
What CPU are you using?

Dieter

> For example, in u-boot command line I can do reset just jumping back 
> to start of u-boot code. This is more or less what "cpu_arm926_reset" 
> does, but most times system hangs.
> 
> Thanks,
> Ricardo Martinez
> 
> 
> -----Mensaje original-----
> De: Russell King - ARM Linux [mailto:linux at arm.linux.org.uk] Enviado 
> el: viernes, 13 de noviembre de 2009 13:21
> Para: Ricardo Mart?nez
> CC: linux-arm-kernel at lists.infradead.org
> Asunto: Re: ARM926 Software reset problems
> 
> On Fri, Nov 13, 2009 at 12:32:16PM +0100, Ricardo Mart?nez wrote:
> > I'm using 
> >     cpu_arm926_reset(ulong address) function which:
> >            - flushes I/D caches
> >             - jumps to "address", whose value in my case is NOR 
> > flash base address where U-Boot stays (after remapping).
> 
> You should not be using this directly.  Software rebooting has a 
> specific sequence, and the above is the very last step.
> 
> >     But it sometimes work, but most times hangs. Can this be caused 
> > by MMU not being switched off?
> 
> cpu_arm926_reset() turns the MMU and caches off.
> 
> > Is there any other prefered method to soft reboot ARM926 from Linux? 
> > I've taken a look at some PXA, OMAP & AT91 code about soft rebooting. 
> > It seems they use Watchdog timer to reset, but my CPU does not have 
> > a
> watchdog.
> 
> Don't call cpu_arm926_reset() directly.  Use kernel_restart() instead, 
> or even better the reboot syscall from userspace.
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* ARM926 Software reset problems
  2009-11-13 16:31       ` Ricardo Martínez
@ 2009-11-13 16:37         ` Russell King - ARM Linux
  0 siblings, 0 replies; 7+ messages in thread
From: Russell King - ARM Linux @ 2009-11-13 16:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 13, 2009 at 05:31:44PM +0100, Ricardo Mart?nez wrote:
> Russell: now it works, thank you very much. But ... it is still under test
> because it sometimes hangs. For example, if I "flashcp" and overwrite
> "uImage" and then reboot, it usually hangs. And upgrading kernel image is
> something needed (not really often, of course) by my application.

Does flashcp leave the flash in status-read mode?  Does flashcp use
the mtd devices to access the flash?

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-11-13 16:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-13 11:32 ARM926 Software reset problems Ricardo Martínez
2009-11-13 12:20 ` Russell King - ARM Linux
2009-11-13 14:41   ` Ricardo Martínez
2009-11-13 14:51     ` Russell King - ARM Linux
2009-11-13 14:59     ` Dieter Kiermaier
2009-11-13 16:31       ` Ricardo Martínez
2009-11-13 16:37         ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).