Skip to contentSkip to conversation

MPC8xx and IDMA !?!?

DISCUSSION Steven Scholz 2 participants 4 messages Apr 17, 2002 – Apr 23, 2002

lore
Share & tools
lore
#0 lore raw

Hi there,,

a while ago (aprox. kernel 2.4.11) I succesfully played around with IDMA on MPC855/860.

This old kernel is still working on my hardware.

BUT:

The code is NOT working on recent kernels (I pulled it yesterday).

I set up the IDMA. Trigger DREQ0 using a GPIO pin. SDMACK1 is going LOW but then instead of toggeling it just stays LOW. And instead of transfering data the MPC8xx just hangs.

Have there been changes to the DMA stuff in the MPC8xx?
Or in the DPRAM layout or maybe in the CPM interrupt stuff (although I disabled the IDMA int.) ???

Any idea and/or help is very much appreciated!

Thanks,

Steven

--
mfg Steven Scholz

imc Meßsysteme GmbH
Voltastr. 5
13355 Berlin
Germany
fon: +49 30 467090-0
fax: +49 30 4631576

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw

To whom it may concern,

Quoted 9 lines

a while ago (aprox. kernel 2.4.11) I succesfully played around with IDMA on MPC855/860.
...
The code is NOT working on recent kernels (I pulled it yesterday). I set up the IDMA. Trigger DREQ0 using a GPIO pin. SDMACK1 is going LOW but then instead of toggeling it just stays LOW. And instead of transfering data the MPC8xx just hangs.

Have there been changes in the DPRAM layout ..?

I (think I) figured out the problem:

I use

	m8xx_cpm_dpalloc( sizeof(idma_bd_t) );

to allocate space for the buffer descriptors in the DP ram.

The User Man says "Note that IBASE should be burst-aligned (divisible by 16)"
(Does the English "should be" means "have to be, otherwise everything goes wrong!"???)

The older kernel versions always returned (by pure accident?) a burst-aligned address (%16) (e.g. 0x850 offset from dpmem start). So everything was fine.

The newer kernels return (by pure accident?) a NON burst-aligned address (e.g. 0x0918) und the IDMA crashes.

So my workaround for now is to allocate more than I need and correct the value for IBASE like

	ibase += ibase % 16

Could anyone think of a better solution? Since I waste at least 16 bytes in the DPRAM.

BTW:
Where is Wolfgangs m8xx_cpm_dpfree() !?!?
I can't find it in the recent source trees.

Cheers,

Steven

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw
Quoted 6 lines · Steven Scholz

So my workaround for now is to allocate more than I need and correct the value for IBASE like

	ibase += ibase % 16

Could anyone think of a better solution? Since I waste at least 16 bytes in the DPRAM.

That's the way I always did it on 8xx. For 8260, I added a second alignment parameter to dpram_alloc(). If the address it would return isn't properly aligned, it will waste sufficient memory behind your back to make this happen :-) At least it won't waste any if you align and the sizes are modulo the alignment.

Quoted 1 line

Where is Wolfgangs m8xx_cpm_dpfree() !?!?

Sitting in my basket of things to do. I wanted to add the alignment to the 8xx as well, and this complicates the free function because it doesn't know alignment was done with the region you may have allocated.

	-- Dan

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#3 lore raw

Hi,

can I change the direction of an IDMA channel just by changing DMA Channel Mode Register (ipr_dcmr) without STOPing and INITing the IDMA channel?

Cheers,

Steven

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/