public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Graeme Russ <graeme.russ@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Intialisation of Interrupts
Date: Fri, 09 Sep 2011 21:34:31 +1000	[thread overview]
Message-ID: <4E69F9C7.5030503@gmail.com> (raw)
In-Reply-To: <1315558299.88037.YahooMailNeo@web124705.mail.ne1.yahoo.com>

On 09/09/11 18:51, Flash K wrote:
> Hi Graeme,
> 
> I was going through the U-boot code. Could you please help me with the
> following? I wanted to know as to where the CPU interrupts are initialised.

look in arch/x86/lib/board.c for init_sequence_f and init_sequence_r -
These arrays show the init sequence for pre-relocated U-Boot and relocated
U-Boot respectively.

Now interrupts are a bit tricky - interrupt_init() which is called directly
in the post-relocation sequence actually initialises the programmable
interrupt controller (PIC). CPU level interrupts (exceptions etc) are
actually initialised in cpu_init_r() - For a stock x86 build, this is
actually aliased to x86_cpu_init_r() which you will find in arch/x86/cpu/cpu.c

So the IDT (Interrupt Descriptor Table) is actually initialised immediately
after relocation and then the PIC a little later on. Once the IDT is
loaded, CPU exceptions can be handled and after the PIC is initialised,
external interrupts (from devices) can be handled.

> I believe it should be along with the CPU initialisation and before the

Yes, it is

> northbridge and southbridge intialisation. I wanted to implement a logic to

Well, currently the x86 port has no concept of North and South bridges. For
 such a system, the Northbridge may contain the SDRAM controller and may
need to be initialised (at least partially) first

> read the state of a GPIO pin and carry out some action based on this key
> press. I want to do this before the Bootloader is invoked.

board_early_init_f and board_early_init_r are you best bets to put this
kind of logic. board_early_init_f is extremely early - You may not have
GPIO set up (unless it sets it up). board_early_init_r is called just after
the CPU interrupts are enabled but before the PIC has been configured

Regards,

Graeme

      reply	other threads:[~2011-09-09 11:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-09  8:51 [U-Boot] Intialisation of Interrupts Flash K
2011-09-09 11:34 ` Graeme Russ [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=4E69F9C7.5030503@gmail.com \
    --to=graeme.russ@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox