linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Guillaume Dargaud" <dargaud@lpsc.in2p3.fr>
To: <linuxppc-dev@ozlabs.org>
Subject: Calling the kernel from a mini-bootloader
Date: Thu, 17 Jul 2008 15:22:28 +0200	[thread overview]
Message-ID: <021101c8e810$2e810fb0$ad289e86@LPSC0173W> (raw)

Hello all,
I'm in the process of writing a mini-bootloaler for a custom board and would 
like some feedback on my boot methodology.

Basically the kernel code (elf file) is copied into memory by a JTAG 
debugger. A custom program (yet to be finished) then copies it onto an 
onboard flash memory using serial commands. This flash is not part of the 
flat memory addressing.

When I want to boot, I have a small bootloader put into an eprom that _is_ 
part of the flat memory addressing. This (finished but not tested yet) 
bootloader basically does two things:
- it copies the content of the first flash into RAM
- it launches it using a custom function call like "0x400000();"

Now, I'd like to know if this is a reasonable approach ? I couldn't think of 
a better way, but maybe there are issues I didn't think off.


One additional question, if the above is valid, is that I would like to pass 
a particular argument to the kernel to set its MAC address. I can read an 
external value (similar to jumpers) from the bootloader via GPIO. Is there a 
way to pass this value to the kernel so that a modified 
arch/ppc/boot/simple/embed_config.c can use it to set the MAC address ?

Maybe the main() of the kernel can receive argv/argc the usual way, and I 
just need to call "0x400000(argc, argv);" but I have no idea if that works. 
Thanks for suggestions.
-- 
Guillaume Dargaud
http://www.gdargaud.net/

             reply	other threads:[~2008-07-17 14:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-17 13:22 Guillaume Dargaud [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-07-17 16:14 Calling the kernel from a mini-bootloader Milton Miller
2008-07-18  3:47 ` David Gibson
2008-07-18 17:47   ` Milton Miller
2008-07-18  8:43 ` Guillaume Dargaud
2008-07-18 18:38   ` Milton Miller
2008-07-22 10:49     ` Guillaume Dargaud
2008-07-22 16:01       ` Guillaume Dargaud

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='021101c8e810$2e810fb0$ad289e86@LPSC0173W' \
    --to=dargaud@lpsc.in2p3.fr \
    --cc=linuxppc-dev@ozlabs.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).