Skip to contentSkip to conversation

Uncompress Ok, but cannot run linux kernel...

DISCUSSION machael thailer 5 participants 11 messages May 6, 2001 – May 10, 2001

lore
Share & tools
lore
#0 lore raw

Hello:

I have a 750-based custom board. I want to port linux-2.4.2 on it. The
bootrom code which initialized the hardware is working OK. I want to download the linux kernel via TFTP(and it is OK now) and run it. But I met some urgent problems ...
I modified the bootloader codes according to arch/ppc/mbxboot/head.S and
other "printf" functions to suit my cases. And it runs like the following:

################################
Loading... 611056
Starting at 0x400000...

loaded at:     00400000 004952F0
zimage at:     004062C8 0048F994
avail ram:     004952F0 10000000

Linux/PPC load:
Uncompressing Linux...done.
Now booting the kernel
###################################

Then nothing happens(I have added a serial output code at the very begining of arch/ppc/kernel/head.S and have nothing output.). By printing the code from 0x0 to 0x400000 I find the uncompressed code is right. After uncompressing it jumps to 0x0(arch/ppc/mbxboot/head.S), but it cannot run . Why?
Then I write a simple HelloWorld program and compile it with -Ttext=0x0 compiling options, then use it to replace /usr/src/linux/vmlinux and recompile the kernel.This time it works OK like the following:
################################
Loading... 4326
Starting at 0x400000...

loaded at:     ..........
zimage at:     ..........
avail ram:     ..........

Linux/PPC load:
Uncompressing Linux...done.
Now booting the kernel

Hello world
###################################

Here I attach my .config and arch/ppc/mbxboot/head.S. Hope you can help me if you are free.

Thank you very much.

machael thailer

#1 lore raw
Quoted 3 lines · machael thailer

..... But I met
some urgent problems ...
I modified the bootloader codes according to arch/ppc/mbxboot/head.S

For starters, you shouldn't be using this "boot loader" for a 750..... How did you configure a kernel to get there in the first place? A 750 should be a CHRP (or PReP, if you have to.....), which will direct you to a working "chrpboot" boot loader.

	-- Dan

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

#2 lore raw
Quoted 11 lines
Quoted 3 lines · machael thailer

..... But I met
some urgent problems ...
I modified the bootloader codes according to arch/ppc/mbxboot/head.S

For starters, you shouldn't be using this "boot loader" for a 750..... How did you configure a kernel to get there in the first place? A 750 should be a CHRP (or PReP, if you have to.....), which will direct you to a working "chrpboot" boot loader.

Yes, I choose "6xx/7xx/74xx/8260" and "/PowerMac/PRep/MTX/CHRP" when configuring the kernel.
Now I find that something is wrong with my serial output codes. When I fix it , I can trace into arch/ppc/kernel/head.S now.
But it hangs after running "turn_on_mmu". That is to say, it should be able to run "start_here" (but it cannot .)
By the way , I find that "initial_bats" do 2 different branches according to whether PVR is 601 or 604. I don't know which branch will 750 do?

Thank you very much.

machael

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

#3 lore raw
In reply to Dan Malek
Quoted 10 lines
Quoted 3 lines · machael thailer

..... But I met
some urgent problems ...
I modified the bootloader codes according to arch/ppc/mbxboot/head.S

For starters, you shouldn't be using this "boot loader" for a 750..... How did you configure a kernel to get there in the first place? A 750 should be a CHRP (or PReP, if you have to.....), which will direct you to a working "chrpboot" boot loader.

If I use "chrpboot " bootloader, I have to provide many functions in my boot codes according to CHRP specifications:

1 "prom"(promptr) functions which can provide with "/chosen" ,"claim" and "getprop" services etc in arch/ppc/chrpboot/start.c and in arch/ppc/kernel/prom.c .
2 device-trees for my custom board.

Are these functions all necessary for booting the linux kernel?

And do I have to modify arch/ppc/mm/init.c=>MMU_init() and arch/ppc/kernel/setup.c=>identify_machines() to suit my cases? I notice that in identify_machines(), there are many types initializations functions such as pmac_init(),prep_init(),chrp_init(),apus_init(), oak_init(),m8xx_init(),m8260_init(). Do I have to provide my own ***_init() functions?

Thank you very much.

machael

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

#4 lore raw
Quoted 14 lines · machael thailer
Quoted 10 lines
Quoted 3 lines · machael thailer

..... But I met
some urgent problems ...
I modified the bootloader codes according to arch/ppc/mbxboot/head.S

For starters, you shouldn't be using this "boot loader" for a 750..... How did you configure a kernel to get there in the first place? A 750 should be a CHRP (or PReP, if you have to.....), which will direct you to a working "chrpboot" boot loader.

If I use "chrpboot " bootloader, I have to provide many functions in my boot codes according to CHRP specifications:

Quoted 6 lines

1 "prom"(promptr) functions which can provide with "/chosen" ,"claim" and "getprop" services etc in arch/ppc/chrpboot/start.c and in arch/ppc/kernel/prom.c .
2 device-trees for my custom board.

Are these functions all necessary for booting the linux kernel?

You're doing this all wrong. There have been a bunch of good examples of ports to non-CHRP/PReP/Pmac 6xx/7xx/74xx hardware in the linuxppc_2_5 tree for a while now. Most of them have just been moved into the new linuxppc_2_4_devel tree. See the K2, MVME5100, MCPN765, PCore, PrPMC750, F1, etc. ports for details on how to quickly and easily do a port to a custom board.

