[Fwd: Question about linker -Ttext option]

2004-03-09 Thread Bob Beck

FYI - I'm using version 2.4.18 of the linux
kernel with the ppc patches.

Bob


-Forwarded Message-

From: Bob Beck <[EMAIL PROTECTED]>
To: linuxppc-embedded at lists.linuxppc.org
Subject: Question about linker -Ttext option
Date: 09 Mar 2004 14:10:26 +1400

In the arch/ppc/boot directory, one of the linker
options is "-Ttext 0x0080".


What does this mean ?

The base virtual address of the kernel is c000.

I've been using my own hand-rolled bootloader to
load the zImage.bin file into an address allocated
by the VxWorks malloc and jumping to that address.

Second question.

arch/ppc/boot/simple/head.S says it expects the load address
in r3. It seems strange that it would need its own (start)
starting address. What is this routine expecting ?


Regards,
Bob Beck


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





Question about linker -Ttext option

2004-03-09 Thread Bob Beck

In the arch/ppc/boot directory, one of the linker
options is "-Ttext 0x0080".


What does this mean ?

The base virtual address of the kernel is c000.

I've been using my own hand-rolled bootloader to
load the zImage.bin file into an address allocated
by the VxWorks malloc and jumping to that address.

Second question.

arch/ppc/boot/simple/head.S says it expects the load address
in r3. It seems strange that it would need its own (start)
starting address. What is this routine expecting ?


Regards,
Bob Beck


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





Booting Linux on a Custom PPC Board

2004-03-03 Thread Bob Beck

On Wed, 2004-03-03 at 13:51, Wolfgang Denk wrote:
> In message <1078181934.4198.20.camel at budweiser> you wrote:
> >
> > We are writing our own boot loader code for a couple of reasons.
> >
> > o U-Boot does not support our ethernet chip or serial chip.
>
> And you really  think  that  developing  a  complete  new  bootloader
> (including drivers for your ethernet and serial chips) is less effort
> or easier that just adding these drivers to U-Boot?
>
> C'me on!

Actually, we know we need to develop drivers for our ethernet and
serial chips for Linux. We are not convinced yet that developing
these drivers for U-Boot too is useful given the fact that VxWorks
is already booted up.
>
> > o VxWorks is in flash and we cannot change that in the near future.
> > o The VxWorks boot loader initializes the hardware and
> >   we run our custom boot loader from its shell.
>
> U-Boot can boot VxWorks just fine.
>
What I mean is that the VxWorks boot loader is already booting
up an really old version of VxWorks. We aren't using VxWorks for
this project for various reasons. It just happens to be part of
the legacy development environment.


Bob

>
> Best regards,
>
> Wolfgang Denk


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





Update: Booting Linux on a Custom PPC Board

2004-03-02 Thread Bob Beck

Ok. Now its making it to start_ in boot/simple/head.S.

It jumps to relocate in relocate.S after doing some 6xx
specific code. In util.S, it enters but never finishes
the flush_data_cache. 

Bob



-Forwarded Message-

From: Bob Beck <[EMAIL PROTECTED]>
To: linuxppc-embedded at lists.linuxppc.org
Subject: Booting Linux on a Custom PPC Board
Date: 02 Mar 2004 12:58:54 +1400


I am booting Linux on a custom board and having many
problems.  The board contains a PPC603E, flash, an
ethernet controller, and a serial chip.

Here is what I have done so far.

o Configured the kernel to support 6xx/7xx boards
o Introduced a new defined named "CONFIG_ATCNVMS"
o Modified kernel/setup.c so that early_init() would
  skip the last 3 things it does that do not make
  sense for my board.
o Added a new embed_config() function in arch/ppc/boot/simple
  that populates a bd_t structure (from ppcboot.h)
o Added code to save registers r3-r7 at the beginning
  of start_ in simple/head.S. Restored these registers
  in relocate.S before the jump to 0.
o Updated the makefiles so that the zImage.embedded
would be created in the arch/ppc/boot/images directory.


We are writing our own boot loader code for a couple of reasons.

o U-Boot does not support our ethernet chip or serial chip.
o VxWorks is in flash and we cannot change that in the near future.
o The VxWorks boot loader initializes the hardware and
  we run our custom boot loader from its shell.


Here are the steps taken by our custom boot loader.

o Malloc a piece of memory and copy the ram disk from a file
  to the malloc'd memory.
o Malloc a piece of memory and copy the zImage.bin contents from
  a file to memory.
  powerpc-linux-objcopy -O binary zImage.embedded zImage.bin
o Prepare the registers
  r3 = ptr to bd_t
  r4 = ptr to initial ram disk bin in memory
  r5 = ptr to end of initial ram disk
  r6 = ptr to start of command line string
  r7 = ptr to end of command line string
