[U-Boot-Users] Running test code from RAM while having GOT pointing to flash

Jerry Van Baren gerald.vanbaren at smiths-aerospace.com
Tue Oct 25 13:45:39 CEST 2005


atul.sabharwal at exgate.tek.com wrote:
> I am a newbie at PowerPC assembly.  In my last patch, I submitted a series
> of test as part of my work in bringing up the memory controller.

[snip]

> My first cut at it is here but it is complaining about GOT. Not enough
> experience with ld...   Help/tips ??
> 
> 
>    __asm__ __volatile__(		   \
> 		      "	lis r10, 0x0 at h\n"		   \
> 		      "	eieio\n"		           \
> 		      " lis r3, address at l\n"		   \
> 		      " ori r3, r3, address at h\n"           \
> 		      " lis r4, fillpattern at l\n"           \
> 		      " ori r4, r4, fillpattern at h\n"       \
> 		      " lis r5, bytecount at l\n"             \
> 		      " ori r5, r5, bytecount at h\n"         \
> 		      " b  0x0\n"                         \
> 		      );
> 
> Thanks,
> 
> Atul

This has nothing to do with your current problems, but if you try to run 
the above code, it won't work.  You are doing a "load shifted" of the 
_lower_ half of the word and then oring in the _upper_ half of the word. 
    You need to switch your "@l" (low half) and "@h" (high half).  What 
you have will give you a halfword-swapped value:

Want: 01234567
Oops: 45670123

gvb




More information about the U-Boot mailing list