Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
gruhandles.h File Reference
#include "gru_instructions.h"

Go to the source code of this file.

Data Structures

struct  gru_tlb_fault_map
 
struct  gru_tlb_global_handle
 
struct  gru_tlb_fault_handle
 
struct  gru_context_configuration_handle
 
struct  gru_control_block_extended
 

Macros

#define GRU_GSEG0_BASE   0
 
#define GRU_MCS_BASE   (64 * 1024 * 1024)
 
#define GRU_SIZE   (128UL * 1024 * 1024)
 
#define GRU_NUM_CB   128
 
#define GRU_NUM_DSR_BYTES   (32 * 1024)
 
#define GRU_NUM_TFM   16
 
#define GRU_NUM_TGH   24
 
#define GRU_NUM_CBE   128
 
#define GRU_NUM_TFH   128
 
#define GRU_NUM_CCH   16
 
#define GRU_NUM_USER_CBR   GRU_NUM_CBE
 
#define GRU_NUM_USER_DSR_BYTES   GRU_NUM_DSR_BYTES
 
#define GRU_HANDLE_BYTES   64
 
#define GRU_HANDLE_STRIDE   256
 
#define GRU_TFM_BASE   (GRU_MCS_BASE + 0x00000)
 
#define GRU_TGH_BASE   (GRU_MCS_BASE + 0x08000)
 
#define GRU_CBE_BASE   (GRU_MCS_BASE + 0x10000)
 
#define GRU_TFH_BASE   (GRU_MCS_BASE + 0x18000)
 
#define GRU_CCH_BASE   (GRU_MCS_BASE + 0x20000)
 
#define GRU_GSEG_STRIDE   (4 * 1024 * 1024)
 
#define GSEG_BASE(a)   ((a) & ~(GRU_GSEG_PAGESIZE - 1))
 
#define GRU_DSR_AU_BYTES   1024
 
#define GRU_DSR_CL   (GRU_NUM_DSR_BYTES / GRU_CACHE_LINE_BYTES)
 
#define GRU_DSR_AU_CL   (GRU_DSR_AU_BYTES / GRU_CACHE_LINE_BYTES)
 
#define GRU_DSR_AU   (GRU_NUM_DSR_BYTES / GRU_DSR_AU_BYTES)
 
#define GRU_CBR_AU_SIZE   2
 
#define GRU_CBR_AU   (GRU_NUM_CBE / GRU_CBR_AU_SIZE)
 
#define GRU_DS_BYTES_TO_AU(n)   DIV_ROUND_UP(n, GRU_DSR_AU_BYTES)
 
#define GRU_CB_COUNT_TO_AU(n)   DIV_ROUND_UP(n, GRU_CBR_AU_SIZE)
 
#define GRU_CHIPLETS_PER_HUB   2
 
#define GRU_HUBS_PER_BLADE   1
 
#define GRU_CHIPLETS_PER_BLADE   (GRU_HUBS_PER_BLADE * GRU_CHIPLETS_PER_HUB)
 
#define GRU_CB_BASE   0
 
#define GRU_CB_LIMIT   (GRU_CB_BASE + GRU_HANDLE_STRIDE * GRU_NUM_CBE)
 
#define GRU_DS_BASE   0x20000
 
#define GRU_DS_LIMIT   (GRU_DS_BASE + GRU_NUM_DSR_BYTES)
 
#define GSEGPOFF(h)   ((h) & (GRU_SIZE - 1))
 
#define GRUBASE(h)   ((void *)((unsigned long)(h) & ~(GRU_SIZE - 1)))
 
#define TYPE_IS(hn, h)
 
#define GAA_RAM   0x0
 
#define GAA_NCRAM   0x2
 
#define GAA_MMIO   0x1
 
#define GAA_REGISTER   0x3
 
#define GRU_PADDR_SHIFT   12
 
#define cbe_baddr0   idef1upd
 
#define cbe_baddr1   idef3upd
 
#define cbe_src_cl   idef6cpy
 
#define cbe_nelemcur   idef5upd
 
#define GRU_PAGESIZE(sh)   ((((sh) > 20 ? (sh) + 2 : (sh)) >> 1) - 6)
 
#define GRU_SIZEAVAIL(sh)   (1UL << GRU_PAGESIZE(sh))
 
