1 / 56

EDMA3 Keystone SoC Devices

EDMA3 Keystone SoC Devices. Agenda. What is DMA? EDMA Architecture Definition of EDMA3 Terminology Synchronization Indexing Example to Summarize Trigger Mechanisms Action Mechanisms Linking Chaining QDMA EDMA3 LLD Review. What is DMA?. What is DMA? EDMA Architecture

tilly
Download Presentation

EDMA3 Keystone SoC Devices

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EDMA3 Keystone SoC Devices

  2. Agenda • What is DMA? • EDMA Architecture • Definition of EDMA3 Terminology • Synchronization • Indexing • Example to Summarize • Trigger Mechanisms • Action Mechanisms • Linking • Chaining • QDMA • EDMA3 LLD Review

  3. What is DMA? • What is DMA? • EDMA Architecture • Definition of EDMA3 Terminology • Synchronization • Indexing • Example to Summarize • Trigger Mechanisms • Action Mechanisms • Linking • Chaining • QDMA • EDMA3 LLD Review

  4. Why Use DMA? D0 buf_0 buf_1 D1 D2 D3 • The primary function of DMA is to move data without direct CPU involvement. • What information does a DMA controller need to perform a transfer? • Source address • Destination address • Length (or size) • What options might be useful to perform the transfer? • Do you want to interrupt the CPU when the transfer is complete? • Is this transfer synchronized to an event (like the McBSP RCV buffer is full)? • How do the source and destination addresses update? (same, +1, -1, +4 ?)

  5. EDMA3 EVTx TC0 Chain DMA TC1 Manual Q1 Qn Q0 Q2 TC2 TeraNet TCn QDMA Trigger Word DMA in KeyStone Devices There are MANY forms of DMA (Direct Memory Access) in the KeyStone Architecture. • EDMA3 – Enhanced DMA handles M DMA CHs and XQDMA CHs • DMA – M Channels that can be triggered manually or by events/chaining • QDMA – Xchannels of Quick DMA triggered by writing to a trigger word Resources connected to TeraNet • IDMA – 2 CHs of Internal DMA (PeriphCfg, Xfr L1 ↔ L2) IDMA L1D L2 Ch0 Ch1 L1 L2 PERIPH • Peripheral DMAs– Each master device hooked to the TeraNet • has its own DMA (PktDMA) (e.g. SRIO, EMAC, etc.)

  6. EDMA Architecture • What is DMA? • EDMA Architecture • Definition of EDMA3 Terminology • Synchronization • Indexing • Example to Summarize • Trigger Mechanisms • Action Mechanisms • Linking • Chaining • QDMA • EDMA3 LLD Review

  7. Queue PSET 0 PSET 1 Q0 Q1 Q2 PSET X Qm EDMA3 Architecture En E1 E0 CC TC EvtReg (ER) Evt Enable Reg(EER) TC0 .. . TC1 TRSubmit Evt Set Reg(ESR) Data TeraNet TC2 TCm Chain EvtReg(CER) EarlyTCC Int Pending Reg – IPR CompletionDetection NormalTCC Int Enable Reg – IER Memory Protection Global Interrupt & Region Interrupt (0-n)

  8. Shadow Regions and Memory Protection • Multi-level protection: • Regions restrict access to the channels from the peripheral masters. • Memory Protection provides restricted access to different memory spaces within the device. • Each region has a copy of the channel configuration registers to configure the channels allocated to the specific region (DRAEn and DRAEHn, QRAEn). • In addition to the shadow regions, there is a global region access to the Channel Controller. • Memory protection is provided by setting the privilege level, requestor, and types of access allowed for each region (MPPAn and MPPAG). • Each shadow region is also associated with a completion interrupt that can be tied to different interrupt events.

  9. Shadow Region

  10. Definition of EDMA3 Terminology • What is DMA? • EDMA Architecture • Definition of EDMA3 Terminology • Synchronization • Indexing • Example to Summarize • Trigger Mechanisms • Action Mechanisms • Linking • Chaining • QDMA • EDMA3 LLD Review

  11. Original Data Block Copied Data Block DMA Direct Memory Access (DMA) Goal : Examples : • Controlled by : • Copy from memory to memory – HARDWARE memcpy(dst, src, len); • Faster than CPU LD/ST. One INT per block vs. one INT per sample • Import raw data from off-chip to on-chip before processing. • Export results from on-chip to off-chip afterward. • Transfer Configuration (i.e., Parameter Set - aka PaRAM or PSET) • Transfer configuration primarily includes 8 control registers. Source BCNT Length ACNT Transfer Configuration Destination

  12. Block Frame Frame 1 Elem 1 Frame 2 Elem 2 .. .. Elem N Frame M B Count C Count B Count (# Elements) C Count (# Frames) A Count (Element Size) 31 31 16 16 15 15 0 0 How Much to Move? Element A Count (# of contiguous bytes) Transfer Configuration Options Source B A Transfer Count Destination Index Cnt Reload Link Addr Index Index Rsvd C 9

  13. Example: How to VIEW the Transfer • Let’s start with a simple example. • We need to transfer 12 bytes from “here” to “there.” NOTE: These are contiguous memory locations 8-bit • What is ACNT, BCNT, and CCNT? Hmmm…. • You can view the transfer several ways: ACNT = 1 BCNT = 4 CCNT = 3 ACNT = 2 BCNT = 2 CCNT = 3 ACNT = 12 BCNT = 1 CCNT = 1 = 12 • Which “view” is the best? Well, that depends on what your system needs and the type of sync and indexing (covered later…)

  14. Synchronization • What is DMA? • EDMA Architecture • Definition of EDMA3 Terminology • Synchronization • Indexing • Example to Summarize • Trigger Mechanisms • Action Mechanisms • Linking • Chaining • QDMA • EDMA3 LLD Review

  15. A – Synchronization • An event (i.e.,McBSP receive register full) triggersthe transfer of exactly 1 array of ACNT bytes (2 bytes) • Example: McBSP tied to a codec. You want to sync each transfer of a 16-bit word to the receive buffer being full or the transmit buffer being empty. EVTx EVTx EVTx Frame 1 Array1 Array2 Array BCNT Frame 2 Array1 Array2 Array BCNT Frame CCNT Array1 Array2 Array BCNT

  16. AB – Synchronization • An event triggers a two-dimensional transfer of BCNT arraysof ACNT bytes (A*B). • Example: Line of video pixels; Each line has BCNT pixels consisting of 3 bytes each – Y, Cb, Cr EVTx Frame 1 Array1 Array2 Array BCNT Frame 2 Array1 Array2 Array BCNT Frame CCNT Array1 Array2 Array BCNT

  17. Indexing • What is DMA? • EDMA Architecture • Definition of EDMA3 Terminology • Synchronization • Indexing • Example to Summarize • Trigger Mechanisms • Action Mechanisms • Linking • Chaining • QDMA • EDMA3 LLD Review

  18. A-Sync EVTx EVTx EVTx . . ‘BIDX ‘CIDXA . . Indexing: ‘BIDX, ‘CIDX • EDMA3 has two types of indexing: ‘BIDX and ‘CIDX • Each index can be set separately for SRC and DST (next slide…) • ‘BIDX= index in bytes between ACNT arrays (same for A-sync and AB-sync) • ‘CIDX= index in bytes between BCNT frames (different for A-sync vs. AB-sync) • ‘BIDX/’CIDX: signed 16-bit, -32768 to +32767 AB-Sync EVTx . . ‘BIDX CIDXAB . . • CIDX distance is calculated from the starting address of the previouslytransferred block (array for A-sync, frame for AB-sync) to the next frame tobe transferred.

  19. 1 3 5 7 9 11 13 15 Indexed Transfers • EDMA3 has 4 indexes allowing higher flexibility forcomplex transfers: • SRCBIDX = # bytes between arrays (Ex: SRCBIDX = 2) • SRCCIDX = # bytes between frames (Ex: SRCCIDXA = 2, SRCCIDXAB = 4) • Note: ‘CIDX depends on the synchronization used – “A” or “AB” • DSTBIDX = # bytes between arrays (Ex: DSTBIDX = 3) • DSTCIDX = # bytes between frames (Ex: DSTCIDXA = 5, DSTCIDXAB = 8) SRCBIDX DSTBIDX 1 3 DSTCIDXA SRCCIDXA 5 7 SRC (8-bit) 9 11 (contiguous) DST (8-bit) (contiguous)

  20. Example: Using Indexing • Remember this example? For each “view”, fillin the proper SOURCE index values: NOTE: These are contiguous memory locations 8-bit ACNT = 1 BCNT = 4 CCNT = 3 ACNT = 2 BCNT = 2 CCNT = 3 ACNT = 12 BCNT = 1 CCNT = 1 ‘BIDX = 1 ‘CIDXA = 1 ‘CIDXAB = 4 ‘BIDX = 2 ‘CIDXA = 2 ‘CIDXAB = 4 ‘BIDX = N/A ‘CIDXA = N/A ‘CIDXAB = N/A • Which “view” is the best? Well, that depends on what you are transferring from/to and which sync mode is used.

  21. Example to Summarize • What is DMA? • EDMA Architecture • Definition of EDMA3 Terminology • Synchronization • Indexing • Example to Summarize • Trigger Mechanisms • Action Mechanisms • Linking • Chaining • QDMA • EDMA3 LLD Review

  22. Options Solution Source Options BCNT ACNT &pixel_7 Destination 3 4 DSTBIDX SRCBIDX &myDest BCNTRLD LINK 8 bits 4 6 DSTCIDX SRCCIDX = BCNT 0xFFFF (later) RSVD CCNT 0 0 31 0 RSVD 1 31 0 Parameters for a Single Block Transfer 8-bit Pixels 8 7 &myDest: Goals: 0 1 2 3 4 5 9 8 • Transfer a block of 8-bit pixels from &pixel_7 to &myDest • Transfer all pixels as quickly as possible (single EVTx – xfr all data, AB-sync) 6 7 8 9 10 11 10 9 12 13 14 15 16 17 10 11 18 19 20 21 22 23 13 24 25 26 27 28 29 14 (Src: &pixel_7) 15 Note: data values arein contiguous memory 16 19 Param Set (active) 20 21 22 • Why can’t we use ACNT=1? • How does this transfer work inside the EDMA? • What happens when the transfer completes? • How do you program this transfer?

  23. Options Source BCNT ACNT Destination DSTBIDX SRCBIDX BCNTRLD LINK 8 bits DSTCIDX SRCCIDX RSVD CCNT 31 0 Parameters for a Single Block Transfer 8-bit Pixels 7 8 &myDest: Goals: 0 1 2 3 4 5 8 9 • Transfer a block of 8-bit pixels from &pixel_7 to &myDest • Transfer all pixels as quickly as possible(single EVTx – xfr all data, AB-sync) 6 7 8 9 10 11 9 10 12 13 14 15 16 17 11 10 18 19 20 21 22 23 13 24 25 26 27 28 29 14 (Src: &pixel_7) 15 Note: data values arein contiguous memory 16 19 Param Set (active) Solution 20 21 22 • Why can’t we use ACNT=1? • How does this transfer work inside the EDMA? • What happens when the transfer completes? • How do you program this transfer? 31 0

  24. Options Source BCNT ACNT Destination DSTBIDX SRCBIDX BCNTRLD LINK 8 bits DSTCIDX SRCCIDX RSVD CCNT 31 0 Parameters for a Single Block Transfer 8-bit Pixels 7 8 &myDest: Goals: 0 1 2 3 4 5 8 9 • Transfer a block of 8-bit pixels from &pixel_7 to &myDest • Transfer all pixels as quickly as possible (single EVTx – xfr all data,AB-sync) 6 7 8 9 10 11 9 10 12 13 14 15 16 17 11 10 18 19 20 21 22 23 13 24 25 26 27 28 29 14 (Src: &pixel_7) 15 Note: data values arein contiguous memory 16 19 Param Set (active) Solution 20 21 22 • Why can’t we use ACNT=1? • How does this transfer work inside the EDMA? • What happens when the transfer completes? • How do you program this transfer? 31 0

  25. Options Source BCNT ACNT Destination DSTBIDX SRCBIDX BCNTRLD LINK 8 bits DSTCIDX SRCCIDX RSVD CCNT 31 0 Parameters for a Single Block Transfer 8-bit Pixels 8 7 &myDest: Goals: 0 1 2 3 4 5 8 9 • Transfer a block of 8-bit pixels from &pixel_7 to &myDest • Transfer all pixels as quickly as possible (single EVTx – xfr all data,AB-sync) 6 7 8 9 10 11 10 9 12 13 14 15 16 17 10 11 18 19 20 21 22 23 13 24 25 26 27 28 29 14 (Src: &pixel_7) 15 Note: data values arein contiguous memory 16 19 Param Set (active) Solution 20 AB-sync 21 22 3 4 • Why can’t we use ACNT=1? • How does this transfer work inside the EDMA? • What happens when the transfer completes? • How do you program this transfer? 1 31 0

  26. Options Source BCNT ACNT Destination DSTBIDX SRCBIDX BCNTRLD LINK 8 bits DSTCIDX SRCCIDX RSVD CCNT 31 0 Parameters for a Single Block Transfer 8-bit Pixels 8 7 &myDest: Goals: 0 1 2 3 4 5 8 9 • Transfer a block of 8-bit pixels from &pixel_7 to &myDest • Transfer all pixels as quickly as possible (single EVTx – xfr all data,AB-sync) 6 7 8 9 10 11 10 9 12 13 14 15 16 17 10 11 18 19 20 21 22 23 13 24 25 26 27 28 29 14 (Src: &pixel_7) 15 Note: data values arein contiguous memory 16 19 Param Set (active) Solution 20 AB-sync 21 22 3 4 • Why can’t we use ACNT=1? • How does this transfer work inside the EDMA? • What happens when the transfer completes? • How do you program this transfer? 1 31 0

  27. Options Source BCNT ACNT Destination DSTBIDX SRCBIDX BCNTRLD LINK 8 bits DSTCIDX SRCCIDX RSVD CCNT 31 0 Parameters for a Single Block Transfer 8-bit Pixels 8 7 &myDest: Goals: 0 1 2 3 4 5 8 9 • Transfer a block of 8-bit pixels from &pixel_7 to &myDest • Transfer all pixels as quickly as possible (single EVTx – xfr all data,AB-sync) 6 7 8 9 10 11 10 9 12 13 14 15 16 17 10 11 18 19 20 21 22 23 13 24 25 26 27 28 29 14 (Src: &pixel_7) 15 Note: data values arein contiguous memory 16 19 Param Set (active) Solution 20 AB-sync 21 22 3 4 • Why can’t we use ACNT=1? • How does this transfer work inside the EDMA? • What happens when the transfer completes? • How do you program this transfer? 1 31 0

  28. Options Source BCNT ACNT Destination DSTBIDX SRCBIDX BCNTRLD LINK 8 bits DSTCIDX SRCCIDX RSVD CCNT 31 0 Parameters for a Single Block Transfer 8-bit Pixels 8 7 &myDest: Goals: 0 1 2 3 4 5 8 9 • Transfer a block of 8-bit pixels from &pixel_7 to &myDest • Transfer all pixels as quickly as possible (single EVTx – xfr all data, AB-sync) 6 7 8 9 10 11 10 9 12 13 14 15 16 17 10 11 18 19 20 21 22 23 13 24 25 26 27 28 29 14 (Src: &pixel_7) 15 Note: data values arein contiguous memory 16 19 Param Set (active) Solution 20 A-sync? 21 22 4 • Why can’t we use ACNT=1? • How does this transfer work inside the EDMA? • What happens when the transfer completes? • How do you program this transfer? 31 0

  29. Options Source BCNT ACNT Destination DSTBIDX SRCBIDX BCNTRLD LINK 8 bits DSTCIDX SRCCIDX RSVD CCNT 31 0 Parameters for a Single Block Transfer 8-bit Pixels 8 7 &myDest: Goals: 0 1 2 3 4 5 8 9 • Transfer a block of 8-bit pixels from &pixel_7 to &myDest • Transfer all pixels as quickly as possible (single EVTx – xfr all data, AB-sync) 6 7 8 9 10 11 10 9 12 13 14 15 16 17 10 11 18 19 20 21 22 23 13 - 11 24 25 26 27 28 29 14 - 12 (Src: &pixel_7) 15 - 13 Note: data values arein contiguous memory 16 - 14 19 - 15 Param Set (active) Solution 20 - 16 A-sync? 21 - 17 22 - 18 12 • Why can’t we use ACNT=1? • How does this transfer work inside the EDMA? • What happens when the transfer completes? • How do you program this transfer? 31 0

  30. Options Source BCNT ACNT Destination DSTBIDX SRCBIDX BCNTRLD LINK 8 bits DSTCIDX SRCCIDX RSVD CCNT 31 0 Parameters for a Single Block Transfer 8-bit Pixels 8 7 &myDest: Goals: 0 1 2 3 4 5 8 9 • Transfer a block of 8-bit pixels from &pixel_7 to &myDest • Transfer all pixels as quickly as possible (single EVTx – xfr all data, AB-sync) 6 7 8 9 10 11 9 10 12 13 14 15 16 17 10 11 18 19 20 21 22 23 13 24 25 26 27 28 29 14 (Src: &pixel_7) 15 Note: data values arein contiguous memory 16 19 Param Set (active) Solution 20 AB-sync 21 &pixel_7 22 3 4 &myDest • Why can’t we use ACNT=1? • How does this transfer work inside the EDMA? • What happens when the transfer completes? • How do you program this transfer? 1 31 0

  31. Options Source BCNT ACNT Destination DSTBIDX SRCBIDX BCNTRLD LINK 8 bits DSTCIDX SRCCIDX RSVD CCNT 31 0 Parameters for a Single Block Transfer 8-bit Pixels 7 8 &myDest: Goals: 0 1 2 3 4 5 9 8 • Transfer a block of 8-bit pixels from &pixel_7 to &myDest • Transfer all pixels as quickly as possible (single EVTx – xfr all data, AB-sync) 6 7 8 9 10 11 10 9 12 13 14 15 16 17 11 10 18 19 20 21 22 23 13 24 25 26 27 28 29 14 (Src: &pixel_7) 15 Note: data values arein contiguous memory 16 19 Param Set (active) Solution 20 AB-sync 21 &pixel_7 22 3 4 &myDest 6 • Why can’t we use ACNT=1? • How does this transfer work inside the EDMA? • What happens when the transfer completes? • How do you program this transfer? 1 31 0

  32. Options Source BCNT ACNT Destination DSTBIDX SRCBIDX BCNTRLD LINK 8 bits DSTCIDX SRCCIDX RSVD CCNT 31 0 Parameters for a Single Block Transfer 8-bit Pixels 7 8 &myDest: Goals: 0 1 2 3 4 5 9 8 • Transfer a block of 8-bit pixels from &pixel_7 to &myDest • Transfer all pixels as quickly as possible (single EVTx – xfr all data, AB-sync) 6 7 8 9 10 11 9 10 12 13 14 15 16 17 11 10 18 19 20 21 22 23 13 24 25 26 27 28 29 14 (Src: &pixel_7) 15 Note: data values arein contiguous memory 16 19 Param Set (active) Solution 20 AB-sync 21 &pixel_7 22 3 4 &myDest 4 6 • Why can’t we use ACNT=1? • How does this transfer work inside the EDMA? • What happens when the transfer completes? • How do you program this transfer? 1 31 0

  33. Options Source BCNT ACNT Destination DSTBIDX SRCBIDX BCNTRLD LINK 8 bits DSTCIDX SRCCIDX RSVD CCNT 31 0 Parameters for a Single Block Transfer 8-bit Pixels 7 8 &myDest: Goals: 0 1 2 3 4 5 8 9 • Transfer a block of 8-bit pixels from &pixel_7 to &myDest • Transfer all pixels as quickly as possible (single EVTx – xfr all data, AB-sync) 6 7 8 9 10 11 10 9 12 13 14 15 16 17 10 11 18 19 20 21 22 23 13 24 25 26 27 28 29 14 (Src: &pixel_7) 15 Note: data values arein contiguous memory 16 19 Param Set (active) Solution 20 AB-sync 21 &pixel_7 22 3 4 &myDest 4 6 • Why can’t we use ACNT=1? • How does this transfer work inside the EDMA? • What happens when the transfer completes? • How do you program this transfer? 0 0 1 31 0

  34. Options Source BCNT ACNT Destination DSTBIDX SRCBIDX BCNTRLD LINK 8 bits DSTCIDX SRCCIDX RSVD CCNT 31 0 Parameters for a Single Block Transfer 8-bit Pixels 7 8 &myDest: Goals: 0 1 2 3 4 5 8 9 • Transfer a block of 8-bit pixels from &pixel_7 to &myDest • Transfer all pixels as quickly as possible (single EVTx – xfr all data, AB-sync) 6 7 8 9 10 11 10 9 12 13 14 15 16 17 11 10 18 19 20 21 22 23 13 24 25 26 27 28 29 14 (Src: &pixel_7) 15 Note: data values arein contiguous memory 16 19 Param Set (active) Solution 20 AB-sync 21 &pixel_7 22 3 4 &myDest 4 6 • Why can’t we use ACNT=1? • How does this transfer work inside the EDMA? • What happens when the transfer completes? • How do you program this transfer? BCNT or any 0 0 1 31 0

  35. Options Source BCNT ACNT Destination DSTBIDX SRCBIDX BCNTRLD LINK 8 bits DSTCIDX SRCCIDX RSVD CCNT 31 0 Parameters for a Single Block Transfer 8-bit Pixels 7 8 &myDest: Goals: 0 1 2 3 4 5 8 9 • Transfer a block of 8-bit pixels from &pixel_7 to &myDest • Transfer all pixels as quickly as possible(single EVTx – xfr all data, AB-sync) 6 7 8 9 10 11 10 9 12 13 14 15 16 17 11 10 18 19 20 21 22 23 13 24 25 26 27 28 29 14 (Src: &pixel_7) 15 Note: data values arein contiguous memory 16 19 Param Set (active) Solution 20 AB-sync 21 &pixel_7 22 3 4 &myDest 4 6 • Why can’t we use ACNT=1? • How does this transfer work inside the EDMA? • What happens when the transfer completes? • How do you program this transfer? 3 0xffff 0 0 1 31 0

  36. Options Source BCNT ACNT Destination DSTBIDX SRCBIDX BCNTRLD LINK 8 bits DSTCIDX SRCCIDX RSVD CCNT 31 0 Parameters for a Single Block Transfer 8-bit Pixels 7 8 &myDest: Goals: 0 1 2 3 4 5 8 9 • Transfer a block of 8-bit pixels from &pixel_7 to &myDest • Transfer all pixels as quickly as possible (single EVTx – xfr all data, AB-sync) 6 7 8 9 10 11 10 9 12 13 14 15 16 17 11 10 18 19 20 21 22 23 13 24 25 26 27 28 29 14 (Src: &pixel_7) 15 Note: data values arein contiguous memory 16 19 Param Set (active) Solution 20 AB-sync 21 &pixel_7 22 3 4 &myDest 4 6 • Why can’t we use ACNT=1? • How does this transfer work inside the EDMA? • What happens when the transfer completes? • How do you program this transfer? 3 0xffff 0 0 1 31 0

  37. Channel OPTions Register • The Options register contains bit fields that configure how the channel operates. • Each field has a corresponding description in the Param Setup code comments. • TCC = Transfer Complete Code to signal completion • SYNCDIM = A-sync or AB-sync • PRIV = Privilege level of the host that can program the PSET • PRIVID = Privilege ID of the host that program the PSET • ITCCHEN = Intermediate Transfer Completion Chaining Enable • TCCHEN = Transfer Completion Chaining Enable • ITCINTEN = Intermediate Transfer Completion Interrupt Enable • TCINTEN = Transfer Completion Interrupt Enable • TCC = Transfer Completion Code • TCCMODE = Point at which the transfer is considered to be complete. • SAM = Source Address Mode • DAM = Desitination Address Mode • FWID = FIFO Width • STATIC = Option to enable changing PSET

  38. Trigger Mechanisms • What is DMA? • EDMA Architecture • Definition of EDMA3 Terminology • Synchronization • Indexing • Example to Summarize • Trigger Mechanisms • Action Mechanisms • Linking • Chaining • QDMA • EDMA3 LLD Review

  39. Done 1 2 3 4 5 6 T (xfer config) 7 8 8 9 9 10 10 11 11 12 13 14 15 16 17 18 E (event) A (action) 19 20 21 22 23 24 25 26 27 28 29 30 Options Source B A Transfer Count Destination Index Cnt Reload Link Addr Index Index Rsvd C EDMA3 Basics Revisited • Count:How many items to move • A, B, and C counts • Addresses: The source & destination addresses • Index:How far to increment the src/dst after each transfer T (xferconfig) • Event:Triggersthe transfer to begin • Transfer:The transfer config describes the transfers to be executed when triggered. • Resulting Action: What do you want to happen after the transfer is complete?

  40. Event Sync from peripheral 1 2 3 SPI EDMA3 SPIREVT SPIXEVT Start Ch Xfr ER EER How to TRIGGER a Transfer • There are 3 ways to trigger an EDMA transfer: ER = Event Register (flag) EER = Event Enable Register (user) Manually trigger the channel to run Application Channel y ESR = Event Set Register (user) Set Ch #y; Start Ch Xfr ESR Chain event from another channel (more details later…) Channel x Channel y TCCHEN = TC Chain Enable (OPT) TCCHEN_EN TCC = Chy Start Ch Xfr CER 28

  41. Action Mechanisms • What is DMA? • EDMA Architecture • Definition of EDMA3 Terminology • Synchronization • Indexing • Example to Summarize • Trigger Mechanisms • Action Mechanisms • Linking • Chaining • QDMA • EDMA3 LLD Review

  42. Generate EDMA Interrupt (Setting IERbit) EDMA Channels EDMA Interrupt Generation Channel # Options TCC IPR IER 0 0 TCINTEN=0 TCC=0 IER0 = 0 1 0 TCC=1 TCINTEN=0 IER1 = 0 EDMA3CC_INT . . . 1 TCINTEN=1 TCC=14 IER14 = 1 N 0 TCINTEN=0 TCC=N IERN= 0 Options TCINTEN TCC IER – EDMA Interrupt Enable Register (NOT the CPU IER)IPR – EDMA Interrupt Pending Register (set by TCC) 20 17 12 • Use EDMA3 Low-Level Driver (LLD) to program the EDMA IER bits NChannels and ONE interrupt? How do you determine WHICH channel completed?

  43. Read IPR bits Determine which one is set Call corresponding handler(ISR) in Fxn Table EDMA Interrupt Dispatcher Here’s the interrupt chain from beginning to end: 1. An interrupt occurs 2. Interrupt Selector 3. HWI_INT5 Properties HWI_INT5 EDMA3CC_GINT 4. EDMA Dispatcher Function 5. ISR (interrupt handler) void edma_rcv_isr (void) { SEM_post (&semaphore); } How does the ISR Fxn Table (in #4 above) get loaded with the proper handler Fxn names? Use EDMA3 LLD to program the proper callback fxn for this HWI.

  44. Linking • What is DMA? • EDMA Architecture • Definition of EDMA3 Terminology • Synchronization • Indexing • Example to Summarize • Trigger Mechanisms • Action Mechanisms • Linking • Chaining • QDMA • EDMA3 LLD Review

  45. Done T (xfer config) E (event) A (action) Options Source T (xferconfig) B A Transfer Count Destination Index Cnt Reload Link Addr Index Index Rsvd C Linking – “Action” – Overview Alias: “Re-load” “Auto-init” • Need: auto-reload channel with new config • Ex1: do the same transfer again • Ex2: ping/pong system • Solution: use linking to reload Chconfig • Concept: • Linking two or more channels together allowsthe EDMA to auto-reload a new configurationwhen the current transfer is complete. • Linking still requires a “trigger” to start thetransfer (manual, chain, event). • You can link as many PSETs as you like – it is only limited by the #PSETs on a device. • How does linking work? • User must specify the LINK fieldin the config to link to another PSET. • When the current xfr (0) is complete,the EDMA auto reloads the newconfig (1) from the linked PSET. Config 0 Config 1 reload LINK LINK 1 NULL NOTE: Does NOT start transfer!!

  46. Chaining • What is DMA? • EDMA Architecture • Definition of EDMA3 Terminology • Synchronization • Indexing • Example to Summarize • Trigger Mechanisms • Action Mechanisms • Linking • Chaining • QDMA • EDMA3 LLD Review

  47. Event sync from peripheral 1 2 3 McASP0 EDMA3 RRDY XRDY Start Ch Xfr ER EER Triggering Transfers Revisited There are 3 ways to trigger an EDMA transfer: ER = Event Register (flag) EER = Event Enable Register (user) Manually trigger the channel to run Application Channel y ESR = Event Set Register (user) Set Ch #y; Start Ch Xfr ESR  Chain event from another channel Channel x Channel y TCCHEN = TC Chain Enable (OPT) TCCHEN_EN TCC = Chy Start Ch Xfr CER

  48. Done T (xfer config) E (event) A (action) Options Source T (xfer config) B A Transfer Count Destination Index Cnt Reload Link Addr Index Index Rsvd C Chaining – “Action” & “Event” – Overview • Need: When one transfer completes, trigger another transfer to run • Ex: ChX completes, kicks off ChY • Solution: Use chaining to kick off next xfr • Concept: • Chaining actually refers to both both an action and an event – the completed ‘action’ from the 1st channel is the ‘event’ for the next channel • You can chain as many Chan’s as you like – it is only limited by the #Ch’s on a device • Chaining does NOT reload current Chan config – that can only be accomplished by linking. It simply triggers another channel to run. • How does chaining work? • Set the TCC field to match the next (i.e. chained) channel # • Turn ON chaining • When the current xfr (X) is complete,it triggers the next Ch (Y) to run Ch X Ch Y Y ? Done ? TCC TCC RUN Y EN DIS Chain EN Chain EN

  49. QDMA • What is DMA? • EDMA Architecture • Definition of EDMA3 Terminology • Synchronization • Indexing • Example to Summarize • Trigger Mechanisms • Action Mechanisms • Linking • Chaining • QDMA • EDMA3 LLD Review

  50. Quick DMA (QDMA) • QDMA is used for simple transfers where syncing to an eventis not required. Address/count updates and linking are notperformed. CCNT = 1 (single event transfer). • A transfer can be triggered by two methods:(1) writing to a trigger word (2) using the EDMA3 LLD. • It is “quick” because the CPU can initiate a transfer with asfew as ONE write to a channel register. • How does it work? • QDMA channel is “auto-triggered” when CPU writes to the “trigger” word • Eliminates the need to write to PSET and kick off transfer w/ separate write to ESR • Selection of the trigger word allows CPU to modify only words of interest in a PSET • Assumes OPT.STATIC = 1. Count and address updates and linking NOT performed. • Example: • If ACNT/BCNT/CCNT are typically static for a given algorithm, but SRC is differentfor each transfer, then SRC could be defined as the trigger word. CPU can initiate atransfer with a single write to the SRC address for the specified PSET.

More Related