FS#10184 - Add AMBA bus setting assembler routines to mmu-arm.S(used by: gigabeats,MRobe,Creative,as3525)

Attached to Project: Rockbox
Opened by Jack Halpin (FlynDice) - Sunday, 03 May 2009, 05:41 GMT
Last edited by Jack Halpin (FlynDice) - Friday, 26 June 2009, 02:30 GMT
Task Type Patches
Category Operating System/Drivers
Status Closed
Assigned To No-one
Operating System Another
Severity Low
Priority Normal
Reported Version Version 3.2
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


This patch adds 3 assembler routines that control the relationship between the AMBA bus and the arm processor. I've placed them in mmu-arm.s because the same control register that is used to set the mmu properties is used to control the bus relationship. Both gigabeats, the MRobe, and the creative ZVm use this file currently and I'd like to use it for the as3525 targets. I have not #ifdef'd them as I believe they should work for those targets also. These are the same bus setting routines the gigabeat fx uses to switch from MAX freq to NORMAL freq. I have not removed anything, only added the 3 routines so I am pretty confident this would not break another target. I don't know that I would trust me though so please take a look!
This task depends upon

Closed by  Jack Halpin (FlynDice)
Friday, 26 June 2009, 02:30 GMT
Reason for closing:  Fixed
Additional comments about closing:  The need for these routines does not exist anymore after  FS#10048  was committed.
Comment by Thomas Martitz (kugel.) - Sunday, 03 May 2009, 14:06 GMT
Looks good. I think we can replace the asm code for gigabeat f/x and tms320 with calls to this then.
Comment by Rafaël Carré (funman) - Monday, 04 May 2009, 06:35 GMT
I believe the place for these routines is in system-arm.c or a dedicated new file.

Putting them in mmu-arm.c is only confusing.
Comment by Thomas Martitz (kugel.) - Monday, 04 May 2009, 11:00 GMT
mmu-arm.S! ;)

In fact, mmu-arm.S already contains only semi-related stuff. We should rather rename it. I don't think these deserve a new file. And I think they should be in a .S, not in a .c.
Comment by Rafaël Carré (funman) - Wednesday, 13 May 2009, 09:00 GMT
Which semi-related stuff does it contain?
I thought there is only related stuff : mmu setup, and functions to maintain cache coherency.
Comment by Thomas Martitz (kugel.) - Wednesday, 13 May 2009, 14:21 GMT
Well, all the cache stuff is already only semi-related to the mmu.

MMU is independent of the caches. Also, the icache is not mmu dependent.
Comment by Rafaël Carré (funman) - Friday, 15 May 2009, 13:53 GMT
I don't agree that caches are only semi related to mmu.

For example cachable regions have to be declared in the Translation Table which is looked up by the MMU.

And I think the Memory Management Unit "manages" the caches as well since they are memory; but the BUS clocking mode isn't related to memory at all.
Comment by Thomas Martitz (kugel.) - Friday, 15 May 2009, 13:54 GMT
Hence I opt for renaming :)