#define GRUMAXINVAL   1024UL
 

Enumerations

enum  gru_tgh_cmd { TGHCMD_START }
 
enum  gru_tgh_opc { TGHOP_TLBNOP, TGHOP_TLBINV }
 
enum  gru_tgh_status { TGHSTATUS_IDLE, TGHSTATUS_EXCEPTION, TGHSTATUS_ACTIVE }
 
enum  gru_tgh_state {
  TGHSTATE_IDLE, TGHSTATE_PE_INVAL, TGHSTATE_INTERRUPT_INVAL, TGHSTATE_WAITDONE,
  TGHSTATE_RESTART_CTX
}
 
enum  gru_tgh_cause {
  TGHCAUSE_RR_ECC, TGHCAUSE_TLB_ECC, TGHCAUSE_LRU_ECC, TGHCAUSE_PS_ECC,
  TGHCAUSE_MUL_ERR, TGHCAUSE_DATA_ERR, TGHCAUSE_SW_FORCE
}
 
enum  gru_tfh_opc {
  TFHOP_NOOP, TFHOP_RESTART, TFHOP_WRITE_ONLY, TFHOP_WRITE_RESTART,
  TFHOP_EXCEPTION, TFHOP_USER_POLLING_MODE = 7
}
 
enum  tfh_status { TFHSTATUS_IDLE, TFHSTATUS_EXCEPTION, TFHSTATUS_ACTIVE }
 
enum  tfh_state {
  TFHSTATE_INACTIVE, TFHSTATE_IDLE, TFHSTATE_MISS_UPM, TFHSTATE_MISS_FMM,
  TFHSTATE_HW_ERR, TFHSTATE_WRITE_TLB, TFHSTATE_RESTART_CBR
}
 
enum  tfh_cause {
  TFHCAUSE_NONE, TFHCAUSE_TLB_MISS, TFHCAUSE_TLB_MOD, TFHCAUSE_HW_ERROR_RR,
  TFHCAUSE_HW_ERROR_MAIN_ARRAY, TFHCAUSE_HW_ERROR_VALID, TFHCAUSE_HW_ERROR_PAGESIZE, TFHCAUSE_INSTRUCTION_EXCEPTION,
  TFHCAUSE_UNCORRECTIBLE_ERROR
}
 
enum  gru_cch_opc {
  CCHOP_START = 1, CCHOP_ALLOCATE, CCHOP_INTERRUPT, CCHOP_DEALLOCATE,
  CCHOP_INTERRUPT_SYNC
}
 
enum  gru_cch_status { CCHSTATUS_IDLE, CCHSTATUS_EXCEPTION, CCHSTATUS_ACTIVE }
 
enum  gru_cch_state { CCHSTATE_INACTIVE, CCHSTATE_MAPPED, CCHSTATE_ACTIVE, CCHSTATE_INTERRUPTED }
 
enum  gru_cch_cause {
  CCHCAUSE_REGION_REGISTER_WRITE_ERROR = 1, CCHCAUSE_ILLEGAL_OPCODE = 2, CCHCAUSE_INVALID_START_REQUEST = 3, CCHCAUSE_INVALID_ALLOCATION_REQUEST = 4,
  CCHCAUSE_INVALID_DEALLOCATION_REQUEST = 5, CCHCAUSE_INVALID_INTERRUPT_REQUEST = 6, CCHCAUSE_CCH_BUSY = 7, CCHCAUSE_NO_CBRS_TO_ALLOCATE = 8,
  CCHCAUSE_BAD_TFM_CONFIG = 9, CCHCAUSE_CBR_RESOURCES_OVERSUBSCRIPED = 10, CCHCAUSE_DSR_RESOURCES_OVERSUBSCRIPED = 11, CCHCAUSE_CBR_DEALLOCATION_ERROR = 12
}
 
enum  gru_cbr_state {
  CBRSTATE_INACTIVE, CBRSTATE_IDLE, CBRSTATE_PE_CHECK, CBRSTATE_QUEUED,
  CBRSTATE_WAIT_RESPONSE, CBRSTATE_INTERRUPTED, CBRSTATE_INTERRUPTED_MISS_FMM, CBRSTATE_BUSY_INTERRUPT_MISS_FMM,
  CBRSTATE_INTERRUPTED_MISS_UPM, CBRSTATE_BUSY_INTERRUPTED_MISS_UPM, CBRSTATE_REQUEST_ISSUE, CBRSTATE_BUSY_INTERRUPT
}
 

Functions

struct
gru_context_configuration_handle 
__attribute__ ((packed))
 
int cch_allocate (struct gru_context_configuration_handle *cch)
 
int cch_start (struct gru_context_configuration_handle *cch)
 
int cch_interrupt (struct gru_context_configuration_handle *cch)
 
int cch_deallocate (struct gru_context_configuration_handle *cch)
 
int cch_interrupt_sync (struct gru_context_configuration_handle *cch)
 
int tgh_invalidate (struct gru_tlb_global_handle *tgh, unsigned long vaddr, unsigned long vaddrmask, int asid, int pagesize, int global, int n, unsigned short ctxbitmap)
 
int tfh_write_only (struct gru_tlb_fault_handle *tfh, unsigned long paddr, int gaa, unsigned long vaddr, int asid, int dirty, int pagesize)
 
void tfh_write_restart (struct gru_tlb_fault_handle *tfh, unsigned long paddr, int gaa, unsigned long vaddr, int asid, int dirty, int pagesize)
 
void tfh_restart (struct gru_tlb_fault_handle *tfh)
 
void tfh_user_polling_mode (struct gru_tlb_fault_handle *tfh)
 
void tfh_exception (struct gru_tlb_fault_handle *tfh)
 

Variables

unsigned int cmd
 
unsigned int delresp
 
unsigned int opc
 
unsigned int unmap_enable
 
unsigned int req_slice_set_enable
 
unsigned int req_slice
 
unsigned int cb_int_enable
 
unsigned int tlb_int_enable
 
unsigned int tfm_fault_bit_enable
 
unsigned int tlb_int_select
 
unsigned int status
 
unsigned int state
 
unsigned int reserved2
 
unsigned int cause
 
unsigned int tfm_done_bit_enable
 
unsigned int unused
 
unsigned int dsr_allocation_map
 
unsigned long cbr_allocation_map
 
unsigned int asid [8]
 
unsigned short sizeavail [8]
 
enum gru_cch_opc __attribute__
 

Macro Definition Documentation

#define cbe_baddr0   idef1upd

Definition at line 471 of file gruhandles.h.

#define cbe_baddr1   idef3upd

Definition at line 472 of file gruhandles.h.

#define cbe_nelemcur   idef5upd

Definition at line 474 of file gruhandles.h.

#define cbe_src_cl   idef6cpy

Definition at line 473 of file gruhandles.h.

#define GAA_MMIO   0x1

Definition at line 353 of file gruhandles.h.

#define GAA_NCRAM   0x2

Definition at line 352 of file gruhandles.h.

#define GAA_RAM   0x0

Definition at line 351 of file gruhandles.h.

#define GAA_REGISTER   0x3

Definition at line 354 of file gruhandles.h.

#define GRU_CB_BASE   0

Definition at line 83 of file gruhandles.h.

#define GRU_CB_COUNT_TO_AU (   n)    DIV_ROUND_UP(n, GRU_CBR_AU_SIZE)

Definition at line 75 of file gruhandles.h.

#define GRU_CB_LIMIT   (GRU_CB_BASE + GRU_HANDLE_STRIDE * GRU_NUM_CBE)

Definition at line 84 of file gruhandles.h.

#define GRU_CBE_BASE   (GRU_MCS_BASE + 0x10000)

Definition at line 55 of file gruhandles.h.

#define GRU_CBR_AU   (GRU_NUM_CBE / GRU_CBR_AU_SIZE)

Definition at line 71 of file gruhandles.h.

#define GRU_CBR_AU_SIZE   2

Definition at line 70 of file gruhandles.h.

#define GRU_CCH_BASE   (GRU_MCS_BASE + 0x20000)

Definition at line 57 of file gruhandles.h.

#define GRU_CHIPLETS_PER_BLADE   (GRU_HUBS_PER_BLADE * GRU_CHIPLETS_PER_HUB)

Definition at line 80 of file gruhandles.h.

#define GRU_CHIPLETS_PER_HUB   2

