/* Copyright (C) 2005-2006 by Texas Instruments */ #ifndef _CPPI_DMA_H_ #define _CPPI_DMA_H_ #include #include #include #include #include #include "musb_dma.h" #include "musb_core.h" #include "davinci.h" /* hOptions bit masks for CPPI BDs */ #define CPPI_SOP_SET ((u32)(1 << 31)) #define CPPI_EOP_SET ((u32)(1 << 30)) #define CPPI_OWN_SET ((u32)(1 << 29)) /* owned by cppi */ #define CPPI_EOQ_MASK ((u32)(1 << 28)) #define CPPI_ZERO_SET ((u32)(1 << 23)) /* rx saw zlp; tx issues one */ #define CPPI_RXABT_MASK ((u32)(1 << 19)) /* need more rx buffers */ #define CPPI_RECV_PKTLEN_MASK 0xFFFF #define CPPI_BUFFER_LEN_MASK 0xFFFF #define CPPI_TEAR_READY ((u32)(1 << 31)) #define CPPI_CHNUM_BITS_MASK 0x3 /* CPPI RX/TX state RAM */ struct cppi_tx_stateram { u32 tx_head; /* "DMA packet" head descriptor */ u32 tx_buf; u32 tx_current; /* current descriptor */ u32 tx_buf_current; u32 tx_info; /* flags, remaining buflen */ u32 tx_rem_len; u32 tx_dummy; /* unused */ u32 tx_complete; }; struct cppi_rx_stateram { u32 rx_skipbytes; u32 rx_head; u32 rx_sop; /* "DMA packet" head descriptor */ u32 rx_current; /* current descriptor */ u32 rx_buf_current; u32 rx_len_len; u32 rx_cnt_cnt; u32 rx_complete; }; /* CPPI data structure definitions */ /** * CPPI Buffer Descriptor * * Buffer Descriptor structure for USB OTG Module CPPI.Using the same across * Tx/Rx */ #define CPPI_DESCRIPTOR_ALIGN 16 /* bytes; 5-dec docs say 4-byte align*/ struct cppi_descriptor { /* Hardware Overlay */ /**< Next(hardware) Buffer Descriptor Pointer */ u32 hw_next; /**