linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: plagnioj@jcrosoft.com (Jean-Christophe PLAGNIOL-VILLARD)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] ARM: at91: Fix at91sam9g45 and at91cap9 reset
Date: Wed, 30 Nov 2011 05:55:02 +0100	[thread overview]
Message-ID: <20111130045502.GA15008@game.jcrosoft.org> (raw)
In-Reply-To: <20111129221229.GQ9581@n2100.arm.linux.org.uk>

On 22:12 Tue 29 Nov     , Russell King - ARM Linux wrote:
> On Tue, Nov 29, 2011 at 06:52:41PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > +			.globl	at91sam9g45_restart
> > +
> > +at91sam9g45_restart:
> > +			ldr	r0, .at91_va_base_sdramc0	@ preload constants
> > +			ldr	r1, .at91_va_base_rstc_cr
> > +
> > +			mov	r2, #1
> > +			mov	r3, #AT91_DDRSDRC_LPCB_POWER_DOWN
> > +			ldr	r4, =AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST
> > +
> > +			.balign	32				@ align to cache line
> > +
> > +			str	r2, [r0, #AT91_DDRSDRC_RTR]	@ disable DDR0 access
> > +			str	r3, [r0, #AT91_DDRSDRC_LPR]	@ power down DDR0
> > +			str	r4, [r1]			@ reset processor
> > +
> > +			b	.
> > +
> > +.at91_va_base_sdramc0:
> > +	.word AT91_VA_BASE_SYS + AT91_DDRSDRC0
> 
> So is the only change between this new file and arch/arm/mach-at91/at91sam9_alt_reset.S
> this line above?
> 
> arch/arm/mach-at91/at91sam9_alt_reset.S has:
>         .word AT91_VA_BASE_SYS + AT91_SDRAMC0
> 
> Maybe the at91sam9_alt_reset.S version should take this as an argument so
> the errata fix can be re-used on different AT91 versions, rather than
> having to duplicate code just because one register address has changed.
its not only the register base address but also the registers offset

I get the same idea but at the end when I did it I end with more code
and the only patrt in common  are

ldr     r1, at91_va_base_rstc_cre
mov     r2, #1
ldr     r4, =AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST
str     r4, [r1]

so I chosse to split it

as if I want to do the second way I need to pass 5 params to the asm fucntion
and create one c function for sam9 and 9g45

Best Regards,
J.

  reply	other threads:[~2011-11-30  4:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-29 17:35 [PATCH 0/6] AT91 Reset cleanup Jean-Christophe PLAGNIOL-VILLARD
2011-11-29 17:42 ` Russell King - ARM Linux
2011-11-29 17:49   ` Jean-Christophe PLAGNIOL-VILLARD
2011-11-29 18:46   ` Marek Vasut
2011-11-29 19:07     ` Russell King - ARM Linux
2011-11-29 19:23       ` Marek Vasut
2011-11-29 22:07         ` Russell King - ARM Linux
2011-11-29 22:43           ` Marek Vasut
2011-11-29 22:48             ` Russell King - ARM Linux
2011-11-29 23:03               ` Marek Vasut
2011-11-30  4:46               ` Jean-Christophe PLAGNIOL-VILLARD
2011-11-29 17:52 ` [PATCH 1/6] ARM: at91: fix cap9 ddrsdr register Jean-Christophe PLAGNIOL-VILLARD
2011-11-29 17:52 ` [PATCH 2/6] ARM: at91: merge at91cap9_ddrsdr.h in at91sam9_ddrsdr.h Jean-Christophe PLAGNIOL-VILLARD
2011-11-29 17:52 ` [PATCH 3/6] ARM: at91: introduce AT91_SAM9_ALT_RESET to select the at91sam9 alternative reset Jean-Christophe PLAGNIOL-VILLARD
2011-11-29 17:52 ` [PATCH 4/6] ARM: restart: at91: use new restart hook Jean-Christophe PLAGNIOL-VILLARD
2011-11-29 17:52 ` [PATCH 5/6] ARM: at91: Fix at91sam9g45 and at91cap9 reset Jean-Christophe PLAGNIOL-VILLARD
2011-11-29 22:12   ` Russell King - ARM Linux
2011-11-30  4:55     ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2011-11-29 17:52 ` [PATCH 6/6] ARM: at91: make rstc soc independent Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111130045502.GA15008@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).