DMA SSP to EMAC

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DMA SSP to EMAC

471 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dburke on Sun Aug 24 13:06:04 MST 2014
Hi

I already have a test, based on ssp_dma.c that DMAs ethernet packets from EMAC to SSP on loopback and then DMAs the same packet back to EMAC and transmits over ethernet and works fine without errors

One half of my end target is transfer of  ethernet packets to SSP so that is working quite simply as the EMAC supplies the packet length to set up the DMA transfer

The other half is to DMA varying length ethernet packets from SSP to EMAC, The device on SSP doesn't supply a packet length so I need to extract  the packet length from the ethernet frame. I have in mind two solutions

1 Setup DMA config to transfer the header to EMAC memory, read the data packet length and set DMA config to read the correct packet length and run a second DMA. I think I can achieve this reasonably easily.

2 I think it would be more elegant to use a linked list (DMA LLI). This would mean setting up the DMA for the header and packet transfers as two entities. However this would mean as before, DMA the header, read the packet length and set the correct byte transfer count in the DMA control in between the two parts of the linked list items. Is that achievable as there are warnings in the UM not to alter the DMA registers while DMA is active. Does that mean I can't use a linked list or is it feasible because the DMA won't be actually running while updating the count?

Regards
Labels (1)
0 Kudos
Reply
1 Reply

439 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by DF9DQ on Sun Aug 31 23:27:31 MST 2014
If you use a linked list, then by the time you have a chance to inspect the payload length in the Ethernet header (after the first DMA transfer has ended), the DMA will already have loaded the second entry from the linked list, and it's too late to alter the transfer length.

In general there's nothing wrong with modifying values in a linked list, but it's only safe as long as you can guarantee the DMA won't access the entry before you're done with the modifications.




0 Kudos
Reply