Quoted 6 lines

And do I have to modify arch/ppc/mm/init.c=>MMU_init() and arch/ppc/kernel/setup.c=>identify_machines() to suit my cases? I notice that in identify_machines(), there are many types initializations functions such as pmac_init(),prep_init(),chrp_init(),apus_init(), oak_init(),m8xx_init(),m8260_init(). Do I have to provide my own ***_init() functions?

Yes.

--
Matt Porter
MontaVista Software, Inc.
[email protected]

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

#5 lore raw
In reply to machael thailer
Quoted 4 lines · machael thailer

I have a 750-based custom board. I want to port linux-2.4.2 on it. The
bootrom code which initialized the hardware is working OK. I want to download the linux kernel via TFTP(and it is OK now) and run it. But I met some urgent problems ...

I have the same problem on an FADS board. Tracing head.S showed me that the code returns with
a return from interrupt instead of a branch. So it maybe works if the image is used without bootloader or by changing head.S.

I'll test it today, please let me know if you've found the problem.

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

#6 lore raw
Quoted 1 line · Michael Habermann

I have the same problem on an FADS board.

What "same" problem? How are you loading and tracing the kernel?

Quoted 2 lines

......... So it maybe works if the image
is used without bootloader or by changing head.S.

The image certainly won't work without any bootloader, whether it is PPCBoot or the code found in arch/ppc/mbx (or arch/ppc/boot/mbx depending on your source base). The kernel requires a bunch of registers and information set up before it is called, and one of those two methods must be used to ensure this happens.

I believe there is a working FADS port in the FSM Labs BitKeeper sources. If not, you can download the older 2.4.0-test2 LSP from MontaVista and use it as a guide for updating a later kernel. The changes are very minor.

	-- Dan

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

#7 lore raw
Quoted 3 lines · Dan Malek
Quoted 1 line

I have the same problem on an FADS board.

What "same" problem? How are you loading and tracing the kernel?

The same problem is that the kernel doesn't survive until the welcome messge is printed.
The kernel is loaded with ppcboot and the tftpboot commando. To trace, I used mpc8bug.

I use the Montavista linux-2.4.0-test2-1.2.0-1 kernel.
I set a breakpoint at the entry of the __start routine. After passing the turn_on_mmu label, it returns with an rfi and hangs.
It is maybe ment to be started from a power_on interrupt, because in this context, I don't see the sense for an rfi. But I don't know much details.

I believe there is a working FADS port in the FSM Labs BitKeeper

Quoted 3 lines

sources. If not, you can download the older 2.4.0-test2 LSP from MontaVista and use it as a guide for updating a later kernel. The changes are very minor.

The Montavista is the one I used. I also tried one from Bitkeeper, but I didn't found support
for the FADS board. Even when I compiled for MBX, I got no image in arch/ppc/coffboot.
Which is the machine type I should configure for a MPC860FADS?

It would be nice if you could help me. So far I couldn't start any kernel.

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

#8 lore raw
Quoted 8 lines
Quoted 3 lines · Dan Malek
Quoted 1 line

I have the same problem on an FADS board.

What "same" problem? How are you loading and tracing the kernel?

Quoted 8 lines

The same problem is that the kernel doesn't survive until the welcome messge is printed.
The kernel is loaded with ppcboot and the tftpboot commando. To trace, I used mpc8bug.

I use the Montavista linux-2.4.0-test2-1.2.0-1 kernel.
I set a breakpoint at the entry of the __start routine. After passing the turn_on_mmu label, it returns with an rfi and hangs.

This is exactly what I meet now.
If you have good solutions, please let me know.

Thank you very much.

machael

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

#9 lore raw
Quoted 3 lines · In message <[email protected]> you wrote:
Quoted 3 lines

The kernel is loaded with ppcboot and the tftpboot commando. To trace, I used mpc8bug.

...

Quoted 5 lines
Quoted 2 lines

I set a breakpoint at the entry of the __start routine. After passing the turn_on_mmu label, it returns with an rfi and hangs.

This is exactly what I meet now.
If you have good solutions, please let me know.

Use a debugger that understands the MMU, like the BDI2000 by Abatron.

In any case, make sure the DER does not trap into BDM mode on normal MMU work, i. e. set it to something like 0x2002000F.

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] "I didn't know it was impossible when I did it."

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

#10 lore raw
Quoted 5 lines
Quoted 2 lines · In message <[email protected]> you wrote:
Quoted 2 lines

The kernel is loaded with ppcboot and the tftpboot commando. To trace,

I

Quoted 5 lines
Quoted 1 line
Quoted 1 line

used mpc8bug.

...

Quoted 3 lines
Quoted 2 lines

I set a breakpoint at the entry of the __start routine. After passing the turn_on_mmu label, it returns with an rfi and hangs.

Quoted 8 lines
Quoted 2 lines

This is exactly what I meet now.
If you have good solutions, please let me know.

Use a debugger that understands the MMU, like the BDI2000 by Abatron.

In any case, make sure the DER does not trap into BDM mode on normal MMU work, i. e. set it to something like 0x2002000F.

My board use Powerpc 750. Does 750 has DER?

machael

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