Other Parts Discussed in Thread: TMDS64EVM
Tool/software:
Hello,
I'm about to try to transfer data via the GPMC interface with bursts as long as possible with the goal of maximizing the throughput.
Momentarily, the GPMC is operated at 16 bit with a moderate 33.33MHz clock.
There is this GPMC parameter termed ATTACHEDDEVICEPAGELENGTH in the TRM (bits 24:23 of CONFIG1_i). In junction with the standard omap-gpmc driver and the linux device tree it is termed gpmc,burst-length with a slightly different notation of the parameter. That is, gpmc,burst-length specifies the maximum burst length in words rather than the value coded from it into ATTACHEDDEVICEPAGELENGTH. When gpmc,burst-length is set to 16 for instance, ATTACHEDDEVICEPAGELENGTH is found to be 10 binary, which corresponds to 16 words. So this seems just fine.
One odd thing I found in a first instance is that the SDK (I'm using 11.00.09.04 momentarily) does not support the maximum burst length of 32 words, which should be applicable in 16 bit mode according to the TRM. For testing purposes I did patch the omap-gpmc driver a little bit in order to be able to set ATTACHEDDEVICEPAGELENGTH to 11 through the device tree settings.
Now, the according GPMC address window can be mmapped by a linux process and then accessed like normal memory. This is working and I see bursts being used during read and write.
In order to move data between main memory and some GPMC window, it should be sensible to make use of memcpy() that is coming with the SDK. Although I did not check that in detail, I think that the memcpy() implementation is usually highly optimized for the processor.
For instance, that would be some piece of code that moves 64 bytes of data from some buffer buffer1 in main memory to some pointer gpmc_space representing memory within the GPMC area and then back into main memory at buffer2:
memcpy( (void*) gpmc_space, (void*) buffer1, 64);
memcpy( (void*) buffer2, (void*) gpmc_space, 64);
It should be noted that gpmc_space as I did use it for testing was the very beginning of a GPMC window - so well aligned. buffer1 and buffer2 were normally declared 64 bit integer arrays within the code of the C function. AFAIK the compiler places such arrays aligned to their data type - so they should be aligned to 64 bit here.
As it turns out, there appear only bursts with a length of 8 words at the GPMC interface for writes, while for reads there are used bursts with a length of 16 words.
A burst length setting of 16 instead of 32 does not have an effect on the actual burst lengths.
So by using the processor, only write burst lengths of 8 words can be generated, which matches 16 bytes here, while read burst lengths of 16 words resp. 32 bytes can be created.
Is that a normal behavior and are there some tweaks to optimize it? The GPMC is certainly not attached to the cache coherency mechanism of the processor. But at least the cache line size is 64 bytes. I don't know how this is being handled within the processor. But I think there is indeed a good chance that there can be transfered 64 bytes at once here.
Thanks,
Mario