IOP Dma example?

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
ubergeek42
Posts: 83
Joined: Wed Jul 13, 2005 12:25 am

IOP Dma example?

Post by ubergeek42 »

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.
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

Post by Lukasz »

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?r ... 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 :-)
ubergeek42
Posts: 83
Joined: Wed Jul 13, 2005 12:25 am

Post by ubergeek42 »

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.
radad
Posts: 246
Joined: Wed May 19, 2004 4:54 pm
Location: Melbourne, Australia

Post by radad »

What about the fileXioRead/Write? They use DMA to send the buffer between EE and IOP ram.
ubergeek42
Posts: 83
Joined: Wed Jul 13, 2005 12:25 am

Post by ubergeek42 »

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.
Polo35
Posts: 25
Joined: Sun Apr 09, 2006 7:22 am

Post by Polo35 »

Hey,

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

Like that:

Code: Select all

		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
Post Reply