what's the CMDWORDS means in iMX28 HW_APBH_CHn_CMD register ,and how to calculate it?

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

what's the CMDWORDS means in iMX28 HW_APBH_CHn_CMD register ,and how to calculate it?

483 Views
liuxing
Contributor II

what's the CMDWORDS means in iMX28 HW_APBH_CHn_CMD register ,and how to calculate it?

Labels (1)
0 Kudos
2 Replies

375 Views
Yuri
NXP Employee
NXP Employee

  According to the Reference Manual (RM), CMDWORDS indicates the number

of command words to send to one of peripheral controllers, shown on Figure 6-1

(AHB-to-APBH Bridge DMA Block Diagram) of the RM – say, the SSP1 – in order

to initialize a needed operation.

  Usually any operation, where DMA is involved assumes two phases :

1) controller register initialization and operation (read / write) start ;
2) transfer data via DMA, assuming DMA is already configured. 
 

  The CMDWORS is intended for the first stage.



Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

375 Views
liuxing
Contributor II

Hi,Yuri,

    Thanks a lot.

     I still don't know how to calculate the value of CMDWORS.

     for example, at chapter 16.4.1.1  of RM(page 1375),

     DMA Structure Code Example,

//----------------------------------------------------------------------------

// Descriptor 1: issue NAND write setup command (CLE/ALE)

//----------------------------------------------------------------------------

write[0].dma_nxtcmdar = &write[1]; // point to the next descriptor

write[0].dma_cmd = BF_APBH_CHn_CMD_XFER_COUNT (1 + 5)| // 1 byte command, 5 byte address

BF_APBH_CHn_CMD_CMDWORDS (3) | // send 3 words to the GPMI

BF_APBH_CHn_CMD_WAIT4ENDCMD (1) | // wait for command to finish

//----------------------------------------------------------------------------

// Descriptor 2: write the data payload (DATA)

//----------------------------------------------------------------------------

write[1].dma_nxtcmdar = &write[2]; // point to the next descriptor

write[1].dma_cmd = BF_APBH_CHn_CMD_XFER_COUNT (0)| // NOTE: No DMA data transfer

BF_APBH_CHn_CMD_CMDWORDS (4)| // send 4 words to the GPMI

BF_APBH_CHn_CMD_WAIT4ENDCMD (1)| // Wait to end

BF_APBH_CHn_CMD_SEMAPHORE (0)|

BF_APBH_CHn_CMD_NANDWAIT4READY (0)|

BF_APBH_CHn_CMD_NANDLOCK (1)| // maintain resource lock

BF_APBH_CHn_CMD_IRQONCMPLT (0)|

BF_APBH_CHn_CMD_CHAIN (1)| // follow chain to next command

BV_FLD(APBH_CHn_CMD, COMMAND, DMA_NO_XFER); // No data transferred

Why the CMDWORDS value of  Descriptor 1 is 3,and  its value of  Descriptor 2 is 4?How to calculate it?The CMDWORDS value will be different if the ECC enable or disable.why?

0 Kudos