Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

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, 05:47 GMT+2
Last edited by Rafaël Carré (funman) - Tuesday, 13 April 2010, 17:05 GMT+2
Task Type Patches
Category Drivers
Status Closed
Assigned To No-one
Player Type Another
Severity Low
Priority Normal
Reported Version Release 3.4
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
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.
   0001-add-testclean-funcs.patch (3.4 KiB)
 b/firmware/target/arm/mmu-arm.S |   54 ++++++++++++++++++++++++++++++++++++++++
 b/firmware/target/arm/mmu-arm.h |    8 +++++
 2 files changed, 62 insertions(+)

This task depends upon

Closed by  Rafaël Carré (funman)
Tuesday, 13 April 2010, 17:05 GMT+2
Reason for closing:  Accepted
Additional comments about closing:  r25628
Comment by Rafaël Carré (funman) - Monday, 15 March 2010, 20:32 GMT+2
The at91sam9260, dm320, and tcc780x CPUs also are arm926-ejs
Comment by Thomas Martitz (kugel.) - Monday, 15 March 2010, 20:43 GMT+2
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, 22:12 GMT+2
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, 22:13 GMT+2
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
   cache_flush_armv5.diff (1.7 KiB)
 b/firmware/target/arm/mmu-arm.S |   12 ++++++++++++
 1 file changed, 12 insertions(+)

Comment by Rafaël Carré (funman) - Sunday, 11 April 2010, 18:09 GMT+2
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, 18:54 GMT+2
Add specific define for arm926ej-s
   cache_flush_arm926ejs.diff (2.1 KiB)
 b/firmware/target/arm/mmu-arm.S |   12 ++++++++++++
 b/tools/configure               |    2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

Comment by Rafaël Carré (funman) - Monday, 12 April 2010, 14:20 GMT+2
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
   cache_flush_arm926_PLUS_smaller_as3525_flush.diff (4.5 KiB)
 b/firmware/export/as3525.h      |    2 ++
 b/firmware/export/s3c2440.h     |    2 ++
 b/firmware/target/arm/mmu-arm.S |   30 ++++++++++++++++++++++++++++--
 b/tools/configure               |    2 +-
 4 files changed, 33 insertions(+), 3 deletions(-)

Comment by Rafaël Carré (funman) - Tuesday, 13 April 2010, 16:45 GMT+2
Sync to SVN

Use .rept gnu asm macro for indexed cleaning/invalidating
   cache_flush_arm926_PLUS_smaller_as3525_flush.diff (5.3 KiB)
 b/firmware/export/as3525.h      |    2 +
 b/firmware/export/s3c2440.h     |    2 +
 b/firmware/target/arm/mmu-arm.S |   52 +++++++++++++++++++++++-----------------
 b/tools/configure               |    2 -
 4 files changed, 35 insertions(+), 23 deletions(-)

Loading...