Definition at line 78 of file gruhandles.h.

#define GRU_DS_BASE   0x20000

Definition at line 85 of file gruhandles.h.

#define GRU_DS_BYTES_TO_AU (   n)    DIV_ROUND_UP(n, GRU_DSR_AU_BYTES)

Definition at line 74 of file gruhandles.h.

#define GRU_DS_LIMIT   (GRU_DS_BASE + GRU_NUM_DSR_BYTES)

Definition at line 86 of file gruhandles.h.

#define GRU_DSR_AU   (GRU_NUM_DSR_BYTES / GRU_DSR_AU_BYTES)

Definition at line 67 of file gruhandles.h.

#define GRU_DSR_AU_BYTES   1024

Definition at line 64 of file gruhandles.h.

#define GRU_DSR_AU_CL   (GRU_DSR_AU_BYTES / GRU_CACHE_LINE_BYTES)

Definition at line 66 of file gruhandles.h.

#define GRU_DSR_CL   (GRU_NUM_DSR_BYTES / GRU_CACHE_LINE_BYTES)

Definition at line 65 of file gruhandles.h.

#define GRU_GSEG0_BASE   0

Definition at line 30 of file gruhandles.h.

#define GRU_GSEG_STRIDE   (4 * 1024 * 1024)

Definition at line 60 of file gruhandles.h.

#define GRU_HANDLE_BYTES   64

Definition at line 49 of file gruhandles.h.

#define GRU_HANDLE_STRIDE   256

Definition at line 50 of file gruhandles.h.

#define GRU_HUBS_PER_BLADE   1

Definition at line 79 of file gruhandles.h.

#define GRU_MCS_BASE   (64 * 1024 * 1024)

Definition at line 31 of file gruhandles.h.

#define GRU_NUM_CB   128

Definition at line 35 of file gruhandles.h.

#define GRU_NUM_CBE   128

Definition at line 39 of file gruhandles.h.

#define GRU_NUM_CCH   16

Definition at line 41 of file gruhandles.h.

#define GRU_NUM_DSR_BYTES   (32 * 1024)

Definition at line 36 of file gruhandles.h.

#define GRU_NUM_TFH   128

Definition at line 40 of file gruhandles.h.

#define GRU_NUM_TFM   16

Definition at line 37 of file gruhandles.h.

#define GRU_NUM_TGH   24

Definition at line 38 of file gruhandles.h.

#define GRU_NUM_USER_CBR   GRU_NUM_CBE

Definition at line 44 of file gruhandles.h.

#define GRU_NUM_USER_DSR_BYTES   GRU_NUM_DSR_BYTES

Definition at line 45 of file gruhandles.h.

#define GRU_PADDR_SHIFT   12

Definition at line 357 of file gruhandles.h.

#define GRU_PAGESIZE (   sh)    ((((sh) > 20 ? (sh) + 2 : (sh)) >> 1) - 6)

Definition at line 509 of file gruhandles.h.

#define GRU_SIZE   (128UL * 1024 * 1024)

Definition at line 32 of file gruhandles.h.

#define GRU_SIZEAVAIL (   sh)    (1UL << GRU_PAGESIZE(sh))

Definition at line 510 of file gruhandles.h.

#define GRU_TFH_BASE   (GRU_MCS_BASE + 0x18000)

Definition at line 56 of file gruhandles.h.

#define GRU_TFM_BASE   (GRU_MCS_BASE + 0x00000)

Definition at line 53 of file gruhandles.h.

#define GRU_TGH_BASE   (GRU_MCS_BASE + 0x08000)

Definition at line 54 of file gruhandles.h.

#define GRUBASE (   h)    ((void *)((unsigned long)(h) & ~(GRU_SIZE - 1)))

Definition at line 92 of file gruhandles.h.

#define GRUMAXINVAL   1024UL

Definition at line 513 of file gruhandles.h.

#define GSEG_BASE (   a)    ((a) & ~(GRU_GSEG_PAGESIZE - 1))

Definition at line 61 of file gruhandles.h.

#define GSEGPOFF (   h)    ((h) & (GRU_SIZE - 1))

Definition at line 89 of file gruhandles.h.

