From: paulius.zaleckas@gmail.com (Paulius Zaleckas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Fix AT91SAM9G20 reset
Date: Wed, 09 Dec 2009 16:09:33 +0200 [thread overview]
Message-ID: <4B1FAF9D.9050506@gmail.com> (raw)
In-Reply-To: <20091209135048.GA30670@turtle.localnet>
On 12/09/2009 03:50 PM, Peter Horton wrote:
> Fix AT91SAM9G20 reset as per the errata in the data sheet.
>
> If the SDRAM is not cleanly shutdown before reset it can be left driving
> the bus, which then stops the bootloader booting from NAND.
>
> Signed-off-by: Peter Horton<phorton@bitbox.co.uk>
> --
>
[...]
> Index: linux-2.6.32/arch/arm/mach-at91/at91sam9g20_reset.S
> ===================================================================
> --- /dev/null 1970-01-01 00:00:00.000000000 +0000
> +++ linux-2.6.32/arch/arm/mach-at91/at91sam9g20_reset.S 2009-12-09 13:33:28.000000000 +0000
> @@ -0,0 +1,52 @@
> +/*
> + * (C) BitBox Ltd 2009
> + *
> + * reset AT91SAM9G20 as per errata
> + *
> + * unless the SDRAM is cleanly shutdown before we hit the
> + * reset register it can be left driving the data bus and
> + * killing the chance of a subsequent boot from NAND
> + */
> +
> +#define CP15_CR_I (1<< 12)
> +
> +#define SYS_VIRT_OFS (-0x01000000)
> +
> +#define SDRAMC_BASE (SYS_VIRT_OFS + 0xffffea00)
> +#define SDRAMC_TR 0x0004
> +#define SDRAMC_LPR 0x0010
> +#define SDRAMC_LPCB_POWER_DOWN 2
> +
> +#define RSTC_BASE (SYS_VIRT_OFS + 0xfffffd00)
> +#define RSTC_CR 0x0000
> +#define RSTC_PROCRST (1<< 0)
> +#define RSTC_PERRST (1<< 2)
> +#define RSTC_KEY (0xa5<< 24)
> +
> + .arm
> +
> + .globl at91sam9g20_reset
> +
> +at91sam9g20_reset: mov r0, #0
> + mcr p15, 0, r0, c7, c5, 0 @ flush I-cache
> +
> + mrc p15, 0, r0, c1, c0, 0
> + orr r0, r0, #CP15_CR_I
> + mcr p15, 0, r0, c1, c0, 0 @ enable I-cache
> +
> + ldr r0, =SDRAMC_BASE @ preload constants
> + ldr r1, =RSTC_BASE
> +
> + mov r2, #1
> + mov r3, #SDRAMC_LPCB_POWER_DOWN
> + ldr r4, =RSTC_KEY | RSTC_PERRST | RSTC_PROCRST
> +
> + .balign 32 @ align to cache line
> +
> + str r2, [r0, #SDRAMC_TR] @ disable SDRAM access
> + str r3, [r0, #SDRAMC_LPR] @ power down SDRAM
> + str r4, [r1, #RSTC_CR] @ reset processor
> +
> + b .
> +
> +/* vi:set ft=ignore ai: */
Please remove the vi bits.
next prev parent reply other threads:[~2009-12-09 14:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-09 13:50 [PATCH] Fix AT91SAM9G20 reset Peter Horton
2009-12-09 14:09 ` Paulius Zaleckas [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-12-15 9:59 Peter Horton
2010-04-13 8:31 Peter Horton
2010-05-28 15:37 Peter Horton
2010-06-21 14:30 ` Lucas
2010-06-21 15:14 ` Peter Horton
2010-10-14 13:34 ` Nicolas Ferre
2010-10-14 15:31 ` Peter Horton
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=4B1FAF9D.9050506@gmail.com \
--to=paulius.zaleckas@gmail.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).