[U-Boot-Users] booting linux from u-boot - help!

Murray Jensen Murray.Jensen at csiro.au
Tue Dec 17 10:05:23 CET 2002


On Tue, 17 Dec 2002 19:04:41 +1100, My-Hong Vuong <My-Hong.Vuong at au.thalesgroup.com> writes:
>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.

>which then seems to
>get to start_here fine.

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

>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).

>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).

>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).

>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...
-- 
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.






More information about the U-Boot mailing list