GP2X Dual Core Cpu Information


coderunner

Still Fresh
Joined
Feb 18, 2006
Messages
10
Hi,

I was checking out rlyeh's library that supports dual cpu operations on the GP2X. I'm curious myself about operating/syncing/etc the dual cpu's, but couldn't totally figure out what was going on in his source. Does anyone have any links to resources where I could read up on controlling the dual cores? I'm used to operating at a level 'above' what seems to be going on in his code by using threads/etc, but I'd like to learn more. If this has been answered before, I apologize, I tried searching the forums and didn't find anything.

Thanks

Edit: Oops, I found post mentioning to read the MagicEyes documentation...I'll try looking into that. And from the other posts, it seems that there is alot of documentation already out there, but its a matter of deciphering whats available? But any other resources I'd appreciate regardless. Amazing how narrowing the sesarch to just the developer's corner made it alot easier to search for related topics.
 
The preferred way of communicating between the two cores is between the built in communication layer where there 15 registers with associative interrupts. Unfortunately, we can't access the interrupts under Linux without writing modules, so most people (including Rlyeh) use a porton of non-cached, non-buffered RAM to communicate between the cores. This however also means it's quite slow.

If you keep searching the developer forums, you should come across my code which uses a similar technique, but it may be easier to understand, as it's not meant to be quite so "generic".
 
Thanks for the information squidge. I was reading through the magic eyes documentation also, and they mention that anytime an I/O operation is done on hte registers, they also generate an interrupt using the DUALINT920/DUALINT940 registers with the set bit indicating the source of the interrupt. However, I dont see anywhere where they mention which numbered interrupt is raised when DUALINT920/940 is flagged. Does anyone have this information? Then it would be a matter of writing a irq_handler for these and registering it with the kernel I think.

EDIT: The magic-eyes interrupt section mentions int 26 is the DUALCPUINT interrupt. That seems like the most likely candidate...I haven't touched low-level linux drivers/modules programming in quite a long while. If I am able to free up some time in the future to sit down and work on this, I will make a hack at it and see how it goes.
 
Have a look a drivers/char/dualcpu.(h|c) for how to write a driver that talks to the 940t. Be nice if someone made a nice generic module for this so we could load a binary into the upper area and have some ioctls to talk to the registers.
 
hmm, just to continue the module idea, would it be possible to write a couple of modules and have them load with your program and then unload after you are done?

Preferable keeping them in your programs dir...
 
I should say so, even if there isn't a system library function for doing it, you can still execute shell commands, so it should be possible.
 
So, in theory, you could write two modules, both of which get loaded into the kernel, one of which could provide access to the primary CPU's 'protected' functions (interrupts for example) and another to poke the 2nd CPU into life a bit easier..

hmmm, maybe I'll look into all that at some point :)
 
What I hope for one of these days is a good means to decode OGG audio on the 940T. That'd take a good bit of burden off the 920 to give me more headroom for my engine to run with...
 
Back
Top