From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerry Van Baren Date: Tue, 25 Oct 2005 07:45:39 -0400 Subject: [U-Boot-Users] Running test code from RAM while having GOT pointing to flash In-Reply-To: <4A062D477D842B4C8FC48EA5AF2D41F20152806A@us-bv-m23.global.tektronix.net> References: <4A062D477D842B4C8FC48EA5AF2D41F20152806A@us-bv-m23.global.tektronix.net> Message-ID: <435E1AE3.3040408@smiths-aerospace.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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