Im not sure why the framework has to be so heavy, presumably to please
everyone who may use it, to be generic.

Thanks for the tips ill be doing some more reading and may just do what
you've done as it seems easier, maybe this is because I've had lots of
experience of writing driver.

[email protected] wrote:
> Greetings,
>
> Some time ago, I was on a similar quest.
> I ended up writing my own API's as the only code I found out there for
> DM644x used the c64x driver framework and was horribly convoluted not
> technically supported.
>
> Unfortunately, as much as I'd like to, I can't just post here to the public
> site because it's not GPL'd and is part of a closed source audio driver I
> wrote the DM644x.
> I took a layered approach by writing a memory map wrapper and building my
> EDMA api on top of that.
>
> Using that approach allows you to run the same EDMA code on DSP and ARM
> (compiler controlled obviously).
>
> So,  on DSP, the mmap'er just writes directly to register space, but on
> ARM, it goes through  /dev/mem...
> much better than trying to frick around with the DMA in kernel or waiting
> for it to stabilize in git kernel.
>
> You don't have to get fancy with the API... for most transfers, you just
> set up a parameter ram set, start the transfer, and wait for a completion
> code.
>
> Here's some things to look out for:
>
> Any EDMA register that can be written to comes in a triplet:
> status,set,clear.. you write 1's to set and clear
>
> I wouldn't recommend using transfer completion interrupts, instead use the
> device's interrupt (e.g. McASP) if available or just sleep/poll.
> You can still use the transfer completion codes as long as you don't step
> on anyones toes.
>
> Be careful on setting up your parameter entries, on DM6441 I was able to
> deadlock the EDMA controller that required a power-off to fix.
>
> There *is* a form of CSL that comes with CCS for handling interrupts and
> such... look for <c64.h>
>
> Here's some code to set and clear DMA events:
>
> #define C64X_EVTCLR(index) (*((volatile dword_t *) (0x1800040 + (index *
> sizeof(dword_t)))))
> #define C64X_EVTSET(index) (*((volatile dword_t *) (0x1800020 + (index *
> sizeof(dword_t)))))
>
> #define C64X_CLEAR_EVENT(event) \
>    C64X_EVTCLR(((event) >> 5)) = (1 << ((event) & 31))
>
> #define C64X_SET_EVENT(event) \
>    C64X_EVTSET(((event) >> 5)) = (1 << ((event) & 31))
>
> For example: McASP xmit is event 2, receive is event 3:
>
> To manually trigger event, call C64X_SET_EVENT(2)
> To clear it inside the interrupt, call C64X_CLEAR_EVENT(2)
>
> It will really help if you build a library of macros to write to all the
> registers/bitmasks because you'll pull your hair out debugging later on if
> you dont.
> I might be able to provide more at a later date, but I've got a looming
> deadline.
>
> Regards,
> David
>
>
> DAVID A. KONDRAD
> Software Design Engineer
> On-Q/Legrand
> Telephone (800) 321-2343 x311
> www.onqlegrand.com
>
>
>   


_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to