Rockbox

Tasklist

FS#11106 - Add test & clean cache coherency functions to mmu-arm.S

Attached to Project: Rockbox
Opened by Jack Halpin (FlynDice) - Monday, 15 March 2010, 04:47 GMT
Last edited by Rafaël Carré (funman) - Tuesday, 13 April 2010, 15:05 GMT
Task Type Patches
Category Drivers
Status Closed
Assigned To No-one
Operating System Another
Severity Low
Priority Normal
Reported Version Release 3.4
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This patch adds some cache coherency functions to mmu-arm.S that only apply to the arm926ej-s core in the newer as3525v2 sansas. You can ask these cores to test the caches to see if they are dirty and use a loop to clean until there are no more dirty lines left in the cache. See page 2-23 of the ARM926EJ-S TRM for more info. There are versions of these functions present in the OF.
This task depends upon

Closed by  Rafaël Carré (funman)
Tuesday, 13 April 2010, 15:05 GMT
Reason for closing:  Accepted
Additional comments about closing:  r25628
Comment by Rafaël Carré (funman) - Monday, 15 March 2010, 19:32 GMT
The at91sam9260, dm320, and tcc780x CPUs also are arm926-ejs
Comment by Thomas Martitz (kugel.) - Monday, 15 March 2010, 19:43 GMT
Aren't these operations generic to ARMv5? The #ifdef should probably just test #if ARM_ARCH >= 5 ?

Are they related to the operations ARMv6 has?

(/me hasn't looked at mmu-armv6.S, not at the mentioned datasheet)
Comment by Jack Halpin (FlynDice) - Monday, 15 March 2010, 21:12 GMT
My understanding was that these just applied to the 926ej-s and 1026ej-s but I have not really researched that aspect. I tested the test_clean_DCache() function by replacing the clean_dcache_range() in pcm-as3525.c. It appears to work just fine but I cannot claim it to work any better yet than what is used now. It is much easier to use though.
Comment by Rafaël Carré (funman) - Saturday, 10 April 2010, 20:13 GMT
Attached patch replace invalidate_dcache and clean_dcache (alias cpucache_flush) for ARMv5

According to linux this works on all armv5tej
According to wikipedia all armv5 are TE, the J bit should have no influence
Comment by Rafaël Carré (funman) - Sunday, 11 April 2010, 16:09 GMT
The ARM Architecture Reference Manual Issue E (v5T) doesn't mention those functions.
The ARM Architecture Reference Manual Issue I (v6) does, but they are marked as optional.

Perhaps we should add a capability defined for CPUs which support it (like arm926ejs)
Comment by Rafaël Carré (funman) - Sunday, 11 April 2010, 16:54 GMT
Add specific define for arm926ej-s
Comment by Rafaël Carré (funman) - Monday, 12 April 2010, 12:20 GMT
Correct functions for as3525(v1) : the cache is 2x smaller than arm920t used by gigabeatf/x and mini2440, so there is 1 less index bit
Tested on Clipv1

The arm920/arm922 caches are 64-way and the arm926 cache is 4-way so the index format obviously can't work on arm926ej-s (it misses some cache sets)

Just needs testing on gigabeat F/X and/or mini2440
Comment by Rafaël Carré (funman) - Tuesday, 13 April 2010, 14:45 GMT
Sync to SVN

Use .rept gnu asm macro for indexed cleaning/invalidating

Loading...