forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IOP Dma example?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
ubergeek42



Joined: 13 Jul 2005
Posts: 83

PostPosted: Sat Jun 30, 2007 5:25 am    Post subject: IOP Dma example? Reply with quote

I am trying to copy some data from ee ram to iop ram and back again using an iop program. I saw the sifman header file in the ps2sdk, but I got a bit confused because there are 3 different sifDma's(0-2). I looked around in the ps2sdk, but I couldn't find anything that was for the iop.

Or is there a faster/better way to do 2 way transfers from the iop then dma that I am overlooking?

Thanks.
Back to top
View user's profile Send private message AIM Address MSN Messenger
Lukasz



Joined: 19 Jan 2004
Posts: 248
Location: Denmark

PostPosted: Sat Jun 30, 2007 6:34 am    Post subject: Reply with quote

I think the siftoo IOP module by Marcus R. Brown in the ps2sdk is what you are looking for:

http://svn.ps2dev.org/filedetails.php?repname=ps2&path=%2Ftrunk%2Fps2sdk%2Fiop%2Fsystem%2Fsiftoo%2Fsrc%2Fsiftoo.c&rev=0&sc=0

I think it should be used with the sbusintr module.

You might also want to check out the ps2link source, it does EE-IOP communication using SIF DMA, since it's from the days when RPC was unstable :-)
_________________
Lukasz.dk
Back to top
View user's profile Send private message Visit poster's website
ubergeek42



Joined: 13 Jul 2005
Posts: 83

PostPosted: Sat Jun 30, 2007 7:46 am    Post subject: Reply with quote

That siftoo module looks rather incomplete(many of the functions are empty and simply return 0), but the source for ps2link looks to be very promising, after a quick glance at the source code. I should be able to figure it out from that.

Again, thank you, you have been very helpful to me.
Back to top
View user's profile Send private message AIM Address MSN Messenger
radad



Joined: 19 May 2004
Posts: 246
Location: Melbourne, Australia

PostPosted: Sat Jun 30, 2007 10:25 am    Post subject: Reply with quote

What about the fileXioRead/Write? They use DMA to send the buffer between EE and IOP ram.
Back to top
View user's profile Send private message
ubergeek42



Joined: 13 Jul 2005
Posts: 83

PostPosted: Sat Jun 30, 2007 10:34 am    Post subject: Reply with quote

From looking at the source for fileXio, it seems to be one way, only writing to ee ram, though I imagine swapping the src/dest pointers would reverse it. It seems so simple now that I see some actual code using it. Thanks guys.
Back to top
View user's profile Send private message AIM Address MSN Messenger
Polo35



Joined: 09 Apr 2006
Posts: 25

PostPosted: Sat Jun 30, 2007 8:04 pm    Post subject: Reply with quote

Hey,

When you're at iop side you have to suspend interupt before performing dma transfert and resume it after.

Like that:
Code:

      while(SifDmaStat(dma_id) >= 0);

      sifdma.src = src;
      sifdma.dest = dest;
      sifdma.size = size;
      sifdma.attr = 0;
      CpuSuspendIntr(&intr);
      dma_id = SifSetDma(&sifdma, 1);
      CpuResumeIntr(intr);


While at ee side you don't have to use interupts.


Other way to access iop ram from ee is to use sbv code ( smem.c ) which use memory mapping to access iop ram in kernel mode.

From my own experience, it's largely faster to read/write iop ram with memcpy in kernel mode then using dma transfert.

But i don't know if ps2sdk give a way make same ting from iop to ee ram.

Best regards

Polo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group