2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (c) 2001-2002 Silicon Graphics, Inc. All rights reserved.
9 #ifndef _ASM_IA64_SN_BTE_H
10 #define _ASM_IA64_SN_BTE_H
12 #ident "$Revision: 1.1.1.1 $"
14 #include <linux/spinlock.h>
15 #include <linux/cache.h>
16 #include <asm/sn/io.h>
18 #define L1_CACHE_MASK (L1_CACHE_BYTES - 1) /* Mask to retrieve
19 * the offset into this
22 /* BTE status register only supports 16 bits for length field */
23 #define BTE_LEN_BITS (16)
24 #define BTE_LEN_MASK ((1 << BTE_LEN_BITS) - 1)
25 #define BTE_MAX_XFER ((1 << BTE_LEN_BITS) * L1_CACHE_BYTES)
29 * Constants used in determining the best and worst case transfer
30 * times. To help explain the two, the following graph of transfer
31 * status vs time may help.
33 * active +------------------:-+ :
35 * idle +__________________:_+=======
38 * Therefore, MaxT is the maximum thoeretical rate for transfering
39 * the request block (assuming ideal circumstances)
41 * MinT is the minimum theoretical rate for transferring the
42 * requested block (assuming maximum link distance and contention)
44 * The following defines are the inverse of the above. They are
45 * used for calculating the MaxT time and MinT time given the
46 * number of lines in the transfer.
48 #define BTE_MAXT_LINES_PER_SECOND 800
49 #define BTE_MINT_LINES_PER_SECOND 600
53 #define BTES_PER_NODE 2
55 /* Define hardware modes */
56 #define BTE_NOTIFY (IBCT_NOTIFY)
57 #define BTE_NORMAL BTE_NOTIFY
58 #define BTE_ZERO_FILL (BTE_NOTIFY | IBCT_ZFIL_MODE)
60 /* Use a reserved bit to let the caller specify a wait for any BTE */
61 #define BTE_WACQUIRE (0x4000)
64 * Structure defining a bte. An instance of this
65 * structure is created in the nodepda for each
66 * bte on that node (as defined by BTES_PER_NODE)
67 * This structure contains everything necessary
70 typedef struct bteinfo_s {
71 u64 volatile notify ____cacheline_aligned;
72 char *bte_base_addr ____cacheline_aligned;
74 u64 idealTransferTimeout;
75 u64 idealTransferTimeoutReached;
80 u64 volatile *mostRecentNotification;
84 /* Possible results from bte_copy and bte_unaligned_copy */
86 BTE_SUCCESS, /* 0 is success */
87 BTEFAIL_NOTAVAIL, /* BTE not available */
88 BTEFAIL_ERROR, /* Generic error */
89 BTEFAIL_DIR /* Diretory error */
92 #endif /* _ASM_IA64_SN_BTE_H */