Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
bte.h File Reference
#include <linux/timer.h>
#include <linux/spinlock.h>
#include <linux/cache.h>
#include <asm/sn/pda.h>
#include <asm/sn/types.h>
#include <asm/sn/shub_mmr.h>

Go to the source code of this file.

Data Structures

struct  bteinfo_s
 

Macros

#define IBCT_NOTIFY   (0x1UL << 4)
 
#define IBCT_ZFIL_MODE   (0x1UL << 0)
 
#define BTE_PRINTK(x)
 
#define BTE_PRINTKV(x)
 
#define BTE_LEN_BITS   (16)
 
#define BTE_LEN_MASK   ((1 << BTE_LEN_BITS) - 1)
 
#define BTE_MAX_XFER   (BTE_LEN_MASK << L1_CACHE_SHIFT)
 
#define BTES_PER_NODE   (is_shub2() ? 4 : 2)
 
#define MAX_BTES_PER_NODE   4
 
#define BTE2OFF_CTRL   0
 
#define BTE2OFF_SRC   (SH2_BT_ENG_SRC_ADDR_0 - SH2_BT_ENG_CSR_0)
 
#define BTE2OFF_DEST   (SH2_BT_ENG_DEST_ADDR_0 - SH2_BT_ENG_CSR_0)
 
#define BTE2OFF_NOTIFY   (SH2_BT_ENG_NOTIF_ADDR_0 - SH2_BT_ENG_CSR_0)
 
#define BTE_BASE_ADDR(interface)
 
#define BTE_SOURCE_ADDR(base)
 
#define BTE_DEST_ADDR(base)
 
#define BTE_CTRL_ADDR(base)
 
#define BTE_NOTIF_ADDR(base)
 
#define BTE_NOTIFY   IBCT_NOTIFY
 
#define BTE_NORMAL   BTE_NOTIFY
 
#define BTE_ZERO_FILL   (BTE_NOTIFY | IBCT_ZFIL_MODE)
 
#define BTE_WACQUIRE   0x4000
 
#define BTE_USE_DEST   (BTE_WACQUIRE << 1)
 
#define BTE_USE_ANY   (BTE_USE_DEST << 1)
 
#define BTE_VALID_MODE(x)   ((x) & (IBCT_NOTIFY | IBCT_ZFIL_MODE))
 
#define BTE_ACTIVE   (IBLS_BUSY | IBLS_ERROR)
 
#define BTE_WORD_AVAILABLE   (IBLS_BUSY << 1)
 
#define BTE_WORD_BUSY   (~BTE_WORD_AVAILABLE)
 
#define BTE_LNSTAT_LOAD(_bte)   HUB_L(_bte->bte_base_addr)
 
#define BTE_LNSTAT_STORE(_bte, _x)   HUB_S(_bte->bte_base_addr, (_x))
 
#define BTE_SRC_STORE(_bte, _x)
 
#define BTE_DEST_STORE(_bte, _x)
 
#define BTE_CTRL_STORE(_bte, _x)   HUB_S(_bte->bte_control_addr, (_x))
 
#define BTE_NOTIF_STORE(_bte, _x)
 
#define BTE_START_TRANSFER(_bte, _len, _mode)
 
#define BTEFAIL_OFFSET   1
 
#define BTEFAIL_SH2_RESP_SHORT   0x1 /* bit 000001 */
 
#define BTEFAIL_SH2_RESP_LONG   0x2 /* bit 000010 */
 
#define BTEFAIL_SH2_RESP_DSP   0x4 /* bit 000100 */
 
#define BTEFAIL_SH2_RESP_ACCESS   0x8 /* bit 001000 */
 
#define BTEFAIL_SH2_CRB_TO   0x10 /* bit 010000 */
 
#define BTEFAIL_SH2_NACK_LIMIT   0x20 /* bit 100000 */
 
#define BTEFAIL_SH2_ALL   0x3F /* bit 111111 */
 
#define BTE_ERR_BITS   0x3FUL
 
#define BTE_ERR_SHIFT   36
 
#define BTE_ERR_MASK   (BTE_ERR_BITS << BTE_ERR_SHIFT)
 
#define BTE_ERROR_RETRY(value)
 
#define BTE_SHUB2_ERROR(_status)
 
#define BTE_GET_ERROR_STATUS(_status)   (BTE_SHUB2_ERROR(_status) & ~IBLS_ERROR)
 
#define BTE_VALID_SH2_ERROR(value)   ((value >= BTEFAIL_SH2_RESP_SHORT) && (value <= BTEFAIL_SH2_ALL))
 
#define bte_zero(dest, len, mode, notification)   bte_copy(0, dest, len, ((mode) | BTE_ZERO_FILL), notification)
 
#define BTE_UNALIGNED_COPY(src, dest, len, mode)
 

Enumerations

