On Mon, Jul 11, 2011 at 1:30 PM, Øyvind Harboe <oyvind.har...@zylin.com> wrote:
> On Mon, Jul 11, 2011 at 1:10 PM, Drasko DRASKOVIC
> <drasko.drasko...@gmail.com> wrote:
>> On Mon, Jul 11, 2011 at 12:52 PM, Øyvind Harboe <oyvind.har...@zylin.com> 
>> wrote:
>>> On Mon, Jul 11, 2011 at 12:45 PM, Drasko DRASKOVIC
>>> <drasko.drasko...@gmail.com> wrote:
>>>> On Mon, Jul 11, 2011 at 11:53 AM, Øyvind Harboe <oyvind.har...@zylin.com> 
>>>> wrote:
>>>>> I think there is a fundamental misunderstanding about JTAG
>>>>> and OpenOCD.
>>>>>
>>>>> Let me try to clarify:
>>>>>
>>>>> JTAG clocks in and out bits, not bytes, so the concept of
>>>>> "big/small-endian" does not enter the picture at the JTAG level.
>>>>
>>>> Sat that we have 0x12345678 at addr 0x0 on LE host.
>>>> You will shift out byte 0x78 first, shifting out from LSB upwards.
>>>
>>> You're on the wrong track here. Shifting out happens with *bits*.
>> When I said LSB I meant Least Significant *Bit*, not *Byte*.
>>
>>>
>>> So the situation is:
>>>
>>> - you have a host word. 8, 16, 32 or 64 bit wide.
>>> - that word must be copied over to an array of bytes to be shifted out.
>>> At this point any memory of host representation is gone.
>>> - the jtag layer now shifts out the bits, starting with bit 0 in byte 0.
>> What is byte 0 for you ?
>
> An array of bytes as an unambiguous representation in memory and
> C programming model. When I say byte 0 of an array of bytes, there is
> no question about what that is.

This is not arguable. What I am asking you here is how do you create
this array of bytes you want to shift out ?

I'd say - on BE host, when you want to shift out word you put addr 0x3
to be shifted out first, and then in the end addr 0x0, because LSB of
your value lives on addr 0x3.

Here is how you prepare your shift-out buffer of 8-bit long elements :
buffer[0] = (contents_of_the_host_addr 0x3);
buffer[1] = (contents_of_the_host_addr 0x2);
buffer[2] = (contents_of_the_host_addr 0x1);
buffer[3] = (contents_of_the_host_addr 0x0);

And then you shift out buffer[0] first, then buffer[1], etc.

Which would in the end say - when you want to shift 32-bit word from
the BE host, it will be contents addr 0x3 that will be going out on
the wire first, this is all I am trying to say.

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

Reply via email to