diff options
Diffstat (limited to 'include/asm-powerpc/pasemi_dma.h')
-rw-r--r-- | include/asm-powerpc/pasemi_dma.h | 77 |
1 files changed, 74 insertions, 3 deletions
diff --git a/include/asm-powerpc/pasemi_dma.h b/include/asm-powerpc/pasemi_dma.h index b4526ff3a50d..19fd7933e2d9 100644 --- a/include/asm-powerpc/pasemi_dma.h +++ b/include/asm-powerpc/pasemi_dma.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2006 PA Semi, Inc | 2 | * Copyright (C) 2006-2008 PA Semi, Inc |
3 | * | 3 | * |
4 | * Hardware register layout and descriptor formats for the on-board | 4 | * Hardware register layout and descriptor formats for the on-board |
5 | * DMA engine on PA Semi PWRficient. Used by ethernet, function and security | 5 | * DMA engine on PA Semi PWRficient. Used by ethernet, function and security |
@@ -40,6 +40,11 @@ enum { | |||
40 | PAS_DMA_COM_TXSTA = 0x104, /* Transmit Status Register */ | 40 | PAS_DMA_COM_TXSTA = 0x104, /* Transmit Status Register */ |
41 | PAS_DMA_COM_RXCMD = 0x108, /* Receive Command Register */ | 41 | PAS_DMA_COM_RXCMD = 0x108, /* Receive Command Register */ |
42 | PAS_DMA_COM_RXSTA = 0x10c, /* Receive Status Register */ | 42 | PAS_DMA_COM_RXSTA = 0x10c, /* Receive Status Register */ |
43 | PAS_DMA_COM_CFG = 0x114, /* Common config reg */ | ||
44 | PAS_DMA_TXF_SFLG0 = 0x140, /* Set flags */ | ||
45 | PAS_DMA_TXF_SFLG1 = 0x144, /* Set flags */ | ||
46 | PAS_DMA_TXF_CFLG0 = 0x148, /* Set flags */ | ||
47 | PAS_DMA_TXF_CFLG1 = 0x14c, /* Set flags */ | ||
43 | }; | 48 | }; |
44 | 49 | ||
45 | 50 | ||
@@ -123,11 +128,16 @@ enum { | |||
123 | #define PAS_DMA_TXCHAN_TCMDSTA_DA 0x00000100 | 128 | #define PAS_DMA_TXCHAN_TCMDSTA_DA 0x00000100 |
124 | #define PAS_DMA_TXCHAN_CFG(c) (0x304+(c)*_PAS_DMA_TXCHAN_STRIDE) | 129 | #define PAS_DMA_TXCHAN_CFG(c) (0x304+(c)*_PAS_DMA_TXCHAN_STRIDE) |
125 | #define PAS_DMA_TXCHAN_CFG_TY_IFACE 0x00000000 /* Type = interface */ | 130 | #define PAS_DMA_TXCHAN_CFG_TY_IFACE 0x00000000 /* Type = interface */ |
131 | #define PAS_DMA_TXCHAN_CFG_TY_COPY 0x00000001 /* Type = copy only */ | ||
132 | #define PAS_DMA_TXCHAN_CFG_TY_FUNC 0x00000002 /* Type = function */ | ||
133 | #define PAS_DMA_TXCHAN_CFG_TY_XOR 0x00000003 /* Type = xor only */ | ||
126 | #define PAS_DMA_TXCHAN_CFG_TATTR_M 0x0000003c | 134 | #define PAS_DMA_TXCHAN_CFG_TATTR_M 0x0000003c |
127 | #define PAS_DMA_TXCHAN_CFG_TATTR_S 2 | 135 | #define PAS_DMA_TXCHAN_CFG_TATTR_S 2 |
128 | #define PAS_DMA_TXCHAN_CFG_TATTR(x) (((x) << PAS_DMA_TXCHAN_CFG_TATTR_S) & \ | 136 | #define PAS_DMA_TXCHAN_CFG_TATTR(x) (((x) << PAS_DMA_TXCHAN_CFG_TATTR_S) & \ |
129 | PAS_DMA_TXCHAN_CFG_TATTR_M) | 137 | PAS_DMA_TXCHAN_CFG_TATTR_M) |
130 | #define PAS_DMA_TXCHAN_CFG_WT_M 0x000001c0 | 138 | #define PAS_DMA_TXCHAN_CFG_LPDQ 0x00000800 |
139 | #define PAS_DMA_TXCHAN_CFG_LPSQ 0x00000400 | ||
140 | #define PAS_DMA_TXCHAN_CFG_WT_M 0x000003c0 | ||
131 | #define PAS_DMA_TXCHAN_CFG_WT_S 6 | 141 | #define PAS_DMA_TXCHAN_CFG_WT_S 6 |
132 | #define PAS_DMA_TXCHAN_CFG_WT(x) (((x) << PAS_DMA_TXCHAN_CFG_WT_S) & \ | 142 | #define PAS_DMA_TXCHAN_CFG_WT(x) (((x) << PAS_DMA_TXCHAN_CFG_WT_S) & \ |
133 | PAS_DMA_TXCHAN_CFG_WT_M) | 143 | PAS_DMA_TXCHAN_CFG_WT_M) |
@@ -394,11 +404,62 @@ enum { | |||
394 | XCT_COPY_LLEN_M) | 404 | XCT_COPY_LLEN_M) |
395 | #define XCT_COPY_SE 0x0000000000000001ull | 405 | #define XCT_COPY_SE 0x0000000000000001ull |
396 | 406 | ||
407 | /* Function descriptor fields */ | ||
408 | #define XCT_FUN_T 0x8000000000000000ull | ||
409 | #define XCT_FUN_ST 0x4000000000000000ull | ||
410 | #define XCT_FUN_RR_M 0x3000000000000000ull | ||
411 | #define XCT_FUN_RR_NORES 0x0000000000000000ull | ||
412 | #define XCT_FUN_RR_8BRES 0x1000000000000000ull | ||
413 | #define XCT_FUN_RR_24BRES 0x2000000000000000ull | ||
414 | #define XCT_FUN_RR_40BRES 0x3000000000000000ull | ||
415 | #define XCT_FUN_I 0x0800000000000000ull | ||
416 | #define XCT_FUN_O 0x0400000000000000ull | ||
417 | #define XCT_FUN_E 0x0200000000000000ull | ||
418 | #define XCT_FUN_FUN_M 0x01c0000000000000ull | ||
419 | #define XCT_FUN_FUN_S 54 | ||
420 | #define XCT_FUN_FUN(x) ((((long)(x)) << XCT_FUN_FUN_S) & XCT_FUN_FUN_M) | ||
421 | #define XCT_FUN_CRM_M 0x0038000000000000ull | ||
422 | #define XCT_FUN_CRM_NOP 0x0000000000000000ull | ||
423 | #define XCT_FUN_CRM_SIG 0x0008000000000000ull | ||
424 | #define XCT_FUN_LLEN_M 0x0007ffff00000000ull | ||
425 | #define XCT_FUN_LLEN_S 32 | ||
426 | #define XCT_FUN_LLEN(x) ((((long)(x)) << XCT_FUN_LLEN_S) & XCT_FUN_LLEN_M) | ||
427 | #define XCT_FUN_SHL_M 0x00000000f8000000ull | ||
428 | #define XCT_FUN_SHL_S 27 | ||
429 | #define XCT_FUN_SHL(x) ((((long)(x)) << XCT_FUN_SHL_S) & XCT_FUN_SHL_M) | ||
430 | #define XCT_FUN_CHL_M 0x0000000007c00000ull | ||
431 | #define XCT_FUN_HSZ_M 0x00000000003c0000ull | ||
432 | #define XCT_FUN_ALG_M 0x0000000000038000ull | ||
433 | #define XCT_FUN_HP 0x0000000000004000ull | ||
434 | #define XCT_FUN_BCM_M 0x0000000000003800ull | ||
435 | #define XCT_FUN_BCP_M 0x0000000000000600ull | ||
436 | #define XCT_FUN_SIG_M 0x00000000000001f0ull | ||
437 | #define XCT_FUN_SIG_TCP4 0x0000000000000140ull | ||
438 | #define XCT_FUN_SIG_TCP6 0x0000000000000150ull | ||
439 | #define XCT_FUN_SIG_UDP4 0x0000000000000160ull | ||
440 | #define XCT_FUN_SIG_UDP6 0x0000000000000170ull | ||
441 | #define XCT_FUN_A 0x0000000000000008ull | ||
442 | #define XCT_FUN_C 0x0000000000000004ull | ||
443 | #define XCT_FUN_AL2 0x0000000000000002ull | ||
444 | #define XCT_FUN_SE 0x0000000000000001ull | ||
445 | |||
446 | /* Function descriptor 8byte result fields */ | ||
447 | #define XCT_FUNRES_8B_CS_M 0x0000ffff00000000ull | ||
448 | #define XCT_FUNRES_8B_CS_S 32 | ||
449 | #define XCT_FUNRES_8B_CRC_M 0x00000000ffffffffull | ||
450 | #define XCT_FUNRES_8B_CRC_S 0 | ||
451 | |||
397 | /* Control descriptor fields */ | 452 | /* Control descriptor fields */ |
398 | #define CTRL_CMD_T 0x8000000000000000ull | 453 | #define CTRL_CMD_T 0x8000000000000000ull |
399 | #define CTRL_CMD_META_EVT 0x2000000000000000ull | 454 | #define CTRL_CMD_META_EVT 0x2000000000000000ull |
400 | #define CTRL_CMD_O 0x0400000000000000ull | 455 | #define CTRL_CMD_O 0x0400000000000000ull |
401 | #define CTRL_CMD_REG_M 0x000000000000000full | 456 | #define CTRL_CMD_ETYPE_M 0x0038000000000000ull |
457 | #define CTRL_CMD_ETYPE_EXT 0x0000000000000000ull | ||
458 | #define CTRL_CMD_ETYPE_WSET 0x0020000000000000ull | ||
459 | #define CTRL_CMD_ETYPE_WCLR 0x0028000000000000ull | ||
460 | #define CTRL_CMD_ETYPE_SET 0x0030000000000000ull | ||
461 | #define CTRL_CMD_ETYPE_CLR 0x0038000000000000ull | ||
462 | #define CTRL_CMD_REG_M 0x000000000000007full | ||
402 | #define CTRL_CMD_REG_S 0 | 463 | #define CTRL_CMD_REG_S 0 |
403 | #define CTRL_CMD_REG(x) ((((long)(x)) << CTRL_CMD_REG_S) & \ | 464 | #define CTRL_CMD_REG(x) ((((long)(x)) << CTRL_CMD_REG_S) & \ |
404 | CTRL_CMD_REG_M) | 465 | CTRL_CMD_REG_M) |
@@ -461,6 +522,16 @@ extern void *pasemi_dma_alloc_buf(struct pasemi_dmachan *chan, int size, | |||
461 | extern void pasemi_dma_free_buf(struct pasemi_dmachan *chan, int size, | 522 | extern void pasemi_dma_free_buf(struct pasemi_dmachan *chan, int size, |
462 | dma_addr_t *handle); | 523 | dma_addr_t *handle); |
463 | 524 | ||
525 | /* Routines to allocate flags (events) for channel syncronization */ | ||
526 | extern int pasemi_dma_alloc_flag(void); | ||
527 | extern void pasemi_dma_free_flag(int flag); | ||
528 | extern void pasemi_dma_set_flag(int flag); | ||
529 | extern void pasemi_dma_clear_flag(int flag); | ||
530 | |||
531 | /* Routines to allocate function engines */ | ||
532 | extern int pasemi_dma_alloc_fun(void); | ||
533 | extern void pasemi_dma_free_fun(int fun); | ||
534 | |||
464 | /* Initialize the library, must be called before any other functions */ | 535 | /* Initialize the library, must be called before any other functions */ |
465 | extern int pasemi_dma_init(void); | 536 | extern int pasemi_dma_init(void); |
466 | 537 | ||