enum  bte_result_t {
  BTE_SUCCESS, BTEFAIL_DIR, BTEFAIL_POISON, BTEFAIL_WERR,
  BTEFAIL_ACCESS, BTEFAIL_PWERR, BTEFAIL_PRERR, BTEFAIL_TOUT,
  BTEFAIL_XTERR, BTEFAIL_NOTAVAIL
}
 

Functions

bte_result_t bte_copy (u64, u64, u64, u64, void *)
 
bte_result_t bte_unaligned_copy (u64, u64, u64, u64)
 
void bte_error_handler (unsigned long)
 

Macro Definition Documentation

#define BTE2OFF_CTRL   0

Definition at line 49 of file bte.h.

#define BTE2OFF_DEST   (SH2_BT_ENG_DEST_ADDR_0 - SH2_BT_ENG_CSR_0)

Definition at line 51 of file bte.h.

#define BTE2OFF_NOTIFY   (SH2_BT_ENG_NOTIF_ADDR_0 - SH2_BT_ENG_CSR_0)

Definition at line 52 of file bte.h.

#define BTE2OFF_SRC   (SH2_BT_ENG_SRC_ADDR_0 - SH2_BT_ENG_CSR_0)

Definition at line 50 of file bte.h.

#define BTE_ACTIVE   (IBLS_BUSY | IBLS_ERROR)

Definition at line 90 of file bte.h.

#define BTE_BASE_ADDR (   interface)
Value:
(is_shub2() ? (interface == 0) ? SH2_BT_ENG_CSR_0 : \
(interface == 1) ? SH2_BT_ENG_CSR_1 : \
(interface == 2) ? SH2_BT_ENG_CSR_2 : \
: (interface == 0) ? IIO_IBLS0 : IIO_IBLS1)

Definition at line 54 of file bte.h.

#define BTE_CTRL_ADDR (   base)
Value:
: base + (BTEOFF_CTRL/8))

Definition at line 69 of file bte.h.

#define BTE_CTRL_STORE (   _bte,
  _x 
)    HUB_S(_bte->bte_control_addr, (_x))

Definition at line 116 of file bte.h.

#define BTE_DEST_ADDR (   base)
Value:
: base + (BTEOFF_DEST/8))

Definition at line 65 of file bte.h.

#define BTE_DEST_STORE (   _bte,
  _x 
)
Value:
({ \
u64 __addr = ((_x) & ~AS_MASK); \
if (is_shub2()) \
__addr = SH2_TIO_PHYS_TO_DMA(__addr); \
HUB_S(_bte->bte_destination_addr, __addr); \
})

Definition at line 109 of file bte.h.

#define BTE_ERR_BITS   0x3FUL

Definition at line 161 of file bte.h.

#define BTE_ERR_MASK   (BTE_ERR_BITS << BTE_ERR_SHIFT)

Definition at line 163 of file bte.h.

#define BTE_ERR_SHIFT   36

Definition at line 162 of file bte.h.

#define BTE_ERROR_RETRY (   value)
Value:

Definition at line 165 of file bte.h.

#define BTE_GET_ERROR_STATUS (   _status)    (BTE_SHUB2_ERROR(_status) & ~IBLS_ERROR)

Definition at line 177 of file bte.h.

#define BTE_LEN_BITS   (16)

Definition at line 40 of file bte.h.

#define BTE_LEN_MASK   ((1 << BTE_LEN_BITS) - 1)

Definition at line 41 of file bte.h.

#define BTE_LNSTAT_LOAD (   _bte)    HUB_L(_bte->bte_base_addr)

Definition at line 98 of file bte.h.

#define BTE_LNSTAT_STORE (   _bte,
  _x 
)    HUB_S(_bte->bte_base_addr, (_x))

Definition at line 100 of file bte.h.

#define BTE_MAX_XFER   (BTE_LEN_MASK << L1_CACHE_SHIFT)

Definition at line 42 of file bte.h.

#define BTE_NORMAL   BTE_NOTIFY

Definition at line 79 of file bte.h.

#define BTE_NOTIF_ADDR (   base)
Value:
: base + (BTEOFF_NOTIFY/8))

Definition at line 73 of file bte.h.

#define BTE_NOTIF_STORE (   _bte,
  _x 
)
Value:
({ \
u64 __addr = ia64_tpa((_x) & ~AS_MASK); \
if (is_shub2()) \
__addr = SH2_TIO_PHYS_TO_DMA(__addr); \
HUB_S(_bte->bte_notify_addr, __addr); \
})

Definition at line 118 of file bte.h.

#define BTE_NOTIFY   IBCT_NOTIFY

Definition at line 78 of file bte.h.

#define BTE_PRINTK (   x)

Definition at line 34 of file bte.h.

#define BTE_PRINTKV (   x)

Definition at line 35 of file bte.h.

#define BTE_SHUB2_ERROR (   _status)
Value:
((_status & BTE_ERR_MASK) \
? (((_status >> BTE_ERR_SHIFT) & BTE_ERR_BITS) | IBLS_ERROR) \
: _status)