#define TYPE_IS (   hn,
  h 
)
Value:
((h) >= GRU_##hn##_BASE && (h) < \
GRU_##hn##_BASE + GRU_NUM_##hn * GRU_HANDLE_STRIDE && \
(((h) & (GRU_HANDLE_STRIDE - 1)) == 0))

Definition at line 95 of file gruhandles.h.

Enumeration Type Documentation

Enumerator:
CBRSTATE_INACTIVE 
CBRSTATE_IDLE 
CBRSTATE_PE_CHECK 
CBRSTATE_QUEUED 
CBRSTATE_WAIT_RESPONSE 
CBRSTATE_INTERRUPTED 
CBRSTATE_INTERRUPTED_MISS_FMM 
CBRSTATE_BUSY_INTERRUPT_MISS_FMM 
CBRSTATE_INTERRUPTED_MISS_UPM 
CBRSTATE_BUSY_INTERRUPTED_MISS_UPM 
CBRSTATE_REQUEST_ISSUE 
CBRSTATE_BUSY_INTERRUPT 

Definition at line 476 of file gruhandles.h.

Enumerator:
CCHCAUSE_REGION_REGISTER_WRITE_ERROR 
CCHCAUSE_ILLEGAL_OPCODE 
CCHCAUSE_INVALID_START_REQUEST 
CCHCAUSE_INVALID_ALLOCATION_REQUEST 
CCHCAUSE_INVALID_DEALLOCATION_REQUEST 
CCHCAUSE_INVALID_INTERRUPT_REQUEST 
CCHCAUSE_CCH_BUSY 
CCHCAUSE_NO_CBRS_TO_ALLOCATE 
CCHCAUSE_BAD_TFM_CONFIG 
CCHCAUSE_CBR_RESOURCES_OVERSUBSCRIPED 
CCHCAUSE_DSR_RESOURCES_OVERSUBSCRIPED 
CCHCAUSE_CBR_DEALLOCATION_ERROR 

Definition at line 414 of file gruhandles.h.

Enumerator:
CCHOP_START 
CCHOP_ALLOCATE 
CCHOP_INTERRUPT 
CCHOP_DEALLOCATE 
CCHOP_INTERRUPT_SYNC 

Definition at line 392 of file gruhandles.h.

Enumerator:
CCHSTATE_INACTIVE 
CCHSTATE_MAPPED 
CCHSTATE_ACTIVE 
CCHSTATE_INTERRUPTED 

Definition at line 406 of file gruhandles.h.

Enumerator:
CCHSTATUS_IDLE 
CCHSTATUS_EXCEPTION 
CCHSTATUS_ACTIVE 

Definition at line 400 of file gruhandles.h.

Enumerator:
TFHOP_NOOP 
TFHOP_RESTART 
TFHOP_WRITE_ONLY 
TFHOP_WRITE_RESTART 
TFHOP_EXCEPTION 
TFHOP_USER_POLLING_MODE 

Definition at line 312 of file gruhandles.h.

Enumerator:
TGHCAUSE_RR_ECC 
TGHCAUSE_TLB_ECC 
TGHCAUSE_LRU_ECC 
TGHCAUSE_PS_ECC 
TGHCAUSE_MUL_ERR 
TGHCAUSE_DATA_ERR 
TGHCAUSE_SW_FORCE 

Definition at line 255 of file gruhandles.h.

Enumerator:
TGHCMD_START 

Definition at line 232 of file gruhandles.h.

Enumerator:
TGHOP_TLBNOP 
TGHOP_TLBINV 

Definition at line 236 of file gruhandles.h.

Enumerator:
TGHSTATE_IDLE 
TGHSTATE_PE_INVAL 
TGHSTATE_INTERRUPT_INVAL 
TGHSTATE_WAITDONE 
TGHSTATE_RESTART_CTX 

Definition at line 247 of file gruhandles.h.

Enumerator:
TGHSTATUS_IDLE 
TGHSTATUS_EXCEPTION 
TGHSTATUS_ACTIVE 

Definition at line 241 of file gruhandles.h.

