Linux MIPS Architecture development
 help / color / mirror / Atom feed
* boot requirements
@ 2003-07-24 14:27 David Kesselring
  2003-07-24 15:50 ` Joe George
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: David Kesselring @ 2003-07-24 14:27 UTC (permalink / raw)
  To: linux-mips

I am trying to determine what has to be included in our boot code to start
linux. I didn't think I needed to port yamon. What does yamon or pmon
provide for starting or debugging(gdb) linux? Does the processor need to
be in a specific state or context before jumping from the boot code to the
linux downloaded image? If someone can point me to a simple example, I
would greatly appreciate it.

David Kesselring
Atmel MMC
dkesselr@mmc.atmel.com
919-462-6587

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: boot requirements
  2003-07-24 14:27 boot requirements David Kesselring
@ 2003-07-24 15:50 ` Joe George
  2003-07-24 16:02   ` Wolfgang Denk
  2003-07-24 16:32 ` Lyle Bainbridge
  2003-07-24 17:15 ` Jun Sun
  2 siblings, 1 reply; 7+ messages in thread
From: Joe George @ 2003-07-24 15:50 UTC (permalink / raw)
  To: David Kesselring; +Cc: linux-mips

I found Jun's porting howto to be an immense help.

http://linux.junsun.net/porting-howto/

I found it easier to port Linux to my board than
Yamon.  But I guess it probably depends a lot on
the kind of port.

Joe

David Kesselring wrote:
> I am trying to determine what has to be included in our boot code to start
> linux. I didn't think I needed to port yamon. What does yamon or pmon
> provide for starting or debugging(gdb) linux? Does the processor need to
> be in a specific state or context before jumping from the boot code to the
> linux downloaded image? If someone can point me to a simple example, I
> would greatly appreciate it.
> 
> David Kesselring
> Atmel MMC
> dkesselr@mmc.atmel.com
> 919-462-6587
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: boot requirements
  2003-07-24 15:50 ` Joe George
@ 2003-07-24 16:02   ` Wolfgang Denk
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2003-07-24 16:02 UTC (permalink / raw)
  To: Joe George; +Cc: David Kesselring, linux-mips

In message <3F200047.2050506@clearcore.com> you wrote:
> 
> I found it easier to port Linux to my board than
> Yamon.  But I guess it probably depends a lot on
> the kind of port.

It depends on what you want or need to do. Capabilities like  booting
over  the  network  or  storing  configuration  parameters or command
sequences can be extremely useful features of a boot loader.

We use U-Boot on a couple of MIPS boards.


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
One possible reason that things aren't going  according  to  plan  is
that there never was a plan in the first place.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: boot requirements
  2003-07-24 14:27 boot requirements David Kesselring
  2003-07-24 15:50 ` Joe George
@ 2003-07-24 16:32 ` Lyle Bainbridge
  2003-07-24 16:32   ` Lyle Bainbridge
  2003-07-24 17:15 ` Jun Sun
  2 siblings, 1 reply; 7+ messages in thread
From: Lyle Bainbridge @ 2003-07-24 16:32 UTC (permalink / raw)
  To: 'David Kesselring', linux-mips

Hi,

Creating a simple boot loader:

Well firstly, you'll need to at least implement some
initialization code specific to your processor. Typically
for MIPS this would involve initializing CP0, the cache
and TLB. Then perhaps some peripheral initialization such
as clocks, static memory and SDRAM controllers.  Then the
stack pointer needs to be set to a suitable location
being carefull to word align.

Ok, well that's just the reset code for your processor.
What you need to fo for the Linux kernel depends on where it
is stored and whether it is compressed. Loading from a disk
requires a slightly less than trivial bootloader. For the
sake of discussion I'll assume the kernel is located in flash:

For compressed kernel in flash with ELF header:
  a. Uncompress the kernel to RAM.
  b. Read the ELF header to determine layout of sections
     and kernel entry point.
  c. Copy sections to memory as specified in ELF header.
  d. Jump to kernel entry point.
  e. Kernel does the rest :)

If the kernel is not compress then obviously this step can
be skipped. This is a pretty minimal boot loader and easy
to implement.

> I am trying to determine what has to be included in our boot 
> code to start linux. I didn't think I needed to port yamon. 
> What does yamon or pmon provide for starting or 
> debugging(gdb) linux? Does the processor need to be in a 
> specific state or context before jumping from the boot code 
> to the linux downloaded image? If someone can point me to a 
> simple example, I would greatly appreciate it.
> 
> David Kesselring
> Atmel MMC
> dkesselr@mmc.atmel.com
> 919-462-6587
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: boot requirements
  2003-07-24 16:32 ` Lyle Bainbridge
