
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.
My code seems to be crashing in the relocate_code routine while switching from flash to RAM. There was an address_probe fixup which was not enabled And I enabled it. So, the relocation table (GOT) gets copied successfully
From flash to RAM but the code dies seomewhere between coping the fixups
And the in_ram label. Somehow, on my BDI, it sees an exception and goes to the reset vector i.e 0x100.
My approach is to avoid the GOT stuff and write a test routine which is Position dependant and copy the function to address 0x0 in RAM. After Executing the code in RAM, jump back to flash. People over here think That since the I-cache is enabled, the processor may burst but we are Fixing some bugs with that. The CS has BI flag set.
Does someone have some sample code for putting embedded C/assembly code ? My approach was to copy the memset routine from flash to RAM at address 0x0. Then do a memset from address 0x0 + sizeof(memset) to user given input of End of RAM. This way, I run memset from RAM and verify that it actually works with my peek/poke routine from flash.
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@h\n" \ " eieio\n" \ " lis r3, address@l\n" \ " ori r3, r3, address@h\n" \ " lis r4, fillpattern@l\n" \ " ori r4, r4, fillpattern@h\n" \ " lis r5, bytecount@l\n" \ " ori r5, r5, bytecount@h\n" \ " b 0x0\n" \ );
Thanks,
Atul