There's a good reason why you did not need to call invalidate on the DSP side when using the regular RPCs: The DSP mailbox interrupt handler (
mlb.c:mlb_irq_handler()) already calls
BCACHE_wbInvAll() ! (
unfortunately I have no good explanation _why_ this call is needed (it shouldn't be))
This should explain your observations.
In case of fastcalls, there are no 'implicit' writeback/invalidate calls, that's why you had to do them yourself.
Regarding L2SRAM:
I just added four new testcases to the c64_tc application:
- 46: DSP writes random data to L2SRAM and builds checksum, GPP also builds checksum and compares it to DSP checksum; uses regular RPCs; DSP calls cache_wb() after data has been written
- 47: GPP writes random data to L2SRAM and builds checksum, DSP also builds checksum and compares it to GPP checksum, uses regular RPCs; DSP calls cache_inv() before reading data
- 48: DSP writes random data to L2SRAM and builds checksum, GPP also builds checksum and compares it to DSP checksum; uses fastcall RPCs
- 49: GPP writes random data to L2SRAM and builds checksum, DSP also builds checksum and compares it to GPP checksum; uses fastcall RPCs
Each test executes 1000 iterations. In each iteration, 64 KBytes of pseudo-random data is being generated.
I've run these tests several times and the checksums always matched, so I would say that it _is_ safe to use L2SRAM for passing data (
at least on my units).
Could you please run these tests, too ? I've attached the source code and binaries.
Regarding the (supposed) linker command line bug in dsp/install.mk:
The command line is fine, I think you mistook '
-z' for '
-m'. '
-z' just tells the compiler/linker frontend that the following options are linker options. I.e. similar to GCC
-Wl except that the linker options use a 'normal' syntax instead of being separated by commas.
Regarding your (continuing) NAND troubles:
First of all, it really s*cks that you had to reflash _again_
Since the DSP is only active/powered on while a DSP app. is running, and most likely it was powered down by the time you tried to log out, I'd suspect that for some unknown reason, some kernel memory (filesystem buffers?) got corrupted earlier on. On the other hand, it can't be just a software issue since it only seems to affect certain units.
Q: Did you still overclock your unit ? Did you run any EDMA tests ? Maybe you could try to avoid EDMA for a while to see if it has anything to do with this issue. Since you just reflashed, maybe you could do a fresh reboot and run some non-DMA DSP tests (in a loop) overnight ?!
Regarding dsp_physgpp_to_physdsp():
The documentation is a bit misleading here, the
dsp_mem_region_t.phys_addr field stores the GPP physical address. Most of the time this is also the DSP physical address, the only exception being the DSP SRAM memory areas.
Regarding IDMA:
I have never used that. You are probably aware that it's not a general purpose DMA. It is limited to DSP-local memory/SRAM (channel 1) resp. external registers (NOT memory) (channel 0).
According to the docs (
spru871k), the src/dst addresses have to be aligned to 32 bytes and the IDMA registers must be written to in a specific order (src addr, dst addr, count). Writing to 'count' should trigger the transfer.
It's probably not worth the trouble to use IDMA, unless you intend to write DSP-side device drivers where register writes become a performance bottleneck.
c64tools_l2sram_testcase_update-09Jan2014.tar.gz