All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] intended behavior of bootm
Date: Mon, 21 Apr 2008 17:43:18 +0200	[thread overview]
Message-ID: <200804211743.19114.matthias.fuchs@esd-electronics.com> (raw)
In-Reply-To: <480CAFD5.7070804@ge.com>

Hi Jerry,

On Monday 21 April 2008 17:16, Jerry Van Baren wrote:
> Matthias Fuchs wrote:
> > Hi,
> > 
> > after going through the boom code I found out, that
> > setting the 'autostart' variable to 'no' brings me a little closer
> > to what I want. But finally I end up
> > in the enable_interrupts() at the very end of do_bootm(). This freezes
> > my system. The reason for this is the Linux kernel image that is loaded to address 0
> > and that overwrites the vector table. So reenabling the interrupts in U-Boot with
> > Linux interrupt table is a bad idea.
> 
> No, having your (u-boot) interrupt go off while booting linux is a bad idea.
U-Boot calls disable_interrupt() in do_bootm(). That's fact.

> 
> Which interrupt is going off?  Why is it going off (why isn't the 
> hardware put into a quiescent state)?
> 
> > So what's the best idea to fix this? I could copy the vector table onto the stack
> > in do_bootm() and copy it back just before reenabling the interrupts.
> 
> NO NO NO.
At least this works :-)

> 
> > Any better idea?
> > 
> > Matthias
> 
> That a u-boot initialized interrupt is occurring is wrong and needs to 
> be fixed.
> * Traditionally, u-boot does not use interrupts for anything, thus this 
> isn't a problem.
> 
> * Proper hardware and device driver convention is that the hardware must 
> be quiescent when linux is started and the linux device driver must 
> (re)configure that hardware the way it wants/needs.  Obviously, this is 
> probably a 95% rule (console I/O, memory initialization, some others may 
> violate this rule for practical reasons).
> 
> * If your u-boot enables interrupt(s), you MUST disable the interrupt 
> source before starting linux.  There is NO graceful way of getting linux 
> to handle an interrupt that was a result of u-boot's running.  Starting 
> linux with interrupts disabled is not a good solution - you may get 
> lucky but leaving an active interrupt source is a dangerous game.  At 
> best, it is a race condition that you may happen to win today.
So this means that U-Boot calling disable_interrupts before booting Linux (see do_bootm)
is correct. Later my the kernel images is loaded at address 0. This overwrites all U-Boot vectors
in the first 16k of RAM. So when after the kernel is loaded to address 0 and the ramdisk 
CRC checking failed to control is to be passed back to U-Boot it sees a mixed up vector table.
I think the only ways to fix this is to save the table (as I did for testing) or check the ramdisk
images before uncompressing the kernel at address 0.

Except from that I just noticed that 'autostart=no' does not help me, because it completely disables booting
the kernel from bootm.

So how can I achive this:

bootm $(kernel_addr_in_flash) $(randisk_addr_in_flash); run load_images_from_usb_to_ram; bootm $(kernel_addr_in_ram) $(ramdisk_addr_in_ram)

So the the initial bootm fails because of invalid images, U-Boot should load images from a USB media and start them.

Matthias

  reply	other threads:[~2008-04-21 15:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-21 13:09 [U-Boot-Users] intended behavior of bootm Matthias Fuchs
2008-04-21 14:58 ` Matthias Fuchs
2008-04-21 15:16   ` Jerry Van Baren
2008-04-21 15:43     ` Matthias Fuchs [this message]
2008-04-21 16:28       ` Jerry Van Baren
2008-04-21 19:19 ` Wolfgang Denk
2008-04-21 21:02   ` Matthias Fuchs
2008-04-22 20:49     ` Wolfgang Denk
2008-04-23  8:43       ` Matthias Fuchs

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=200804211743.19114.matthias.fuchs@esd-electronics.com \
    --to=matthias.fuchs@esd-electronics.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.