o Jump to the start address where the zImage.bin has been loaded
  into memory.

In arch/ppc/boot/simple/head.S, I call a routine that blinks a light
(start_), but this light never blinks. I also call this routine
at __start in arch/ppc/kernel/head.S but the light never blinks.


I don't understand what to do at this point. In the past I
loaded the ram disk and vmlinux into memory and jumped to 0x1.
Somebody on this list said that was guaranteed not to work.
However, the light did blink before the code had problems in
mmu initialization.

Regards,
Bob Beck
beck at assurtech.com


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





Booting Linux on a Custom PPC Board

2004-03-02 Thread Bob Beck

I am booting Linux on a custom board and having many
problems.  The board contains a PPC603E, flash, an
ethernet controller, and a serial chip.

Here is what I have done so far.

o Configured the kernel to support 6xx/7xx boards
o Introduced a new defined named "CONFIG_ATCNVMS"
o Modified kernel/setup.c so that early_init() would
  skip the last 3 things it does that do not make
  sense for my board.
o Added a new embed_config() function in arch/ppc/boot/simple
  that populates a bd_t structure (from ppcboot.h)
o Added code to save registers r3-r7 at the beginning
  of start_ in simple/head.S. Restored these registers
  in relocate.S before the jump to 0.
o Updated the makefiles so that the zImage.embedded
would be created in the arch/ppc/boot/images directory.


We are writing our own boot loader code for a couple of reasons.

o U-Boot does not support our ethernet chip or serial chip.
o VxWorks is in flash and we cannot change that in the near future.
o The VxWorks boot loader initializes the hardware and
  we run our custom boot loader from its shell.


Here are the steps taken by our custom boot loader.

o Malloc a piece of memory and copy the ram disk from a file
  to the malloc'd memory.
o Malloc a piece of memory and copy the zImage.bin contents from
  a file to memory.
  powerpc-linux-objcopy -O binary zImage.embedded zImage.bin
o Prepare the registers
  r3 = ptr to bd_t
  r4 = ptr to initial ram disk bin in memory
  r5 = ptr to end of initial ram disk
  r6 = ptr to start of command line string
  r7 = ptr to end of command line string
o Jump to the start address where the zImage.bin has been loaded
  into memory.

In arch/ppc/boot/simple/head.S, I call a routine that blinks a light
(start_), but this light never blinks. I also call this routine
at __start in arch/ppc/kernel/head.S but the light never blinks.


I don't understand what to do at this point. In the past I
loaded the ram disk and vmlinux into memory and jumped to 0x1.
Somebody on this list said that was guaranteed not to work.
However, the light did blink before the code had problems in
mmu initialization.

Regards,
Bob Beck
beck at assurtech.com


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





ADS860 - unable to load kernel- Bad magic number

2004-02-27 Thread Bob Beck

On Sat, 2004-02-28 at 09:32, Dan Malek wrote:

> Bob Beck wrote:
>
> > Thanks. What is the difference between zImage.embedded and vmlinux.gz
> > generated by the kernel build ?
>
> Huge.  The vmlinux.gz is just the gzipped kernel.  The zImage contains
> the 'bootloader' code that can perform some processor initialization,
> uncompresses the vmlinux.gz, locates it properly in memory, sets initial
> registers, then jumps to the start of the kernel.

Does this mean I should put zImage.embedded into 1 place in memory,
vmlinux.gz into a different place in memory and jump to the start of
zImage.embedded ?

Currently, we are not using U-Boot. We load the binaries into RAM
using a hand rolled program and jump to 0x1.

Bob
>
> > This is the file used by U-Boot's mkImage command to produce a
> > vmlinux.img file.
>
> If you are building for u-boot, you should 'make uImage' and use
> the uImage that is created.
>
>
>   -- Dan
>


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





ADS860 - unable to load kernel- Bad magic number

2004-02-27 Thread Bob Beck

On Sat, 2004-02-28 at 07:29, Marius Groeger wrote:
> On Thu, 27 Feb 2004, Bob Beck wrote:
>
> > On Sat, 2004-02-28 at 06:32, Marius Groeger wrote:
> > > On Thu, 27 Feb 2004, Bob Beck wrote:
> > >
> > > >  What is the difference between vmlinux and zImage.embedded ?
> > >
> > > vmlinux is the plain kernel ELF image. You can use it to analyse the 
> > > kernel
> > > code or symbols, but you cannot boot it as-is.
> > >
> > > zImage.embedded is the compressed kernel image plus some glue code used 
> > > as a
> > > bridge between the firmware and the kernel.
> > >
> >
> > On my proprietary board (PPC 603). I do not have access to flash
> > so I am loading vmlinux into RAM and jumping to 0x1. It is
> > running into problems in mmu_off.
> >
> > Should I be loading zImage.embedded instead ?
>
> Yes you can try that, but then you will have to modify the code in
> arch/ppc/boot/... to match the specifics of your board.
>
> Another popular way to go is to port u-boot to your platform first.
> U-boot accepts kernel pImages which you get by doing a "make pImage"
> in the kernel source dir.
>
> You will have to know your tools and hardware quite well either way,
> be prepared to learn a lot.
>
> Good Luck,
> Marius