@ 2003-07-24 16:32   ` Lyle Bainbridge
  0 siblings, 0 replies; 7+ messages in thread
From: Lyle Bainbridge @ 2003-07-24 16:32 UTC (permalink / raw)
  To: 'David Kesselring', linux-mips

Hi,

Creating a simple boot loader:

Well firstly, you'll need to at least implement some
initialization code specific to your processor. Typically
for MIPS this would involve initializing CP0, the cache
and TLB. Then perhaps some peripheral initialization such
as clocks, static memory and SDRAM controllers.  Then the
stack pointer needs to be set to a suitable location
being carefull to word align.

Ok, well that's just the reset code for your processor.
What you need to fo for the Linux kernel depends on where it
is stored and whether it is compressed. Loading from a disk
requires a slightly less than trivial bootloader. For the
sake of discussion I'll assume the kernel is located in flash:

For compressed kernel in flash with ELF header:
  a. Uncompress the kernel to RAM.
  b. Read the ELF header to determine layout of sections
     and kernel entry point.
  c. Copy sections to memory as specified in ELF header.
  d. Jump to kernel entry point.
  e. Kernel does the rest :)

If the kernel is not compress then obviously this step can
be skipped. This is a pretty minimal boot loader and easy
to implement.

> I am trying to determine what has to be included in our boot 
> code to start linux. I didn't think I needed to port yamon. 
> What does yamon or pmon provide for starting or 
> debugging(gdb) linux? Does the processor need to be in a 
> specific state or context before jumping from the boot code 
> to the linux downloaded image? If someone can point me to a 
> simple example, I would greatly appreciate it.
> 
> David Kesselring
> Atmel MMC
> dkesselr@mmc.atmel.com
> 919-462-6587
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: boot requirements
  2003-07-24 14:27 boot requirements David Kesselring
  2003-07-24 15:50 ` Joe George
  2003-07-24 16:32 ` Lyle Bainbridge
@ 2003-07-24 17:15 ` Jun Sun
  2 siblings, 0 replies; 7+ messages in thread
From: Jun Sun @ 2003-07-24 17:15 UTC (permalink / raw)
  To: David Kesselring; +Cc: linux-mips, jsun

On Thu, Jul 24, 2003 at 10:27:16AM -0400, David Kesselring wrote:
> I am trying to determine what has to be included in our boot code to start
> linux. I didn't think I needed to port yamon. What does yamon or pmon
> provide for starting or debugging(gdb) linux? Does the processor need to
> be in a specific state or context before jumping from the boot code to the
> linux downloaded image? If someone can point me to a simple example, I
> would greatly appreciate it.
>

This is a good question.  I am listing what I can think of on top of my
head.  Some items might be missing:

. cold initialize board
. RAM should be ready
. kernel binary is in place
. cache is consistent.
. any kernel command line args are set up (set prom_init() for the 
  "protocol")
. Normally you would enable cache, and jump to the KSEG0 kernel_entry.
  (I have seen exceptions, in which case you need to modified a little
   in kernel)
. Obviously CPU is setup in kernel mode and a few configs are setup correctly
  (such as data path width, timing, etc).  Interrupt should be
  turned off.
 
All the rest bootloader work are negotiable between the linux kernel
and bootloader.  For example, if bootloader assigns PCI resources,
then kenel can skip pci_auto.  In other words, beyond the above
minimum requirement, other bootloader work _can_ be done in Linux board
setup routine.

Jun

^ permalink raw reply	[flat|nested] 7+ messages in thread

* boot requirements
@ 2003-07-24 17:28 David Kesselring
  0 siblings, 0 replies; 7+ messages in thread
From: David Kesselring @ 2003-07-24 17:28 UTC (permalink / raw)
  To: linux-mips

I'm getting the idea of what has to happen. Thanks for your comments.

David Kesselring
Atmel MMC
dkesselr@mmc.atmel.com
919-462-6587

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-07-24 17:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-24 14:27 boot requirements David Kesselring
2003-07-24 15:50 ` Joe George
2003-07-24 16:02   ` Wolfgang Denk
2003-07-24 16:32 ` Lyle Bainbridge
2003-07-24 16:32   ` Lyle Bainbridge
2003-07-24 17:15 ` Jun Sun
  -- strict thread matches above, loose matches on Subject: below --
2003-07-24 17:28 David Kesselring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox