public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Wegner <wolfgang@leila.ping.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] interrupts in general / Fix for mcf5329evb - spurious interrupts on Linux/uClinux kernel boot
Date: Fri, 10 Aug 2007 22:22:04 +0200	[thread overview]
Message-ID: <20070810202204.GA7687@leila.ping.de> (raw)
In-Reply-To: <200708101515.00624.sr@denx.de>

Hi Stefan,

On Fri, Aug 10, 2007 at 03:15:00PM +0200, Stefan Roese wrote:
> On Friday 10 August 2007, Wolfgang Denk wrote:
> > > Please correct me if I am wrong, but should not interrupts be completely
> > > disabled before transferring control to the linux kernel to avoid any
> > > confusion?
> >
> > Right.
> 
> IIRC the function we are talking about here is do_bootm_linux() (m68k version) 
> which is called from the common do_bootm() function. Before calling 
> do_bootm_linux() the follwing code is called:
> 
>         /*
>          * We have reached the point of no return: we are going to
>          * overwrite all exception vector code, so we cannot easily
>          * recover from any failures any more...
>          */
> 
>         iflag = disable_interrupts();
> 
> So at the point of do_bootm_linux() the interrupts should already be off. If 
> this is not the case, then it is probably better to fix this in the 
> disable_interrupts implementation of the ColdFire.

you are completely right. Sorry for not recognizing the previous call
to disable_interrupts in the first place, I only had looked at
do_bootm_linux() itself.

In fact, I also tried calling disable_interrupts() before the call to the
kernel, and it did not work.

The problem is that disable_interrupts is in lib_m68k/interrupts.c and
simply sets the interrupt level mask to 0x7:
        sr = get_sr ();
        set_sr (sr | 0x0700);

interrupt_init() almost does the opposite:
int interrupt_init(void)
{
        volatile int0_t *intp = (int0_t *) (CFG_INTR_BASE);

        /* Make sure all interrupts are disabled */
        intp->imrh0 |= 0xFFFFFFFF;
        intp->imrl0 |= 0xFFFFFFFF;

        enable_interrupts();
        return 0;
}

There must be something in the kernel that relies on the interrupts
being masked in the interrupt controller and not only in the processor,
but I can not check right now because I do not have the sourcecode of
uClinux I use at work here at home right now.

I do not know if we should blame uClinux here for relying on the
interrupt controller being in the reset (all sources disabled) state,
or if we should try to fix this in u-boot.

> Best regards,
> Stefan

Best regards,
Wolfgang

  reply	other threads:[~2007-08-10 20:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-08  0:50 [U-Boot-Users] [PATCH] Fix for mcf5329evb - spurious interrupts on Linux/uClinux kernel boot Robert S. Grimes
2007-08-08  6:53 ` Stefan Roese
2007-08-08 12:02   ` Robert S. Grimes
2007-08-09 21:31 ` Wolfgang Denk
2007-08-10 11:31   ` [U-Boot-Users] interrupts in general / " w.wegner at astro-kom.de
2007-08-10 12:17     ` Bob Grimes
2007-08-10 12:56     ` Wolfgang Denk
2007-08-10 13:15       ` Stefan Roese
2007-08-10 20:22         ` Wolfgang Wegner [this message]
2007-08-13 18:06           ` Liew Tsi Chung-r5aahp
2007-08-13 18:12         ` [U-Boot-Users] ColdFire: do_bootm_linux() implements passing bd_t struct, initrd and cmdline Liew Tsi Chung-r5aahp

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=20070810202204.GA7687@leila.ping.de \
    --to=wolfgang@leila.ping.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox