Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
cvmx-cmd-queue.h File Reference
#include <linux/prefetch.h>
#include <asm/octeon/cvmx-fpa.h>

Go to the source code of this file.

Data Structures

struct  __cvmx_cmd_queue_state_t
 
struct  __cvmx_cmd_queue_all_state_t
 

Macros

#define CVMX_CMD_QUEUE_ENABLE_MAX_DEPTH   0
 
#define CVMX_CMD_QUEUE_PKO(queue)   ((cvmx_cmd_queue_id_t)(CVMX_CMD_QUEUE_PKO_BASE + (0xffff&(queue))))
 
#define CVMX_CMD_QUEUE_DMA(queue)   ((cvmx_cmd_queue_id_t)(CVMX_CMD_QUEUE_DMA_BASE + (0xffff&(queue))))
 

Enumerations

enum  cvmx_cmd_queue_id_t {
  CVMX_CMD_QUEUE_PKO_BASE = 0x00000, CVMX_CMD_QUEUE_ZIP = 0x10000, CVMX_CMD_QUEUE_DFA = 0x20000, CVMX_CMD_QUEUE_RAID = 0x30000,
  CVMX_CMD_QUEUE_DMA_BASE = 0x40000, CVMX_CMD_QUEUE_END = 0x50000
}
 
enum  cvmx_cmd_queue_result_t {
  CVMX_CMD_QUEUE_SUCCESS = 0, CVMX_CMD_QUEUE_NO_MEMORY = -1, CVMX_CMD_QUEUE_FULL = -2, CVMX_CMD_QUEUE_INVALID_PARAM = -3,
  CVMX_CMD_QUEUE_ALREADY_SETUP = -4
}
 

Functions

cvmx_cmd_queue_result_t cvmx_cmd_queue_initialize (cvmx_cmd_queue_id_t queue_id, int max_depth, int fpa_pool, int pool_size)
 
cvmx_cmd_queue_result_t cvmx_cmd_queue_shutdown (cvmx_cmd_queue_id_t queue_id)
 
int cvmx_cmd_queue_length (cvmx_cmd_queue_id_t queue_id)
 
voidcvmx_cmd_queue_buffer (cvmx_cmd_queue_id_t queue_id)
 

Macro Definition Documentation

#define CVMX_CMD_QUEUE_DMA (   queue)    ((cvmx_cmd_queue_id_t)(CVMX_CMD_QUEUE_DMA_BASE + (0xffff&(queue))))

Definition at line 106 of file cvmx-cmd-queue.h.

#define CVMX_CMD_QUEUE_ENABLE_MAX_DEPTH   0

By default we disable the max depth support. Most programs don't use it and it slows down the command queue processing significantly.

Definition at line 86 of file cvmx-cmd-queue.h.

#define CVMX_CMD_QUEUE_PKO (   queue)    ((cvmx_cmd_queue_id_t)(CVMX_CMD_QUEUE_PKO_BASE + (0xffff&(queue))))

Definition at line 98 of file cvmx-cmd-queue.h.

Enumeration Type Documentation

Enumeration representing all hardware blocks that use command queues. Each hardware block has up to 65536 sub identifiers for multiple command queues. Not all chips support all hardware units.

Enumerator:
CVMX_CMD_QUEUE_PKO_BASE 
CVMX_CMD_QUEUE_ZIP 
CVMX_CMD_QUEUE_DFA 
CVMX_CMD_QUEUE_RAID 
CVMX_CMD_QUEUE_DMA_BASE 
CVMX_CMD_QUEUE_END 

Definition at line 95 of file cvmx-cmd-queue.h.

Command write operations can fail if the command queue needs a new buffer and the associated FPA pool is empty. It can also fail if the number of queued command words reaches the maximum set at initialization.

Enumerator:
CVMX_CMD_QUEUE_SUCCESS 
CVMX_CMD_QUEUE_NO_MEMORY 
CVMX_CMD_QUEUE_FULL 
CVMX_CMD_QUEUE_INVALID_PARAM 
CVMX_CMD_QUEUE_ALREADY_SETUP 

Definition at line 118 of file cvmx-cmd-queue.h.

Function Documentation

void* cvmx_cmd_queue_buffer ( cvmx_cmd_queue_id_t  queue_id)

Return the command buffer to be written to. The purpose of this function is to allow CVMX routine access t othe low level buffer for initial hardware setup. User applications should not call this function directly.

: Command queue to query

Returns Command buffer or NULL on failure

Definition at line 299 of file cvmx-cmd-queue.c.

cvmx_cmd_queue_result_t cvmx_cmd_queue_initialize ( cvmx_cmd_queue_id_t  queue_id,
int  max_depth,
int  fpa_pool,
int  pool_size 
)

Initialize a command queue for use. The initial FPA buffer is allocated and the hardware unit is configured to point to the new command queue.

: Hardware command queue to initialize. : Maximum outstanding commands that can be queued. : FPA pool the command queues should come from. : Size of each buffer in the FPA pool (bytes)

Returns CVMX_CMD_QUEUE_SUCCESS or a failure code

Definition at line 111 of file cvmx-cmd-queue.c.

int cvmx_cmd_queue_length ( cvmx_cmd_queue_id_t  queue_id)

Return the number of command words pending in the queue. This function may be relatively slow for some hardware units.

: Hardware command queue to query

Returns Number of outstanding commands

Definition at line 241 of file cvmx-cmd-queue.c.

cvmx_cmd_queue_result_t cvmx_cmd_queue_shutdown ( cvmx_cmd_queue_id_t  queue_id)

Shutdown a queue a free it's command buffers to the FPA. The hardware connected to the queue must be stopped before this function is called.

: Queue to shutdown

Returns CVMX_CMD_QUEUE_SUCCESS or a failure code

Definition at line 206 of file cvmx-cmd-queue.c.