enum tfh_cause
Enumerator:
TFHCAUSE_NONE 
TFHCAUSE_TLB_MISS 
TFHCAUSE_TLB_MOD 
TFHCAUSE_HW_ERROR_RR 
TFHCAUSE_HW_ERROR_MAIN_ARRAY 
TFHCAUSE_HW_ERROR_VALID 
TFHCAUSE_HW_ERROR_PAGESIZE 
TFHCAUSE_INSTRUCTION_EXCEPTION 
TFHCAUSE_UNCORRECTIBLE_ERROR 

Definition at line 338 of file gruhandles.h.

enum tfh_state
Enumerator:
TFHSTATE_INACTIVE 
TFHSTATE_IDLE 
TFHSTATE_MISS_UPM 
TFHSTATE_MISS_FMM 
TFHSTATE_HW_ERR 
TFHSTATE_WRITE_TLB 
TFHSTATE_RESTART_CBR 

Definition at line 327 of file gruhandles.h.

enum tfh_status
Enumerator:
TFHSTATUS_IDLE 
TFHSTATUS_EXCEPTION 
TFHSTATUS_ACTIVE 

Definition at line 321 of file gruhandles.h.

Function Documentation

Definition at line 171 of file esd_usb2.c.

int cch_allocate ( struct gru_context_configuration_handle cch)

Definition at line 97 of file gruhandles.c.

int cch_deallocate ( struct gru_context_configuration_handle cch)

Definition at line 127 of file gruhandles.c.

int cch_interrupt ( struct gru_context_configuration_handle cch)

Definition at line 120 of file gruhandles.c.

int cch_interrupt_sync ( struct gru_context_configuration_handle cch)

Definition at line 143 of file gruhandles.c.

Definition at line 113 of file gruhandles.c.

void tfh_exception ( struct gru_tlb_fault_handle tfh)

Definition at line 211 of file gruhandles.c.

void tfh_restart ( struct gru_tlb_fault_handle tfh)

Definition at line 199 of file gruhandles.c.

void tfh_user_polling_mode ( struct gru_tlb_fault_handle tfh)

Definition at line 205 of file gruhandles.c.

int tfh_write_only ( struct gru_tlb_fault_handle tfh,
unsigned long  paddr,
int  gaa,
unsigned long  vaddr,
int  asid,
int  dirty,
int  pagesize 
)

Definition at line 168 of file gruhandles.c.

void tfh_write_restart ( struct gru_tlb_fault_handle tfh,
unsigned long  paddr,
int  gaa,
unsigned long  vaddr,
int  asid,
int  dirty,
int  pagesize 
)

Definition at line 184 of file gruhandles.c.

int tgh_invalidate ( struct gru_tlb_global_handle tgh,
unsigned long  vaddr,
unsigned long  vaddrmask,
int  asid,
int  pagesize,
int  global,
int  n,
unsigned short  ctxbitmap 
)

Definition at line 151 of file gruhandles.c.

Variable Documentation

unsigned int asid[8]

Definition at line 414 of file gruhandles.h.

unsigned int cause

Definition at line 406 of file gruhandles.h.

unsigned int cb_int_enable

Definition at line 397 of file gruhandles.h.

unsigned long cbr_allocation_map

Definition at line 412 of file gruhandles.h.

unsigned int cmd

Definition at line 391 of file gruhandles.h.

unsigned int delresp

Definition at line 392 of file gruhandles.h.

unsigned int dsr_allocation_map

Definition at line 410 of file gruhandles.h.

unsigned int opc

Definition at line 393 of file gruhandles.h.

unsigned int req_slice

Definition at line 396 of file gruhandles.h.

unsigned int req_slice_set_enable

Definition at line 395 of file gruhandles.h.

unsigned int reserved2

Definition at line 404 of file gruhandles.h.

unsigned short sizeavail[8]

Definition at line 415 of file gruhandles.h.

unsigned int state

Definition at line 403 of file gruhandles.h.

unsigned int status

Definition at line 402 of file gruhandles.h.

unsigned int tfm_done_bit_enable

Definition at line 407 of file gruhandles.h.

unsigned int tfm_fault_bit_enable

Definition at line 399 of file gruhandles.h.

unsigned int tlb_int_enable

Definition at line 398 of file gruhandles.h.

unsigned int tlb_int_select

Definition at line 400 of file gruhandles.h.

unsigned int unmap_enable

Definition at line 394 of file gruhandles.h.

unsigned int unused

Definition at line 408 of file gruhandles.h.