From: plagnioj@jcrosoft.com (Jean-Christophe PLAGNIOL-VILLARD)
To: linux-arm-kernel@lists.infradead.org
Subject: AT91: How copy kernel code to SRAM and execute?
Date: Mon, 27 Feb 2012 04:40:49 +0100 [thread overview]
Message-ID: <20120227034049.GB3318@game.jcrosoft.org> (raw)
In-Reply-To: <4F4A9B8F.9070803@emagii.com>
On 21:52 Sun 26 Feb , ARM Linux wrote:
> On 2012-02-26 19:44, Jean-Christophe PLAGNIOL-VILLARD wrote:
> >On 18:37 Sun 26 Feb , ARM Linux wrote:
> >>I am looking for some examples on how to copy a small piece of kernel code
> >>to internal SRAM and then execute it.
> >>
> >>Why?
> >>If you want to restart, you execute the "/sbin/reboot" command
> >>which will eventually call the "arch_reset" function, which in the AT91
> >>case will write to a "user reset" register.
> >>
> >>The problem is that the chip may reset in the middle of an SDRAM
> >>read transfer.
> >>The SDRAM will see it's clock stopped and will continue to drive the bus.
> >>
> >>When the ROM bootloader tries to access any boot memory (Parallel
> >>flash or NAND flash)
> >>on the parallel bus, there will be a bus conflict between the boot
> >>memory and the SDRAM,
> >>and the bootROM will not properly detect the boot program, and will enter
> >>an In System Programming mode.
> >>
> >>This is described in the SAM9G20 datasheet, but is probably valid
> >>for all older generation AT91 devices as well.
> >>
> >>The workaround seems to be to turn off the SDRAM and then do the reset.
> >>Obviously you cannot read instructions from SDRAM after it has been
> >>turned off.
> >>
> > Which version of the kernel do you use?
> >
> On 2012-02-26 19:44, Jean-Christophe PLAGNIOL-VILLARD wrote:
> >On 18:37 Sun 26 Feb , ARM Linux wrote:
> >>I am looking for some examples on how to copy a small piece of kernel code
> >>to internal SRAM and then execute it.
> >>
> >>Why?
> >>If you want to restart, you execute the "/sbin/reboot" command
> >>which will eventually call the "arch_reset" function, which in the AT91
> >>case will write to a "user reset" register.
> >>
> >>The problem is that the chip may reset in the middle of an SDRAM
> >>read transfer.
> >>The SDRAM will see it's clock stopped and will continue to drive the bus.
> >>
> >>When the ROM bootloader tries to access any boot memory (Parallel
> >>flash or NAND flash)
> >>on the parallel bus, there will be a bus conflict between the boot
> >>memory and the SDRAM,
> >>and the bootROM will not properly detect the boot program, and will enter
> >>an In System Programming mode.
> >>
> >>This is described in the SAM9G20 datasheet, but is probably valid
> >>for all older generation AT91 devices as well.
> >>
> >>The workaround seems to be to turn off the SDRAM and then do the reset.
> >>Obviously you cannot read instructions from SDRAM after it has been
> >>turned off.
> >>
> > Which version of the kernel do you use?
> >
> > There is no need to put the code in the sram, you just need to put the
> > code in cached before shutdown the SDRAM/DDR
> >
>
> The vanilla 2.6.30 from linux4sam, but it is using a patchset from a
> customer.
> I don't think it is an option to change kernel version right now.
> Cache is turned off in this version.
so turn it on run the code from sram is wrong solution here
I do not do this on mainline
just use the fix we use here
Best Regards,
J.
prev parent reply other threads:[~2012-02-27 3:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-26 17:37 AT91: How copy kernel code to SRAM and execute? ARM Linux
2012-02-26 17:50 ` Russell King - ARM Linux
2012-02-26 20:48 ` Ulf Samuelsson
2012-02-26 21:05 ` Russell King - ARM Linux
2012-02-27 3:42 ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-26 18:44 ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-26 20:52 ` ARM Linux
2012-02-27 3:40 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
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=20120227034049.GB3318@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).