This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#10254 - AMSSansa Place Cache Coherence Routines in DMA Driver
Attached to Project:
Rockbox
Opened by Jack Halpin (FlynDice) - Thursday, 28 May 2009, 07:06 GMT+2
Last edited by Rafaël Carré (funman) - Friday, 26 June 2009, 01:40 GMT+2
Opened by Jack Halpin (FlynDice) - Thursday, 28 May 2009, 07:06 GMT+2
Last edited by Rafaël Carré (funman) - Friday, 26 June 2009, 01:40 GMT+2
|
DetailsThis patch places some cache coherence routines into the dma driver dma-pl081.c. I've been using this for awhile and I believe it works well to have the cache coherence all in one place. Since the mmu is not quite working yet this is a sort of plan for the future that I'm asking for opinions on. Rockbox runs fine with these routines in place and the mmu _not_ enabled. I needed to change some code in ata_sd_as3525.c to pass a size along even though the transfer is peripheral controlled so the *_dcache_range() functions would have proper info. PCM already passes a size so no change is needed there.
I was also wondering if there is a reason we don't use the protection bits in the control register (bits 30:28 p3-23). I realize this is a different caching/buffering than the mmu cacheing but it sounds like it would be advantageous to dma transfers in general. |
This task depends upon
Closed by Rafaël Carré (funman)
Friday, 26 June 2009, 01:40 GMT+2
Reason for closing: Out of Date
Additional comments about closing: another solution has been adopted for SD transfers
Friday, 26 June 2009, 01:40 GMT+2
Reason for closing: Out of Date
Additional comments about closing: another solution has been adopted for SD transfers
However I think using them while we don't have any memory region cached is useless.
Also we don't use protection bits since we run in supervisor mode (no user mode), and we can access all the memory map without restrictions.
I suggest you merge this change into
FS#10048.Yes I understand that part but it appears there are 3 protection bits, 1 for user/supervisor, 1 for bufferable/nonbufferable, and 1 for cacheable/noncacheable that are different and not related to the mmu protection bits but to how the transfer can send data to the AMBA bus.
As far as dump_dcache_range goes, have you had good results with it? I understand why that would be the appropriate choice but when I have actually used it I can't make anything work.
About dump_dcache_range() I can't say I had "good" results since all my tests showed corruption somewhere.
However I still didn't write my results, since I had no comparison. Now I think I could at least compare the display of wps background.
[1] Bufferable or not bufferable Indicates whether the access is bufferable, or not bufferable:
0 = not bufferable
1 = bufferable.
This bit indicates that you can buffer the access. You can, for example, use this bit
to indicate to an AMBA bridge that the read can complete in zero wait states on the
source bus without waiting for it to arbitrate for the destination bus, and for the slave
to accept the data. This bit controls the AHB HPROT[2] signal.
[2] Cacheable or not cacheable Indicates whether the access is cacheable or not cacheable:
0 = not cacheable
1 = cacheable.
This indicates that the access can be cached. You can, for example, use this bit to
indicate to an AMBA bridge that when it sees the first read of a burst of eight, it can
transfer the whole burst of eight reads on the destination bus, rather than pass the
transactions through one at a time. This bit controls the AHB HPROT[3] signal.
I don't know what exactly are these bits , but I just checked the Clip OF and those 3 bits are always set to 0