Skip to contentSkip to conversation

booting linux from u-boot - help!

U-Boot-Users Murray Jensen 1 participant 2 messages Dec 17, 2002 – Jun 26, 2003 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 1 line · My-Hong Vuong

with the cache, i've disabled MSR_DR in head_8xx.S

You mustn't do this - virtual memory will not work if you do this.

Quoted 2 lines

which then seems to
get to start_here fine.

This is giving you false hope - you must leave the virtual memory on.

Quoted 2 lines

but inserting the same code just before
early_init doesn't seem to work...

One problem that you need to look out for is that you only have 0x100 bytes available to you at that point. This is executing the reset exception handler at 0x...100 and the next exception handler must start at 0x...200. Don't insert too much code (you should get an error from the assembler - saying that you are trying to set the location backwards or something like that).

Quoted 10 lines

the assembly I'm using is :

lis     r25, 0xaaaa
ori     r25, r25, 0xaaaa
lis     r26, 0x8100
ori     r26,r26,0x0000
stw     r25, 0(r26)

where r25 is the pattern I want to write into address 0x81000000. I've used r25 and r26 because I can't see them being used anywhere in the code...

r25 and r26 (and others) are used to save the arguments passed to kernel from the boot loader (in r3, r4, ..., r7) - it's like the first few instructions ever executed by Linux - you mustn't clobber these registers.

Besides this, if you leave virtual memory on, this will not do what you think it will - you must first set up a temporary translation in the TLB before you can access that physical location, as is done for the Internal Memory Mapped Registers (IMMR) area.

Of course, the appropriate BRx/ORx for the LEDs must have been set up by the boot loader so that the physical address 0x81000000 really does access the LED hardware (I assume this is the case - since you say this code works elsewhere).

Quoted 2 lines

I'm not sure how do do it otherwise (i.e. restoring the original register values)

Use some other registers (if you're careful) - e.g. r3, r4, r5 - these will be restored later when required (see call to identify_machine - or some name like that).

Quoted 1 line

any other ideas would be muchly appreciated,

I just got my BDI2000 - it's great. Other than that - pull out all code you have inserted and go back to the original Linux code - after carefully examining all the config options. If your hardware is correct and your linux config matches it properly, it should "just work" :-) Good luck. Cheers!

								Murray...
Signature · 14 lines
Murray Jensen, CSIRO Manufacturing & Infra. Tech.      Phone: +61 3 9662 7763
Locked Bag No. 9, Preston, Vic, 3072, Australia.         Fax: +61 3 9662 7853
Internet: Murray.Jensen at csiro.au

Hymod project: http://www.msa.cmst.csiro.au/projects/Hymod/

To the extent permitted by law, CSIRO does not represent, warrant and/or
guarantee that the integrity of this communication has been maintained or
that the communication is free of errors, virus, interception or interference.

The information contained in this e-mail may be confidential or privileged.
Any unauthorised use or disclosure is prohibited. If you have received this
e-mail in error, please delete it immediately and notify Murray Jensen on
+61 3 9662 7763. Thank you.
#2 lore raw

[U-Boot-Users] [PPCBoot-users] Using gcc-3.4 to compile u-boo t on powerpc

In reply to a message not in the archive
Quoted 5 lines · Vuong My-Hong

Hi Murray,

Is there a similar fix for gcc 3.0.4?

Thanks, My Hong

Sorry, I wouldn't know. Here is a posting where this define was proposed (14 Dec 2001) ...

	http://gcc.gnu.org/ml/gcc-patches/2001-12/msg01678.html

and here is a post where it was proposed that the define be turned off in "linux.h" (29 Jan 2003) ...

	http://gcc.gnu.org/ml/gcc-patches/2003-01/msg02345.html

If the second is before gcc 3.0.4, then this fix will apply, otherwise you have some other problem. 3.0.4 sounds like a long time ago, so my guess would be "no (you could check in the gcc cvs). Cheers!

								Murray...
Signature · 14 lines
Murray Jensen, CSIRO Manufacturing & Infra. Tech.      Phone: +61 3 9662 7763
Locked Bag No. 9, Preston, Vic, 3072, Australia.         Fax: +61 3 9662 7853
Internet: Murray.Jensen at csiro.au

Hymod project: http://www.msa.cmst.csiro.au/projects/Hymod/

To the extent permitted by law, CSIRO does not represent, warrant and/or
guarantee that the integrity of this communication has been maintained or
that the communication is free of errors, virus, interception or interference.

The information contained in this e-mail may be confidential or privileged.
Any unauthorised use or disclosure is prohibited. If you have received this
e-mail in error, please delete it immediately and notify Murray Jensen on
+61 3 9662 7763. Thank you.