diff options
author | Bruce Losure <blosure@sgi.com> | 2005-04-25 16:09:41 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-04-25 16:09:41 -0400 |
commit | e1e19747ecce9117610b8f3b57a3e95734230319 (patch) | |
tree | df3d9ed57ad8155de89d1d80bbfec1833d2621fb /include | |
parent | 4944930ab748942e41ea4dc313fcb0946aee3f17 (diff) |
[IA64-SGI] Bus driver for the CX port of SGI's TIO chip.
This patch is to provide CX port infrastructure for SGI TIO-based
h/w. Also a 'core services' driver for SGI FPGA-based h/w.
Signed-off-by: Bruce Losure <blosure@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-ia64/sn/addrs.h | 3 | ||||
-rw-r--r-- | include/asm-ia64/sn/tiocx.h | 71 |
2 files changed, 74 insertions, 0 deletions
diff --git a/include/asm-ia64/sn/addrs.h b/include/asm-ia64/sn/addrs.h index ae0bc99d573e..960d626ee589 100644 --- a/include/asm-ia64/sn/addrs.h +++ b/include/asm-ia64/sn/addrs.h | |||
@@ -169,7 +169,10 @@ | |||
169 | #define TIO_BWIN_SIZE_BITS 30 /* big window size: 1G */ | 169 | #define TIO_BWIN_SIZE_BITS 30 /* big window size: 1G */ |
170 | #define NODE_SWIN_BASE(n, w) ((w == 0) ? NODE_BWIN_BASE((n), SWIN0_BIGWIN) \ | 170 | #define NODE_SWIN_BASE(n, w) ((w == 0) ? NODE_BWIN_BASE((n), SWIN0_BIGWIN) \ |
171 | : RAW_NODE_SWIN_BASE(n, w)) | 171 | : RAW_NODE_SWIN_BASE(n, w)) |
172 | #define TIO_SWIN_BASE(n, w) (TIO_IO_BASE(n) + \ | ||
173 | ((u64) (w) << TIO_SWIN_SIZE_BITS)) | ||
172 | #define NODE_IO_BASE(n) (GLOBAL_MMR_SPACE | NASID_SPACE(n)) | 174 | #define NODE_IO_BASE(n) (GLOBAL_MMR_SPACE | NASID_SPACE(n)) |
175 | #define TIO_IO_BASE(n) (UNCACHED | NASID_SPACE(n)) | ||
173 | #define BWIN_SIZE (1UL << BWIN_SIZE_BITS) | 176 | #define BWIN_SIZE (1UL << BWIN_SIZE_BITS) |
174 | #define NODE_BWIN_BASE0(n) (NODE_IO_BASE(n) + BWIN_SIZE) | 177 | #define NODE_BWIN_BASE0(n) (NODE_IO_BASE(n) + BWIN_SIZE) |
175 | #define NODE_BWIN_BASE(n, w) (NODE_BWIN_BASE0(n) + ((u64) (w) << BWIN_SIZE_BITS)) | 178 | #define NODE_BWIN_BASE(n, w) (NODE_BWIN_BASE0(n) + ((u64) (w) << BWIN_SIZE_BITS)) |
diff --git a/include/asm-ia64/sn/tiocx.h b/include/asm-ia64/sn/tiocx.h new file mode 100644 index 000000000000..c5447a504509 --- /dev/null +++ b/include/asm-ia64/sn/tiocx.h | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
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 | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (c) 2005 Silicon Graphics, Inc. All rights reserved. | ||
7 | */ | ||
8 | |||
9 | #ifndef _ASM_IA64_SN_TIO_TIOCX_H | ||
10 | #define _ASM_IA64_SN_TIO_TIOCX_H | ||
11 | |||
12 | #ifdef __KERNEL__ | ||
13 | |||
14 | struct cx_id_s { | ||
15 | unsigned int part_num; | ||
16 | unsigned int mfg_num; | ||
17 | int nasid; | ||
18 | }; | ||
19 | |||
20 | struct cx_dev { | ||
21 | struct cx_id_s cx_id; | ||
22 | void *soft; /* driver specific */ | ||
23 | struct hubdev_info *hubdev; | ||
24 | struct device dev; | ||
25 | struct cx_drv *driver; | ||
26 | }; | ||
27 | |||
28 | struct cx_device_id { | ||
29 | unsigned int part_num; | ||
30 | unsigned int mfg_num; | ||
31 | }; | ||
32 | |||
33 | struct cx_drv { | ||
34 | char *name; | ||
35 | const struct cx_device_id *id_table; | ||
36 | struct device_driver driver; | ||
37 | int (*probe) (struct cx_dev * dev, const struct cx_device_id * id); | ||
38 | int (*remove) (struct cx_dev * dev); | ||
39 | }; | ||
40 | |||
41 | /* create DMA address by stripping AS bits */ | ||
42 | #define TIOCX_DMA_ADDR(a) (uint64_t)((uint64_t)(a) & 0xffffcfffffffffUL) | ||
43 | |||
44 | #define TIOCX_TO_TIOCX_DMA_ADDR(a) (uint64_t)(((uint64_t)(a) & 0xfffffffff) | \ | ||
45 | ((((uint64_t)(a)) & 0xffffc000000000UL) <<2)) | ||
46 | |||
47 | #define TIO_CE_ASIC_PARTNUM 0xce00 | ||
48 | #define TIOCX_CORELET 3 | ||
49 | |||
50 | /* These are taken from tio_mmr_as.h */ | ||
51 | #define TIO_ICE_FRZ_CFG TIO_MMR_ADDR_MOD(0x00000000b0008100UL) | ||
52 | #define TIO_ICE_PMI_TX_CFG TIO_MMR_ADDR_MOD(0x00000000b000b100UL) | ||
53 | #define TIO_ICE_PMI_TX_DYN_CREDIT_STAT_CB3 TIO_MMR_ADDR_MOD(0x00000000b000be18UL) | ||
54 | #define TIO_ICE_PMI_TX_DYN_CREDIT_STAT_CB3_CREDIT_CNT_MASK 0x000000000000000fUL | ||
55 | |||
56 | #define to_cx_dev(n) container_of(n, struct cx_dev, dev) | ||
57 | #define to_cx_driver(drv) container_of(drv, struct cx_drv, driver) | ||
58 | |||
59 | extern struct sn_irq_info *tiocx_irq_alloc(nasid_t, int, int, nasid_t, int); | ||
60 | extern void tiocx_irq_free(struct sn_irq_info *); | ||
61 | extern int cx_device_unregister(struct cx_dev *); | ||
62 | extern int cx_device_register(nasid_t, int, int, struct hubdev_info *); | ||
63 | extern int cx_driver_unregister(struct cx_drv *); | ||
64 | extern int cx_driver_register(struct cx_drv *); | ||
65 | extern uint64_t tiocx_dma_addr(uint64_t addr); | ||
66 | extern uint64_t tiocx_swin_base(int nasid); | ||
67 | extern void tiocx_mmr_store(int nasid, uint64_t offset, uint64_t value); | ||
68 | extern uint64_t tiocx_mmr_load(int nasid, uint64_t offset); | ||
69 | |||
70 | #endif // __KERNEL__ | ||
71 | #endif // _ASM_IA64_SN_TIO_TIOCX__ | ||