On Thu, 2009-06-11 at 17:18 -0400, David Claffey wrote:
> A patch is needed for MIPS big endian (elf32-tradbigmips) targets.  Perhaps 
> I'm
> the first to test trunk with a MIPS big endian target.
> 
> If "-endian big" is not set in target create, the endianess defaults to 
> little.
>  mw and md commands will still work, but binary file loads will have the
> incorrect word order loaded into memory.
> 
> The EJTAG processor access data register (PrAcc) is little endian regardless 
> of
> the CPU endianness; it is always loaded LSB first. This is confirmed by the 
> fact
> that mips_ejtag_drscan_32() uses buf_set_u32() to load the scan field;
> buf_set_u32() is a little-endian formatter. For big endian targets, data 
> buffers
> have to be modified so the LSB of each u32 or u16 is at the lower (first) 
> memory
> location.
> 
> The attached patch for src/target/mips_m4k.c fixes the problem.
> 
> Included is a patch for src/target/mips_ejtag.c that fixes the case of a big
> endian host.  Again it is related to PrAcc.  If the drscan out_value word 
> order
> is set using buf_set_u32() then it makes sense to also fixup the in_value with
> buf_get_u32(); a symmetry argument. This has no affect on little endian hosts.

I applied this with a second patch to further improve the code.  Please
let me know if there are any problems.

Cheers,

Zach

P.S. Please be sure to post using new threads when appropriate.  Do not
just reply to existing messages from the list to send new messages, as
that practice is known as "thread hijacking" or "threadjacking".

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to