AT91 reboot code

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Wed Nov 2 11:41:02 EDT 2011


On 15:12 Wed 02 Nov     , Russell King - ARM Linux wrote:
> On Wed, Nov 02, 2011 at 02:59:03PM +0000, Russell King - ARM Linux wrote:
> > On Wed, Nov 02, 2011 at 07:43:28AM +0200, Andrew Victor wrote:
> > > hi Russell,
> > > 
> > > > Is there any reason this can't just be:
> > > >
> > > > void (*arch_reset)(char mode, const char *cmd);
> > > 
> > > I don't see any reason why not, except if arch_reset() can be called
> > > early in the setup code (before the platform initialization).
> > 
> > There is a case where it could happen - that is if you panic and you
> > have a non-zero panic timeout.
> > 
> > However, if you don't know how to restart your machine, then you're not
> > going to be able to do anything.  I'd therefore suggest this patch:
> 
> And we can do one better with this given the size of this change.
> As all the AT91 reset handlers are using a hardware method, we can
> do without the arm_machine_restart() indirection too.  And we can
> get rid of the icache enable in the assembly restart code as this
> will now be the case.  This is a replacement patch for the previous.
> 
> I've taken the liberty to rename _reset to _restart as well, so we
> have a common naming for this operation across converted platforms.
> 
>  arch/arm/mach-at91/at91cap9.c            |    4 ++--
>  arch/arm/mach-at91/at91rm9200.c          |    4 ++--
>  arch/arm/mach-at91/at91sam9260.c         |    2 +-
>  arch/arm/mach-at91/at91sam9261.c         |    2 +-
>  arch/arm/mach-at91/at91sam9263.c         |    2 +-
>  arch/arm/mach-at91/at91sam9_alt_reset.S  |    9 ++-------
>  arch/arm/mach-at91/at91sam9g45.c         |    4 ++--
>  arch/arm/mach-at91/at91sam9rl.c          |    2 +-
>  arch/arm/mach-at91/generic.h             |    3 +--
>  arch/arm/mach-at91/include/mach/system.h |    5 -----
>  10 files changed, 13 insertions(+), 24 deletions(-)
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>

I'll test it later this week

Best Regards,
J.



More information about the linux-arm-kernel mailing list