Skip to contentSkip to conversation

Booting Linux using a PlanetCore BootLoader

DISCUSSION annamaya 3 participants 12 messages Oct 11, 2004

lore
Share & tools
lore

annamaya

author
#0 lore raw

I am trying to boot a linux kernel using a PlanetCore BootLoader on an embedded planet board. I am used to always using U-Boot for my Kernel booting needs. I am not sure how to get this going on a PlanetCore boot loader. I am sure someone has gone through this before and I was trying to find information but since lists.linuxppc.org is down, I am unable to find anything.

BTW, when is lists.linuxpcc.org coming back? I hope that alteast the archives are backed up somewhere to be made available in the future. Does anyone have any status on that. Thanks in advance for the help.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#1 lore raw
Quoted 5 lines · annamaya

I am trying to boot a linux kernel using a PlanetCore BootLoader on an embedded planet board. I am used to always using U-Boot for my Kernel booting needs. I am not sure how to get this going on a PlanetCore boot loader.

You need to build a zImage so you get the simple bootloader that will read the information from the EEPROM and format the board structure.

Load the zImage file as a binary. It has a 64K ELF header on it, so you can either use 'dd' to strip that before the download or add 64K to the load address to use as the start address. The start address is the first instruction of the image (or +64K if you didn't remove the ELF header).

	-- Dan
author
#2 lore raw

Dan,
First let me thank you for still being around to answer questions for people like me. You helped me out a lot a few years ago when I was just starting to work on all the embedded stuff. I am glad you are still helping everyone else.

I will try the zImage trick but I just wanted to know if the assumption here is that the kernel already understands the EEPROM data format to construct bd_info. Is that correct? If the kernel is unable to get to this data, is there another way to pass this info to the kernel?

Thanks much.

Quoted 30 lines · --- Dan Malek
Quoted 1 line · annamaya

I am trying to boot a linux kernel using a

PlanetCore

Quoted 1 line

BootLoader on an embedded planet board. I am used

to

Quoted 1 line

always using U-Boot for my Kernel booting needs. I

am

Quoted 1 line

not sure how to get this going on a PlanetCore

boot

Quoted 1 line

loader.

You need to build a zImage so you get the simple bootloader that will read the information from the EEPROM
and format the board structure.

Load the zImage file as a binary. It has a 64K ELF header
on it, so you can either use 'dd' to strip that before the
download or add 64K to the load address to use as the
start address. The start address is the first instruction of
the image (or +64K if you didn't remove the ELF header).

Quoted 3 lines
	-- Dan

__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail

#3 lore raw
Quoted 1 line · annamaya

I will try the zImage trick

It's not a trick nor magic :-) It's required for use with these boards because......

Quoted 4 lines

...but I just wanted to know
if the assumption here is that the kernel already
understands the EEPROM data format to construct
bd_info. Is that correct?

....the kernel does not understand anything about the EEPROM format on this board. This is the reason this "front end" bootloader was created. The standard interface to the kernel is the board descriptor, the board specific data in the EEPROM or elsewhere is usually quite varied and isn't appropriate to have in the kernel when it can be easily represented in
a standard manner.

Thanks.

	-- Dan
author
#4 lore raw
In reply to Dan Malek

I loaded a zImage into address 0x100000 in RAM and verified that this was indeed an ELF file. I then said "go 0x100040" which would start executing the code after skipping the 64 bytes of ELF header. But this is what I see happen.

BDI>info

    Target CPU        : MPC8280/8220/5200 (Zeppo)
    Target state      : debug mode
    Debug entry cause : <reserved 0>
    Current PC        : 0x00100040
    Current CR        : 0x20004022
    Current MSR       : 0x00000000
    Current LR        : 0xfff0531c

It looks like address 0x0 is reserved for some weird reason. When I do a dump of the 0x0 area, it looks like there is copy of the planetcore bootloader here since I see some text indicating that. If I dont have the BDI hooked up, I see an immediate reboot of the device, consistant with executing the bootloader at 0x0.

Any inputs on why this is happenning? I just understand the PlanetCore bootloader very well.

Quoted 30 lines · --- Dan Malek
Quoted 1 line · annamaya

I am trying to boot a linux kernel using a

PlanetCore

Quoted 1 line

BootLoader on an embedded planet board. I am used

to

Quoted 1 line

always using U-Boot for my Kernel booting needs. I

am

Quoted 1 line

not sure how to get this going on a PlanetCore

boot

Quoted 1 line

loader.

You need to build a zImage so you get the simple bootloader that will read the information from the EEPROM
and format the board structure.

Load the zImage file as a binary. It has a 64K ELF header
on it, so you can either use 'dd' to strip that before the
download or add 64K to the load address to use as the
start address. The start address is the first instruction of
the image (or +64K if you didn't remove the ELF header).

Quoted 3 lines
	-- Dan

_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

#5 lore raw
Quoted 5 lines · annamaya

I loaded a zImage into address 0x100000 in RAM and verified that this was indeed an ELF file. I then said "go 0x100040" which would start executing the code after skipping the 64 bytes of ELF header. But this is what I see happen.

It's 64Kilobytes, so you'd want 0x00110000. You also might be loading yourself a bit too low. The default link address is (assuming this is 2.4 and I'm still recalling right) 0x00200000, so you might as well load things there.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
author
#6 lore raw

Oops! Thanks for pointing that blooper. I am so used to dealing with the U-Boot header of 64 bytes that I misread the ELF header size as 64 bytes instead of 64 KBytes.

Anyways, it looks like I am much farther that I have ever been before. Now, I see that the PC is stuck at some address that I am not sure what to make off. Is this before the MMU has been turned on? Also, it looks like my BDI is not showing the "Debug entry cause" correctly.

BDI>info

    Target CPU        : MPC8280/8220/5200 (Zeppo)
    Target state      : debug mode
    Debug entry cause : <reserved 0>
    Current PC        : 0x00401890
    Current CR        : 0x20002024
    Current MSR       : 0x00002040
    Current LR        : 0x0040084c

I am not sure how I can map this address to some address in the kernel. Could this be due to the unavailability of bdinfo? Do I have to put in support in the kernel to pass bdinfo? Thanks much.

Quoted 11 lines · --- Tom Rini
Quoted 2 lines · annamaya

I loaded a zImage into address 0x100000 in RAM and verified that this was indeed an ELF file. I then

said

Quoted 2 lines

"go 0x100040" which would start executing the code after skipping the 64 bytes of ELF header. But

this is

Quoted 1 line

what I see happen.

Quoted 12 lines

It's 64Kilobytes, so you'd want 0x00110000. You also might be loading
yourself a bit too low. The default link address is (assuming this is
2.4 and I'm still recalling right) 0x00200000, so you might as well load
things there.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/

_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

#7 lore raw
Quoted 11 lines · annamaya

Oops! Thanks for pointing that blooper. I am so used to dealing with the U-Boot header of 64 bytes that I misread the ELF header size as 64 bytes instead of 64 KBytes.

Anyways, it looks like I am much farther that I have ever been before. Now, I see that the PC is stuck at some address that I am not sure what to make off. Is this before the MMU has been turned on? Also, it looks like my BDI is not showing the "Debug entry cause" correctly.

Could you send more of the boot-log ? And what board is this exactly on what kernel? Thanks.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
author
#8 lore raw

I do not have any other logs when this happens since I dont have any serial output when the failure happens. I am trying to do this on a EP8280 eval board. Has someone already included support for this board in the Kernel? Thank you.

Quoted 17 lines · --- Tom Rini
Quoted 1 line · annamaya

Oops! Thanks for pointing that blooper. I am so

used

Quoted 1 line

to dealing with the U-Boot header of 64 bytes that

I

Quoted 1 line

misread the ELF header size as 64 bytes instead of

64

Quoted 3 lines

KBytes.

Anyways, it looks like I am much farther that I

have

Quoted 1 line

ever been before. Now, I see that the PC is stuck

at

Quoted 1 line

some address that I am not sure what to make off.

Is

Quoted 13 lines
Quoted 1 line

this before the MMU has been turned on? Also, it

looks

Quoted 2 lines

like my BDI is not showing the "Debug entry cause" correctly.

Could you send more of the boot-log ? And what
board is this exactly on
what kernel? Thanks.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#9 lore raw
Quoted 5 lines · annamaya

I do not have any other logs when this happens since I dont have any serial output when the failure happens. I am trying to do this on a EP8280 eval board. Has someone already included support for this board in the Kernel? Thank you.

Without knowing which kernel you're using, I can't say for certain, but would assume it should work. When you type 'go 0x210000' after loading the kernel, you get nothing?

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
author
#10 lore raw

I am using the Linux Kernel 2.4.24-pre2. I included support for this board and created an embed_config() routine to pass in the correct board information. I am now able to see the "relocation" messages by zImage and it now halts with the message "Now booting the kernel". I see that it is now hung in some delay routine which was called from a panic routine. I am working on trying to figure this out.

Quoted 1 line

go 210000

loaded at:     00210000 002D426C
relocated to:  00400000 004C426C
board data at: 004C1130 004C115C
relocated to:  004052D8 00405304
zimage at:     00405810 004C0CC4
avail ram:     004C5000 10000000

Linux/PPC load: root=/dev/nfs rw ip=on
Uncompressing Linux...done.
Now booting the kernel

Quoted 9 lines · --- Tom Rini
Quoted 1 line · annamaya

I do not have any other logs when this happens

since I

Quoted 1 line

dont have any serial output when the failure

happens.

Quoted 2 lines

I am trying to do this on a EP8280 eval board. Has someone already included support for this board in

Quoted 13 lines

the

Quoted 1 line

Kernel? Thank you.

Without knowing which kernel you're using, I can't say for certain, but
would assume it should work. When you type 'go 0x210000' after loading
the kernel, you get nothing?

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/

_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

#11 lore raw
In reply to annamaya
Quoted 5 lines · annamaya

I loaded a zImage into address 0x100000 in RAM and verified that this was indeed an ELF file. I then said "go 0x100040" which would start executing the code after skipping the 64 bytes of ELF header. But this is what I see happen.

Two problem. First, that address for loading is too low. You need to load at or above 0x200000. The kernel lives where you loaded, so the uncompress copied over your uncompressing code and image.

Second, the offset is 64K not 64.

You want to load at 0x200000 and 'go 0x210000'

	-- Dan