Definition at line 172 of file bte.h.

#define BTE_SOURCE_ADDR (   base)
Value:
: base + (BTEOFF_SRC/8))

Definition at line 61 of file bte.h.

#define BTE_SRC_STORE (   _bte,
  _x 
)
Value:
({ \
u64 __addr = ((_x) & ~AS_MASK); \
if (is_shub2()) \
__addr = SH2_TIO_PHYS_TO_DMA(__addr); \
HUB_S(_bte->bte_source_addr, __addr); \
})

Definition at line 102 of file bte.h.

#define BTE_START_TRANSFER (   _bte,
  _len,
  _mode 
)
Value:
is_shub2() ? BTE_CTRL_STORE(_bte, IBLS_BUSY | (_mode << 24) | _len) \
: BTE_LNSTAT_STORE(_bte, _len); \
BTE_CTRL_STORE(_bte, _mode)

Definition at line 126 of file bte.h.

#define BTE_UNALIGNED_COPY (   src,
  dest,
  len,
  mode 
)
Value:
(((len & (L1_CACHE_BYTES - 1)) || \
(src & (L1_CACHE_BYTES - 1)) || \
(dest & (L1_CACHE_BYTES - 1))) ? \
bte_copy(src, dest, len, mode, NULL))

Definition at line 226 of file bte.h.

#define BTE_USE_ANY   (BTE_USE_DEST << 1)

Definition at line 86 of file bte.h.

#define BTE_USE_DEST   (BTE_WACQUIRE << 1)

Definition at line 84 of file bte.h.

#define BTE_VALID_MODE (   x)    ((x) & (IBCT_NOTIFY | IBCT_ZFIL_MODE))

Definition at line 88 of file bte.h.

#define BTE_VALID_SH2_ERROR (   value)    ((value >= BTEFAIL_SH2_RESP_SHORT) && (value <= BTEFAIL_SH2_ALL))

Definition at line 180 of file bte.h.

#define BTE_WACQUIRE   0x4000

Definition at line 82 of file bte.h.

#define BTE_WORD_AVAILABLE   (IBLS_BUSY << 1)

Definition at line 91 of file bte.h.

#define BTE_WORD_BUSY   (~BTE_WORD_AVAILABLE)

Definition at line 92 of file bte.h.

#define bte_zero (   dest,
  len,
  mode,
  notification 
)    bte_copy(0, dest, len, ((mode) | BTE_ZERO_FILL), notification)

Definition at line 215 of file bte.h.

#define BTE_ZERO_FILL   (BTE_NOTIFY | IBCT_ZFIL_MODE)

Definition at line 80 of file bte.h.

#define BTEFAIL_OFFSET   1

Definition at line 138 of file bte.h.

#define BTEFAIL_SH2_ALL   0x3F /* bit 111111 */

Definition at line 159 of file bte.h.

#define BTEFAIL_SH2_CRB_TO   0x10 /* bit 010000 */

Definition at line 157 of file bte.h.

#define BTEFAIL_SH2_NACK_LIMIT   0x20 /* bit 100000 */

Definition at line 158 of file bte.h.

#define BTEFAIL_SH2_RESP_ACCESS   0x8 /* bit 001000 */

Definition at line 156 of file bte.h.

#define BTEFAIL_SH2_RESP_DSP   0x4 /* bit 000100 */

Definition at line 155 of file bte.h.

#define BTEFAIL_SH2_RESP_LONG   0x2 /* bit 000010 */

Definition at line 154 of file bte.h.

#define BTEFAIL_SH2_RESP_SHORT   0x1 /* bit 000001 */

Definition at line 153 of file bte.h.

#define BTES_PER_NODE   (is_shub2() ? 4 : 2)

Definition at line 46 of file bte.h.

#define IBCT_NOTIFY   (0x1UL << 4)

Definition at line 20 of file bte.h.

#define IBCT_ZFIL_MODE   (0x1UL << 0)

Definition at line 21 of file bte.h.

#define MAX_BTES_PER_NODE   4

Definition at line 47 of file bte.h.

Enumeration Type Documentation

Enumerator:
BTE_SUCCESS 
BTEFAIL_DIR 
BTEFAIL_POISON 
BTEFAIL_WERR 
BTEFAIL_ACCESS 
BTEFAIL_PWERR 
BTEFAIL_PRERR 
BTEFAIL_TOUT 
BTEFAIL_XTERR 
BTEFAIL_NOTAVAIL 

Definition at line 140 of file bte.h.

Function Documentation

bte_result_t bte_copy ( u64  ,
u64  ,
u64  ,
u64  ,
void  
)

Definition at line 80 of file bte.c.

void bte_error_handler ( unsigned long  _nodepda)

Definition at line 173 of file bte_error.c.

bte_result_t bte_unaligned_copy ( u64  ,
u64  ,
u64  ,
u64   
)

Definition at line 262 of file bte.c.