Thanks. What is the difference between zImage.embedded and vmlinux.gz
generated by the kernel build ?

This is the file used by U-Boot's mkImage command to produce a
vmlinux.img file.

Bob


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





ADS860 - unable to load kernel- Bad magic number

2004-02-27 Thread Bob Beck

On Sat, 2004-02-28 at 06:32, Marius Groeger wrote:
> On Thu, 27 Feb 2004, Bob Beck wrote:
>
> >  What is the difference between vmlinux and zImage.embedded ?
>
> vmlinux is the plain kernel ELF image. You can use it to analyse the kernel
> code or symbols, but you cannot boot it as-is.
>
> zImage.embedded is the compressed kernel image plus some glue code used as a
> bridge between the firmware and the kernel.
>

On my proprietary board (PPC 603). I do not have access to flash
so I am loading vmlinux into RAM and jumping to 0x1. It is
running into problems in mmu_off.

Should I be loading zImage.embedded instead ?

Bob

I can see
> Regards,
> Marius


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





MMU Problem bringing up kernel with PPC 603 chip

2004-02-27 Thread Bob Beck

All,

I'm bringing up my 1st kernel on a proprietary board
using a PPC 603E chip.


The kernel is configured using the 6xx/7xx ppc selection.

The kernel starts executing at __start in head.S and
branches to early_init(). I have stubbed out the call
to prom_init() since this is an embedded system and
not a power mac (as the comments at the top of the
prom.c file indicate).

The code returns to head.S and branches to mmu_off.
Here is the code for mmu_off.

mmu_off:
addir4, r3, __after_mmu_off - _start
mfmsr   r3
andi.   r0,r3,MSR_DR|MSR_IR /* MMU enabled? */
beqlr
andcr3,r3,r0
mtspr   SRR0,r4
mtspr   SRR1,r3
sync
RFI

This executes all the way to the "RFI" instruction,
but never comes back to the place in the code that
called mmu_off.

Why is the "return from interrupt" going out into
space ? Any suggestions ?


Best Regards,

Bob Beck
beck at assurtech.com


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





ADS860 - unable to load kernel- Bad magic number

2004-02-27 Thread Bob Beck

On Fri, 2004-02-27 at 21:45, li wrote:
>
> which kernel image did you download into the target via tftp?
> vmlinux.gz is just gzip version of vmlinux Here i downloaded
> zImage.embedded, which has the following features: ELF 32-bit MSB
> executable, PowerPC or cisco 4500, version 1 (SYSV), staticlly linked,
> not stripped. then, with the offset 0x1 from loadaddr, the kernel
> is up.

 What is the difference between vmlinux and zImage.embedded ?

Bob

> > I am a linux-newbie working on a parallel track on the MPC 860, on
> > a ADS board. I am facing difficulty in getting the kernel to load.
> > This is what I have done so far:
> >
> > - built a cross-toolchain using Dan Kegel's crosstool.
> > - built u-boot-1.0.1 and flashed it to the board using BDI2000
> > - built linus-2.4.22, (with the below mentioned patch on last attempt).
> >
> > The compilation goes through fine, I get "vmlinux" on the top-dir,
> > and also a vmlinux.gz in the arch/ppc/boot/images if I do a "make
> > zImage".
> >
> > When I configure bootp, and bootup the board, u-boot comes up fine,
> > the tftp download of the kernel image goes through fine too. Then I
> > am stuck with a "Bad Magic Number". Some initial digup led me to a
> > mismatched image header magic number.
> >
> > Could anyone please help me with how to go ahead? Am I missing
> > something?
> >
> > Also thanks to everyone whose postings on this and other lists
> > helped me get started!
> >
> > -Original Message-
> > From: Xavier Miville [mailto:xmiville at oerlikon.ca]
> > Sent: Thursday, February 26, 2004 9:58 PM
> > Subject: RE: PCI daughter card with USB on a 405GP
> >
> > You will need to apply the corresponding linuxppc patch
> > (/pub/linux/kernel/ports/ppc/2.4) to 2.4.22. The zvmlinux doesn't seem
> > to be built with only 2.4.22.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/