diff options
author | Prarit Bhargava <prarit@sgi.com> | 2005-07-06 18:26:51 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-07-06 18:26:51 -0400 |
commit | c13cf3714fc84ad2fd65771aa08e47c95a9f26ef (patch) | |
tree | f3fdd5f81fc0e39029f7cc6c8e4f41d6a736a4de /include | |
parent | cb4cb2cb9b0b14bdf2fc7125e099ed7e818cea42 (diff) |
[IA64] hotplug/ia64: SN Hotplug Driver: moving of header files
This patch moves header files out of the arch/ia64/sn directories and into
include/asm-ia64/sn. These files were being included by other subsystems
and should be under include/asm-ia64/sn.
Signed-off-by: Prarit Bhargava <prarit@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-ia64/sn/pcibr_provider.h | 154 | ||||
-rw-r--r-- | include/asm-ia64/sn/pcidev.h | 6 | ||||
-rw-r--r-- | include/asm-ia64/sn/pic.h | 261 | ||||
-rw-r--r-- | include/asm-ia64/sn/tiocp.h | 256 |
4 files changed, 676 insertions, 1 deletions
diff --git a/include/asm-ia64/sn/pcibr_provider.h b/include/asm-ia64/sn/pcibr_provider.h new file mode 100644 index 000000000000..cbb4604c9349 --- /dev/null +++ b/include/asm-ia64/sn/pcibr_provider.h | |||
@@ -0,0 +1,154 @@ | |||
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) 1992-1997,2000-2004 Silicon Graphics, Inc. All rights reserved. | ||
7 | */ | ||
8 | #ifndef _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H | ||
9 | #define _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H | ||
10 | |||
11 | #include <asm/sn/intr.h> | ||
12 | #include <asm/sn/pcibus_provider_defs.h> | ||
13 | |||
14 | /* Workarounds */ | ||
15 | #define PV907516 (1 << 1) /* TIOCP: Don't write the write buffer flush reg */ | ||
16 | |||
17 | #define BUSTYPE_MASK 0x1 | ||
18 | |||
19 | /* Macros given a pcibus structure */ | ||
20 | #define IS_PCIX(ps) ((ps)->pbi_bridge_mode & BUSTYPE_MASK) | ||
21 | #define IS_PCI_BRIDGE_ASIC(asic) (asic == PCIIO_ASIC_TYPE_PIC || \ | ||
22 | asic == PCIIO_ASIC_TYPE_TIOCP) | ||
23 | #define IS_PIC_SOFT(ps) (ps->pbi_bridge_type == PCIBR_BRIDGETYPE_PIC) | ||
24 | |||
25 | |||
26 | /* | ||
27 | * The different PCI Bridge types supported on the SGI Altix platforms | ||
28 | */ | ||
29 | #define PCIBR_BRIDGETYPE_UNKNOWN -1 | ||
30 | #define PCIBR_BRIDGETYPE_PIC 2 | ||
31 | #define PCIBR_BRIDGETYPE_TIOCP 3 | ||
32 | |||
33 | /* | ||
34 | * Bridge 64bit Direct Map Attributes | ||
35 | */ | ||
36 | #define PCI64_ATTR_PREF (1ull << 59) | ||
37 | #define PCI64_ATTR_PREC (1ull << 58) | ||
38 | #define PCI64_ATTR_VIRTUAL (1ull << 57) | ||
39 | #define PCI64_ATTR_BAR (1ull << 56) | ||
40 | #define PCI64_ATTR_SWAP (1ull << 55) | ||
41 | #define PCI64_ATTR_VIRTUAL1 (1ull << 54) | ||
42 | |||
43 | #define PCI32_LOCAL_BASE 0 | ||
44 | #define PCI32_MAPPED_BASE 0x40000000 | ||
45 | #define PCI32_DIRECT_BASE 0x80000000 | ||
46 | |||
47 | #define IS_PCI32_MAPPED(x) ((uint64_t)(x) < PCI32_DIRECT_BASE && \ | ||
48 | (uint64_t)(x) >= PCI32_MAPPED_BASE) | ||
49 | #define IS_PCI32_DIRECT(x) ((uint64_t)(x) >= PCI32_MAPPED_BASE) | ||
50 | |||
51 | |||
52 | /* | ||
53 | * Bridge PMU Address Transaltion Entry Attibutes | ||
54 | */ | ||
55 | #define PCI32_ATE_V (0x1 << 0) | ||
56 | #define PCI32_ATE_CO (0x1 << 1) | ||
57 | #define PCI32_ATE_PREC (0x1 << 2) | ||
58 | #define PCI32_ATE_PREF (0x1 << 3) | ||
59 | #define PCI32_ATE_BAR (0x1 << 4) | ||
60 | #define PCI32_ATE_ADDR_SHFT 12 | ||
61 | |||
62 | #define MINIMAL_ATES_REQUIRED(addr, size) \ | ||
63 | (IOPG(IOPGOFF(addr) + (size) - 1) == IOPG((size) - 1)) | ||
64 | |||
65 | #define MINIMAL_ATE_FLAG(addr, size) \ | ||
66 | (MINIMAL_ATES_REQUIRED((uint64_t)addr, size) ? 1 : 0) | ||
67 | |||
68 | /* bit 29 of the pci address is the SWAP bit */ | ||
69 | #define ATE_SWAPSHIFT 29 | ||
70 | #define ATE_SWAP_ON(x) ((x) |= (1 << ATE_SWAPSHIFT)) | ||
71 | #define ATE_SWAP_OFF(x) ((x) &= ~(1 << ATE_SWAPSHIFT)) | ||
72 | |||
73 | /* | ||
74 | * I/O page size | ||
75 | */ | ||
76 | #if PAGE_SIZE < 16384 | ||
77 | #define IOPFNSHIFT 12 /* 4K per mapped page */ | ||
78 | #else | ||
79 | #define IOPFNSHIFT 14 /* 16K per mapped page */ | ||
80 | #endif | ||
81 | |||
82 | #define IOPGSIZE (1 << IOPFNSHIFT) | ||
83 | #define IOPG(x) ((x) >> IOPFNSHIFT) | ||
84 | #define IOPGOFF(x) ((x) & (IOPGSIZE-1)) | ||
85 | |||
86 | #define PCIBR_DEV_SWAP_DIR (1ull << 19) | ||
87 | #define PCIBR_CTRL_PAGE_SIZE (0x1 << 21) | ||
88 | |||
89 | /* | ||
90 | * PMU resources. | ||
91 | */ | ||
92 | struct ate_resource{ | ||
93 | uint64_t *ate; | ||
94 | uint64_t num_ate; | ||
95 | uint64_t lowest_free_index; | ||
96 | }; | ||
97 | |||
98 | struct pcibus_info { | ||
99 | struct pcibus_bussoft pbi_buscommon; /* common header */ | ||
100 | uint32_t pbi_moduleid; | ||
101 | short pbi_bridge_type; | ||
102 | short pbi_bridge_mode; | ||
103 | |||
104 | struct ate_resource pbi_int_ate_resource; | ||
105 | uint64_t pbi_int_ate_size; | ||
106 | |||
107 | uint64_t pbi_dir_xbase; | ||
108 | char pbi_hub_xid; | ||
109 | |||
110 | uint64_t pbi_devreg[8]; | ||
111 | spinlock_t pbi_lock; | ||
112 | |||
113 | uint32_t pbi_valid_devices; | ||
114 | uint32_t pbi_enabled_devices; | ||
115 | }; | ||
116 | |||
117 | /* | ||
118 | * pcibus_info structure locking macros | ||
119 | */ | ||
120 | inline static unsigned long | ||
121 | pcibr_lock(struct pcibus_info *pcibus_info) | ||
122 | { | ||
123 | unsigned long flag; | ||
124 | spin_lock_irqsave(&pcibus_info->pbi_lock, flag); | ||
125 | return(flag); | ||
126 | } | ||
127 | #define pcibr_unlock(pcibus_info, flag) spin_unlock_irqrestore(&pcibus_info->pbi_lock, flag) | ||
128 | |||
129 | extern int pcibr_init_provider(void); | ||
130 | extern void *pcibr_bus_fixup(struct pcibus_bussoft *); | ||
131 | extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t); | ||
132 | extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t); | ||
133 | extern void pcibr_dma_unmap(struct pci_dev *, dma_addr_t, int); | ||
134 | |||
135 | /* | ||
136 | * prototypes for the bridge asic register access routines in pcibr_reg.c | ||
137 | */ | ||
138 | extern void pcireg_control_bit_clr(struct pcibus_info *, uint64_t); | ||
139 | extern void pcireg_control_bit_set(struct pcibus_info *, uint64_t); | ||
140 | extern uint64_t pcireg_tflush_get(struct pcibus_info *); | ||
141 | extern uint64_t pcireg_intr_status_get(struct pcibus_info *); | ||
142 | extern void pcireg_intr_enable_bit_clr(struct pcibus_info *, uint64_t); | ||
143 | extern void pcireg_intr_enable_bit_set(struct pcibus_info *, uint64_t); | ||
144 | extern void pcireg_intr_addr_addr_set(struct pcibus_info *, int, uint64_t); | ||
145 | extern void pcireg_force_intr_set(struct pcibus_info *, int); | ||
146 | extern uint64_t pcireg_wrb_flush_get(struct pcibus_info *, int); | ||
147 | extern void pcireg_int_ate_set(struct pcibus_info *, int, uint64_t); | ||
148 | extern uint64_t * pcireg_int_ate_addr(struct pcibus_info *, int); | ||
149 | extern void pcibr_force_interrupt(struct sn_irq_info *sn_irq_info); | ||
150 | extern void pcibr_change_devices_irq(struct sn_irq_info *sn_irq_info); | ||
151 | extern int pcibr_ate_alloc(struct pcibus_info *, int); | ||
152 | extern void pcibr_ate_free(struct pcibus_info *, int); | ||
153 | extern void ate_write(struct pcibus_info *, int, int, uint64_t); | ||
154 | #endif | ||
diff --git a/include/asm-ia64/sn/pcidev.h b/include/asm-ia64/sn/pcidev.h index 42aea21ee187..9610fcc63545 100644 --- a/include/asm-ia64/sn/pcidev.h +++ b/include/asm-ia64/sn/pcidev.h | |||
@@ -13,6 +13,8 @@ | |||
13 | #define SN_PCIDEV_INFO(pci_dev) \ | 13 | #define SN_PCIDEV_INFO(pci_dev) \ |
14 | ((struct pcidev_info *)(pci_dev)->sysdata) | 14 | ((struct pcidev_info *)(pci_dev)->sysdata) |
15 | 15 | ||
16 | #define SN_PCIBUS_BUSSOFT_INFO(pci_bus) \ | ||
17 | (struct pcibus_info *)((struct pcibus_bussoft *)(PCI_CONTROLLER((pci_bus))->platform_data)) | ||
16 | /* | 18 | /* |
17 | * Given a pci_bus, return the sn pcibus_bussoft struct. Note that | 19 | * Given a pci_bus, return the sn pcibus_bussoft struct. Note that |
18 | * this only works for root busses, not for busses represented by PPB's. | 20 | * this only works for root busses, not for busses represented by PPB's. |
@@ -53,6 +55,8 @@ struct pcidev_info { | |||
53 | 55 | ||
54 | extern void sn_irq_fixup(struct pci_dev *pci_dev, | 56 | extern void sn_irq_fixup(struct pci_dev *pci_dev, |
55 | struct sn_irq_info *sn_irq_info); | 57 | struct sn_irq_info *sn_irq_info); |
56 | 58 | extern void sn_irq_unfixup(struct pci_dev *pci_dev); | |
59 | extern void sn_pci_fixup_slot(struct pci_dev *dev); | ||
60 | extern void sn_pci_unfixup_slot(struct pci_dev *dev); | ||
57 | extern void sn_irq_lh_init(void); | 61 | extern void sn_irq_lh_init(void); |
58 | #endif /* _ASM_IA64_SN_PCI_PCIDEV_H */ | 62 | #endif /* _ASM_IA64_SN_PCI_PCIDEV_H */ |
diff --git a/include/asm-ia64/sn/pic.h b/include/asm-ia64/sn/pic.h new file mode 100644 index 000000000000..0de82e6b0893 --- /dev/null +++ b/include/asm-ia64/sn/pic.h | |||
@@ -0,0 +1,261 @@ | |||
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) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved. | ||
7 | */ | ||
8 | #ifndef _ASM_IA64_SN_PCI_PIC_H | ||
9 | #define _ASM_IA64_SN_PCI_PIC_H | ||
10 | |||
11 | /* | ||
12 | * PIC AS DEVICE ZERO | ||
13 | * ------------------ | ||
14 | * | ||
15 | * PIC handles PCI/X busses. PCI/X requires that the 'bridge' (i.e. PIC) | ||
16 | * be designated as 'device 0'. That is a departure from earlier SGI | ||
17 | * PCI bridges. Because of that we use config space 1 to access the | ||
18 | * config space of the first actual PCI device on the bus. | ||
19 | * Here's what the PIC manual says: | ||
20 | * | ||
21 | * The current PCI-X bus specification now defines that the parent | ||
22 | * hosts bus bridge (PIC for example) must be device 0 on bus 0. PIC | ||
23 | * reduced the total number of devices from 8 to 4 and removed the | ||
24 | * device registers and windows, now only supporting devices 0,1,2, and | ||
25 | * 3. PIC did leave all 8 configuration space windows. The reason was | ||
26 | * there was nothing to gain by removing them. Here in lies the problem. | ||
27 | * The device numbering we do using 0 through 3 is unrelated to the device | ||
28 | * numbering which PCI-X requires in configuration space. In the past we | ||
29 | * correlated Configs pace and our device space 0 <-> 0, 1 <-> 1, etc. | ||
30 | * PCI-X requires we start a 1, not 0 and currently the PX brick | ||
31 | * does associate our: | ||
32 | * | ||
33 | * device 0 with configuration space window 1, | ||
34 | * device 1 with configuration space window 2, | ||
35 | * device 2 with configuration space window 3, | ||
36 | * device 3 with configuration space window 4. | ||
37 | * | ||
38 | * The net effect is that all config space access are off-by-one with | ||
39 | * relation to other per-slot accesses on the PIC. | ||
40 | * Here is a table that shows some of that: | ||
41 | * | ||
42 | * Internal Slot# | ||
43 | * | | ||
44 | * | 0 1 2 3 | ||
45 | * ----------|--------------------------------------- | ||
46 | * config | 0x21000 0x22000 0x23000 0x24000 | ||
47 | * | | ||
48 | * even rrb | 0[0] n/a 1[0] n/a [] == implied even/odd | ||
49 | * | | ||
50 | * odd rrb | n/a 0[1] n/a 1[1] | ||
51 | * | | ||
52 | * int dev | 00 01 10 11 | ||
53 | * | | ||
54 | * ext slot# | 1 2 3 4 | ||
55 | * ----------|--------------------------------------- | ||
56 | */ | ||
57 | |||
58 | #define PIC_ATE_TARGETID_SHFT 8 | ||
59 | #define PIC_HOST_INTR_ADDR 0x0000FFFFFFFFFFFFUL | ||
60 | #define PIC_PCI64_ATTR_TARG_SHFT 60 | ||
61 | |||
62 | |||
63 | /***************************************************************************** | ||
64 | *********************** PIC MMR structure mapping *************************** | ||
65 | *****************************************************************************/ | ||
66 | |||
67 | /* NOTE: PIC WAR. PV#854697. PIC does not allow writes just to [31:0] | ||
68 | * of a 64-bit register. When writing PIC registers, always write the | ||
69 | * entire 64 bits. | ||
70 | */ | ||
71 | |||
72 | struct pic { | ||
73 | |||
74 | /* 0x000000-0x00FFFF -- Local Registers */ | ||
75 | |||
76 | /* 0x000000-0x000057 -- Standard Widget Configuration */ | ||
77 | uint64_t p_wid_id; /* 0x000000 */ | ||
78 | uint64_t p_wid_stat; /* 0x000008 */ | ||
79 | uint64_t p_wid_err_upper; /* 0x000010 */ | ||
80 | uint64_t p_wid_err_lower; /* 0x000018 */ | ||
81 | #define p_wid_err p_wid_err_lower | ||
82 | uint64_t p_wid_control; /* 0x000020 */ | ||
83 | uint64_t p_wid_req_timeout; /* 0x000028 */ | ||
84 | uint64_t p_wid_int_upper; /* 0x000030 */ | ||
85 | uint64_t p_wid_int_lower; /* 0x000038 */ | ||
86 | #define p_wid_int p_wid_int_lower | ||
87 | uint64_t p_wid_err_cmdword; /* 0x000040 */ | ||
88 | uint64_t p_wid_llp; /* 0x000048 */ | ||
89 | uint64_t p_wid_tflush; /* 0x000050 */ | ||
90 | |||
91 | /* 0x000058-0x00007F -- Bridge-specific Widget Configuration */ | ||
92 | uint64_t p_wid_aux_err; /* 0x000058 */ | ||
93 | uint64_t p_wid_resp_upper; /* 0x000060 */ | ||
94 | uint64_t p_wid_resp_lower; /* 0x000068 */ | ||
95 | #define p_wid_resp p_wid_resp_lower | ||
96 | uint64_t p_wid_tst_pin_ctrl; /* 0x000070 */ | ||
97 | uint64_t p_wid_addr_lkerr; /* 0x000078 */ | ||
98 | |||
99 | /* 0x000080-0x00008F -- PMU & MAP */ | ||
100 | uint64_t p_dir_map; /* 0x000080 */ | ||
101 | uint64_t _pad_000088; /* 0x000088 */ | ||
102 | |||
103 | /* 0x000090-0x00009F -- SSRAM */ | ||
104 | uint64_t p_map_fault; /* 0x000090 */ | ||
105 | uint64_t _pad_000098; /* 0x000098 */ | ||
106 | |||
107 | /* 0x0000A0-0x0000AF -- Arbitration */ | ||
108 | uint64_t p_arb; /* 0x0000A0 */ | ||
109 | uint64_t _pad_0000A8; /* 0x0000A8 */ | ||
110 | |||
111 | /* 0x0000B0-0x0000BF -- Number In A Can or ATE Parity Error */ | ||
112 | uint64_t p_ate_parity_err; /* 0x0000B0 */ | ||
113 | uint64_t _pad_0000B8; /* 0x0000B8 */ | ||
114 | |||
115 | /* 0x0000C0-0x0000FF -- PCI/GIO */ | ||
116 | uint64_t p_bus_timeout; /* 0x0000C0 */ | ||
117 | uint64_t p_pci_cfg; /* 0x0000C8 */ | ||
118 | uint64_t p_pci_err_upper; /* 0x0000D0 */ | ||
119 | uint64_t p_pci_err_lower; /* 0x0000D8 */ | ||
120 | #define p_pci_err p_pci_err_lower | ||
121 | uint64_t _pad_0000E0[4]; /* 0x0000{E0..F8} */ | ||
122 | |||
123 | /* 0x000100-0x0001FF -- Interrupt */ | ||
124 | uint64_t p_int_status; /* 0x000100 */ | ||
125 | uint64_t p_int_enable; /* 0x000108 */ | ||
126 | uint64_t p_int_rst_stat; /* 0x000110 */ | ||
127 | uint64_t p_int_mode; /* 0x000118 */ | ||
128 | uint64_t p_int_device; /* 0x000120 */ | ||
129 | uint64_t p_int_host_err; /* 0x000128 */ | ||
130 | uint64_t p_int_addr[8]; /* 0x0001{30,,,68} */ | ||
131 | uint64_t p_err_int_view; /* 0x000170 */ | ||
132 | uint64_t p_mult_int; /* 0x000178 */ | ||
133 | uint64_t p_force_always[8]; /* 0x0001{80,,,B8} */ | ||
134 | uint64_t p_force_pin[8]; /* 0x0001{C0,,,F8} */ | ||
135 | |||
136 | /* 0x000200-0x000298 -- Device */ | ||
137 | uint64_t p_device[4]; /* 0x0002{00,,,18} */ | ||
138 | uint64_t _pad_000220[4]; /* 0x0002{20,,,38} */ | ||
139 | uint64_t p_wr_req_buf[4]; /* 0x0002{40,,,58} */ | ||
140 | uint64_t _pad_000260[4]; /* 0x0002{60,,,78} */ | ||
141 | uint64_t p_rrb_map[2]; /* 0x0002{80,,,88} */ | ||
142 | #define p_even_resp p_rrb_map[0] /* 0x000280 */ | ||
143 | #define p_odd_resp p_rrb_map[1] /* 0x000288 */ | ||
144 | uint64_t p_resp_status; /* 0x000290 */ | ||
145 | uint64_t p_resp_clear; /* 0x000298 */ | ||
146 | |||
147 | uint64_t _pad_0002A0[12]; /* 0x0002{A0..F8} */ | ||
148 | |||
149 | /* 0x000300-0x0003F8 -- Buffer Address Match Registers */ | ||
150 | struct { | ||
151 | uint64_t upper; /* 0x0003{00,,,F0} */ | ||
152 | uint64_t lower; /* 0x0003{08,,,F8} */ | ||
153 | } p_buf_addr_match[16]; | ||
154 | |||
155 | /* 0x000400-0x0005FF -- Performance Monitor Registers (even only) */ | ||
156 | struct { | ||
157 | uint64_t flush_w_touch; /* 0x000{400,,,5C0} */ | ||
158 | uint64_t flush_wo_touch; /* 0x000{408,,,5C8} */ | ||
159 | uint64_t inflight; /* 0x000{410,,,5D0} */ | ||
160 | uint64_t prefetch; /* 0x000{418,,,5D8} */ | ||
161 | uint64_t total_pci_retry; /* 0x000{420,,,5E0} */ | ||
162 | uint64_t max_pci_retry; /* 0x000{428,,,5E8} */ | ||
163 | uint64_t max_latency; /* 0x000{430,,,5F0} */ | ||
164 | uint64_t clear_all; /* 0x000{438,,,5F8} */ | ||
165 | } p_buf_count[8]; | ||
166 | |||
167 | |||
168 | /* 0x000600-0x0009FF -- PCI/X registers */ | ||
169 | uint64_t p_pcix_bus_err_addr; /* 0x000600 */ | ||
170 | uint64_t p_pcix_bus_err_attr; /* 0x000608 */ | ||
171 | uint64_t p_pcix_bus_err_data; /* 0x000610 */ | ||
172 | uint64_t p_pcix_pio_split_addr; /* 0x000618 */ | ||
173 | uint64_t p_pcix_pio_split_attr; /* 0x000620 */ | ||
174 | uint64_t p_pcix_dma_req_err_attr; /* 0x000628 */ | ||
175 | uint64_t p_pcix_dma_req_err_addr; /* 0x000630 */ | ||
176 | uint64_t p_pcix_timeout; /* 0x000638 */ | ||
177 | |||
178 | uint64_t _pad_000640[120]; /* 0x000{640,,,9F8} */ | ||
179 | |||
180 | /* 0x000A00-0x000BFF -- PCI/X Read&Write Buffer */ | ||
181 | struct { | ||
182 | uint64_t p_buf_addr; /* 0x000{A00,,,AF0} */ | ||
183 | uint64_t p_buf_attr; /* 0X000{A08,,,AF8} */ | ||
184 | } p_pcix_read_buf_64[16]; | ||
185 | |||
186 | struct { | ||
187 | uint64_t p_buf_addr; /* 0x000{B00,,,BE0} */ | ||
188 | uint64_t p_buf_attr; /* 0x000{B08,,,BE8} */ | ||
189 | uint64_t p_buf_valid; /* 0x000{B10,,,BF0} */ | ||
190 | uint64_t __pad1; /* 0x000{B18,,,BF8} */ | ||
191 | } p_pcix_write_buf_64[8]; | ||
192 | |||
193 | /* End of Local Registers -- Start of Address Map space */ | ||
194 | |||
195 | char _pad_000c00[0x010000 - 0x000c00]; | ||
196 | |||
197 | /* 0x010000-0x011fff -- Internal ATE RAM (Auto Parity Generation) */ | ||
198 | uint64_t p_int_ate_ram[1024]; /* 0x010000-0x011fff */ | ||
199 | |||
200 | /* 0x012000-0x013fff -- Internal ATE RAM (Manual Parity Generation) */ | ||
201 | uint64_t p_int_ate_ram_mp[1024]; /* 0x012000-0x013fff */ | ||
202 | |||
203 | char _pad_014000[0x18000 - 0x014000]; | ||
204 | |||
205 | /* 0x18000-0x197F8 -- PIC Write Request Ram */ | ||
206 | uint64_t p_wr_req_lower[256]; /* 0x18000 - 0x187F8 */ | ||
207 | uint64_t p_wr_req_upper[256]; /* 0x18800 - 0x18FF8 */ | ||
208 | uint64_t p_wr_req_parity[256]; /* 0x19000 - 0x197F8 */ | ||
209 | |||
210 | char _pad_019800[0x20000 - 0x019800]; | ||
211 | |||
212 | /* 0x020000-0x027FFF -- PCI Device Configuration Spaces */ | ||
213 | union { | ||
214 | uint8_t c[0x1000 / 1]; /* 0x02{0000,,,7FFF} */ | ||
215 | uint16_t s[0x1000 / 2]; /* 0x02{0000,,,7FFF} */ | ||
216 | uint32_t l[0x1000 / 4]; /* 0x02{0000,,,7FFF} */ | ||
217 | uint64_t d[0x1000 / 8]; /* 0x02{0000,,,7FFF} */ | ||
218 | union { | ||
219 | uint8_t c[0x100 / 1]; | ||
220 | uint16_t s[0x100 / 2]; | ||
221 | uint32_t l[0x100 / 4]; | ||
222 | uint64_t d[0x100 / 8]; | ||
223 | } f[8]; | ||
224 | } p_type0_cfg_dev[8]; /* 0x02{0000,,,7FFF} */ | ||
225 | |||
226 | /* 0x028000-0x028FFF -- PCI Type 1 Configuration Space */ | ||
227 | union { | ||
228 | uint8_t c[0x1000 / 1]; /* 0x028000-0x029000 */ | ||
229 | uint16_t s[0x1000 / 2]; /* 0x028000-0x029000 */ | ||
230 | uint32_t l[0x1000 / 4]; /* 0x028000-0x029000 */ | ||
231 | uint64_t d[0x1000 / 8]; /* 0x028000-0x029000 */ | ||
232 | union { | ||
233 | uint8_t c[0x100 / 1]; | ||
234 | uint16_t s[0x100 / 2]; | ||
235 | uint32_t l[0x100 / 4]; | ||
236 | uint64_t d[0x100 / 8]; | ||
237 | } f[8]; | ||
238 | } p_type1_cfg; /* 0x028000-0x029000 */ | ||
239 | |||
240 | char _pad_029000[0x030000-0x029000]; | ||
241 | |||
242 | /* 0x030000-0x030007 -- PCI Interrupt Acknowledge Cycle */ | ||
243 | union { | ||
244 | uint8_t c[8 / 1]; | ||
245 | uint16_t s[8 / 2]; | ||
246 | uint32_t l[8 / 4]; | ||
247 | uint64_t d[8 / 8]; | ||
248 | } p_pci_iack; /* 0x030000-0x030007 */ | ||
249 | |||
250 | char _pad_030007[0x040000-0x030008]; | ||
251 | |||
252 | /* 0x040000-0x030007 -- PCIX Special Cycle */ | ||
253 | union { | ||
254 | uint8_t c[8 / 1]; | ||
255 | uint16_t s[8 / 2]; | ||
256 | uint32_t l[8 / 4]; | ||
257 | uint64_t d[8 / 8]; | ||
258 | } p_pcix_cycle; /* 0x040000-0x040007 */ | ||
259 | }; | ||
260 | |||
261 | #endif /* _ASM_IA64_SN_PCI_PIC_H */ | ||
diff --git a/include/asm-ia64/sn/tiocp.h b/include/asm-ia64/sn/tiocp.h new file mode 100644 index 000000000000..5f2489c9d2dd --- /dev/null +++ b/include/asm-ia64/sn/tiocp.h | |||
@@ -0,0 +1,256 @@ | |||
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) 2003-2004 Silicon Graphics, Inc. All rights reserved. | ||
7 | */ | ||
8 | #ifndef _ASM_IA64_SN_PCI_TIOCP_H | ||
9 | #define _ASM_IA64_SN_PCI_TIOCP_H | ||
10 | |||
11 | #define TIOCP_HOST_INTR_ADDR 0x003FFFFFFFFFFFFFUL | ||
12 | #define TIOCP_PCI64_CMDTYPE_MEM (0x1ull << 60) | ||
13 | |||
14 | |||
15 | /***************************************************************************** | ||
16 | *********************** TIOCP MMR structure mapping *************************** | ||
17 | *****************************************************************************/ | ||
18 | |||
19 | struct tiocp{ | ||
20 | |||
21 | /* 0x000000-0x00FFFF -- Local Registers */ | ||
22 | |||
23 | /* 0x000000-0x000057 -- (Legacy Widget Space) Configuration */ | ||
24 | uint64_t cp_id; /* 0x000000 */ | ||
25 | uint64_t cp_stat; /* 0x000008 */ | ||
26 | uint64_t cp_err_upper; /* 0x000010 */ | ||
27 | uint64_t cp_err_lower; /* 0x000018 */ | ||
28 | #define cp_err cp_err_lower | ||
29 | uint64_t cp_control; /* 0x000020 */ | ||
30 | uint64_t cp_req_timeout; /* 0x000028 */ | ||
31 | uint64_t cp_intr_upper; /* 0x000030 */ | ||
32 | uint64_t cp_intr_lower; /* 0x000038 */ | ||
33 | #define cp_intr cp_intr_lower | ||
34 | uint64_t cp_err_cmdword; /* 0x000040 */ | ||
35 | uint64_t _pad_000048; /* 0x000048 */ | ||
36 | uint64_t cp_tflush; /* 0x000050 */ | ||
37 | |||
38 | /* 0x000058-0x00007F -- Bridge-specific Configuration */ | ||
39 | uint64_t cp_aux_err; /* 0x000058 */ | ||
40 | uint64_t cp_resp_upper; /* 0x000060 */ | ||
41 | uint64_t cp_resp_lower; /* 0x000068 */ | ||
42 | #define cp_resp cp_resp_lower | ||
43 | uint64_t cp_tst_pin_ctrl; /* 0x000070 */ | ||
44 | uint64_t cp_addr_lkerr; /* 0x000078 */ | ||
45 | |||
46 | /* 0x000080-0x00008F -- PMU & MAP */ | ||
47 | uint64_t cp_dir_map; /* 0x000080 */ | ||
48 | uint64_t _pad_000088; /* 0x000088 */ | ||
49 | |||
50 | /* 0x000090-0x00009F -- SSRAM */ | ||
51 | uint64_t cp_map_fault; /* 0x000090 */ | ||
52 | uint64_t _pad_000098; /* 0x000098 */ | ||
53 | |||
54 | /* 0x0000A0-0x0000AF -- Arbitration */ | ||
55 | uint64_t cp_arb; /* 0x0000A0 */ | ||
56 | uint64_t _pad_0000A8; /* 0x0000A8 */ | ||
57 | |||
58 | /* 0x0000B0-0x0000BF -- Number In A Can or ATE Parity Error */ | ||
59 | uint64_t cp_ate_parity_err; /* 0x0000B0 */ | ||
60 | uint64_t _pad_0000B8; /* 0x0000B8 */ | ||
61 | |||
62 | /* 0x0000C0-0x0000FF -- PCI/GIO */ | ||
63 | uint64_t cp_bus_timeout; /* 0x0000C0 */ | ||
64 | uint64_t cp_pci_cfg; /* 0x0000C8 */ | ||
65 | uint64_t cp_pci_err_upper; /* 0x0000D0 */ | ||
66 | uint64_t cp_pci_err_lower; /* 0x0000D8 */ | ||
67 | #define cp_pci_err cp_pci_err_lower | ||
68 | uint64_t _pad_0000E0[4]; /* 0x0000{E0..F8} */ | ||
69 | |||
70 | /* 0x000100-0x0001FF -- Interrupt */ | ||
71 | uint64_t cp_int_status; /* 0x000100 */ | ||
72 | uint64_t cp_int_enable; /* 0x000108 */ | ||
73 | uint64_t cp_int_rst_stat; /* 0x000110 */ | ||
74 | uint64_t cp_int_mode; /* 0x000118 */ | ||
75 | uint64_t cp_int_device; /* 0x000120 */ | ||
76 | uint64_t cp_int_host_err; /* 0x000128 */ | ||
77 | uint64_t cp_int_addr[8]; /* 0x0001{30,,,68} */ | ||
78 | uint64_t cp_err_int_view; /* 0x000170 */ | ||
79 | uint64_t cp_mult_int; /* 0x000178 */ | ||
80 | uint64_t cp_force_always[8]; /* 0x0001{80,,,B8} */ | ||
81 | uint64_t cp_force_pin[8]; /* 0x0001{C0,,,F8} */ | ||
82 | |||
83 | /* 0x000200-0x000298 -- Device */ | ||
84 | uint64_t cp_device[4]; /* 0x0002{00,,,18} */ | ||
85 | uint64_t _pad_000220[4]; /* 0x0002{20,,,38} */ | ||
86 | uint64_t cp_wr_req_buf[4]; /* 0x0002{40,,,58} */ | ||
87 | uint64_t _pad_000260[4]; /* 0x0002{60,,,78} */ | ||
88 | uint64_t cp_rrb_map[2]; /* 0x0002{80,,,88} */ | ||
89 | #define cp_even_resp cp_rrb_map[0] /* 0x000280 */ | ||
90 | #define cp_odd_resp cp_rrb_map[1] /* 0x000288 */ | ||
91 | uint64_t cp_resp_status; /* 0x000290 */ | ||
92 | uint64_t cp_resp_clear; /* 0x000298 */ | ||
93 | |||
94 | uint64_t _pad_0002A0[12]; /* 0x0002{A0..F8} */ | ||
95 | |||
96 | /* 0x000300-0x0003F8 -- Buffer Address Match Registers */ | ||
97 | struct { | ||
98 | uint64_t upper; /* 0x0003{00,,,F0} */ | ||
99 | uint64_t lower; /* 0x0003{08,,,F8} */ | ||
100 | } cp_buf_addr_match[16]; | ||
101 | |||
102 | /* 0x000400-0x0005FF -- Performance Monitor Registers (even only) */ | ||
103 | struct { | ||
104 | uint64_t flush_w_touch; /* 0x000{400,,,5C0} */ | ||
105 | uint64_t flush_wo_touch; /* 0x000{408,,,5C8} */ | ||
106 | uint64_t inflight; /* 0x000{410,,,5D0} */ | ||
107 | uint64_t prefetch; /* 0x000{418,,,5D8} */ | ||
108 | uint64_t total_pci_retry; /* 0x000{420,,,5E0} */ | ||
109 | uint64_t max_pci_retry; /* 0x000{428,,,5E8} */ | ||
110 | uint64_t max_latency; /* 0x000{430,,,5F0} */ | ||
111 | uint64_t clear_all; /* 0x000{438,,,5F8} */ | ||
112 | } cp_buf_count[8]; | ||
113 | |||
114 | |||
115 | /* 0x000600-0x0009FF -- PCI/X registers */ | ||
116 | uint64_t cp_pcix_bus_err_addr; /* 0x000600 */ | ||
117 | uint64_t cp_pcix_bus_err_attr; /* 0x000608 */ | ||
118 | uint64_t cp_pcix_bus_err_data; /* 0x000610 */ | ||
119 | uint64_t cp_pcix_pio_split_addr; /* 0x000618 */ | ||
120 | uint64_t cp_pcix_pio_split_attr; /* 0x000620 */ | ||
121 | uint64_t cp_pcix_dma_req_err_attr; /* 0x000628 */ | ||
122 | uint64_t cp_pcix_dma_req_err_addr; /* 0x000630 */ | ||
123 | uint64_t cp_pcix_timeout; /* 0x000638 */ | ||
124 | |||
125 | uint64_t _pad_000640[24]; /* 0x000{640,,,6F8} */ | ||
126 | |||
127 | /* 0x000700-0x000737 -- Debug Registers */ | ||
128 | uint64_t cp_ct_debug_ctl; /* 0x000700 */ | ||
129 | uint64_t cp_br_debug_ctl; /* 0x000708 */ | ||
130 | uint64_t cp_mux3_debug_ctl; /* 0x000710 */ | ||
131 | uint64_t cp_mux4_debug_ctl; /* 0x000718 */ | ||
132 | uint64_t cp_mux5_debug_ctl; /* 0x000720 */ | ||
133 | uint64_t cp_mux6_debug_ctl; /* 0x000728 */ | ||
134 | uint64_t cp_mux7_debug_ctl; /* 0x000730 */ | ||
135 | |||
136 | uint64_t _pad_000738[89]; /* 0x000{738,,,9F8} */ | ||
137 | |||
138 | /* 0x000A00-0x000BFF -- PCI/X Read&Write Buffer */ | ||
139 | struct { | ||
140 | uint64_t cp_buf_addr; /* 0x000{A00,,,AF0} */ | ||
141 | uint64_t cp_buf_attr; /* 0X000{A08,,,AF8} */ | ||
142 | } cp_pcix_read_buf_64[16]; | ||
143 | |||
144 | struct { | ||
145 | uint64_t cp_buf_addr; /* 0x000{B00,,,BE0} */ | ||
146 | uint64_t cp_buf_attr; /* 0x000{B08,,,BE8} */ | ||
147 | uint64_t cp_buf_valid; /* 0x000{B10,,,BF0} */ | ||
148 | uint64_t __pad1; /* 0x000{B18,,,BF8} */ | ||
149 | } cp_pcix_write_buf_64[8]; | ||
150 | |||
151 | /* End of Local Registers -- Start of Address Map space */ | ||
152 | |||
153 | char _pad_000c00[0x010000 - 0x000c00]; | ||
154 | |||
155 | /* 0x010000-0x011FF8 -- Internal ATE RAM (Auto Parity Generation) */ | ||
156 | uint64_t cp_int_ate_ram[1024]; /* 0x010000-0x011FF8 */ | ||
157 | |||
158 | char _pad_012000[0x14000 - 0x012000]; | ||
159 | |||
160 | /* 0x014000-0x015FF8 -- Internal ATE RAM (Manual Parity Generation) */ | ||
161 | uint64_t cp_int_ate_ram_mp[1024]; /* 0x014000-0x015FF8 */ | ||
162 | |||
163 | char _pad_016000[0x18000 - 0x016000]; | ||
164 | |||
165 | /* 0x18000-0x197F8 -- TIOCP Write Request Ram */ | ||
166 | uint64_t cp_wr_req_lower[256]; /* 0x18000 - 0x187F8 */ | ||
167 | uint64_t cp_wr_req_upper[256]; /* 0x18800 - 0x18FF8 */ | ||
168 | uint64_t cp_wr_req_parity[256]; /* 0x19000 - 0x197F8 */ | ||
169 | |||
170 | char _pad_019800[0x1C000 - 0x019800]; | ||
171 | |||
172 | /* 0x1C000-0x1EFF8 -- TIOCP Read Response Ram */ | ||
173 | uint64_t cp_rd_resp_lower[512]; /* 0x1C000 - 0x1CFF8 */ | ||
174 | uint64_t cp_rd_resp_upper[512]; /* 0x1D000 - 0x1DFF8 */ | ||
175 | uint64_t cp_rd_resp_parity[512]; /* 0x1E000 - 0x1EFF8 */ | ||
176 | |||
177 | char _pad_01F000[0x20000 - 0x01F000]; | ||
178 | |||
179 | /* 0x020000-0x021FFF -- Host Device (CP) Configuration Space (not used) */ | ||
180 | char _pad_020000[0x021000 - 0x20000]; | ||
181 | |||
182 | /* 0x021000-0x027FFF -- PCI Device Configuration Spaces */ | ||
183 | union { | ||
184 | uint8_t c[0x1000 / 1]; /* 0x02{0000,,,7FFF} */ | ||
185 | uint16_t s[0x1000 / 2]; /* 0x02{0000,,,7FFF} */ | ||
186 | uint32_t l[0x1000 / 4]; /* 0x02{0000,,,7FFF} */ | ||
187 | uint64_t d[0x1000 / 8]; /* 0x02{0000,,,7FFF} */ | ||
188 | union { | ||
189 | uint8_t c[0x100 / 1]; | ||
190 | uint16_t s[0x100 / 2]; | ||
191 | uint32_t l[0x100 / 4]; | ||
192 | uint64_t d[0x100 / 8]; | ||
193 | } f[8]; | ||
194 | } cp_type0_cfg_dev[7]; /* 0x02{1000,,,7FFF} */ | ||
195 | |||
196 | /* 0x028000-0x028FFF -- PCI Type 1 Configuration Space */ | ||
197 | union { | ||
198 | uint8_t c[0x1000 / 1]; /* 0x028000-0x029000 */ | ||
199 | uint16_t s[0x1000 / 2]; /* 0x028000-0x029000 */ | ||
200 | uint32_t l[0x1000 / 4]; /* 0x028000-0x029000 */ | ||
201 | uint64_t d[0x1000 / 8]; /* 0x028000-0x029000 */ | ||
202 | union { | ||
203 | uint8_t c[0x100 / 1]; | ||
204 | uint16_t s[0x100 / 2]; | ||
205 | uint32_t l[0x100 / 4]; | ||
206 | uint64_t d[0x100 / 8]; | ||
207 | } f[8]; | ||
208 | } cp_type1_cfg; /* 0x028000-0x029000 */ | ||
209 | |||
210 | char _pad_029000[0x030000-0x029000]; | ||
211 | |||
212 | /* 0x030000-0x030007 -- PCI Interrupt Acknowledge Cycle */ | ||
213 | union { | ||
214 | uint8_t c[8 / 1]; | ||
215 | uint16_t s[8 / 2]; | ||
216 | uint32_t l[8 / 4]; | ||
217 | uint64_t d[8 / 8]; | ||
218 | } cp_pci_iack; /* 0x030000-0x030007 */ | ||
219 | |||
220 | char _pad_030007[0x040000-0x030008]; | ||
221 | |||
222 | /* 0x040000-0x040007 -- PCIX Special Cycle */ | ||
223 | union { | ||
224 | uint8_t c[8 / 1]; | ||
225 | uint16_t s[8 / 2]; | ||
226 | uint32_t l[8 / 4]; | ||
227 | uint64_t d[8 / 8]; | ||
228 | } cp_pcix_cycle; /* 0x040000-0x040007 */ | ||
229 | |||
230 | char _pad_040007[0x200000-0x040008]; | ||
231 | |||
232 | /* 0x200000-0x7FFFFF -- PCI/GIO Device Spaces */ | ||
233 | union { | ||
234 | uint8_t c[0x100000 / 1]; | ||
235 | uint16_t s[0x100000 / 2]; | ||
236 | uint32_t l[0x100000 / 4]; | ||
237 | uint64_t d[0x100000 / 8]; | ||
238 | } cp_devio_raw[6]; /* 0x200000-0x7FFFFF */ | ||
239 | |||
240 | #define cp_devio(n) cp_devio_raw[((n)<2)?(n*2):(n+2)] | ||
241 | |||
242 | char _pad_800000[0xA00000-0x800000]; | ||
243 | |||
244 | /* 0xA00000-0xBFFFFF -- PCI/GIO Device Spaces w/flush */ | ||
245 | union { | ||
246 | uint8_t c[0x100000 / 1]; | ||
247 | uint16_t s[0x100000 / 2]; | ||
248 | uint32_t l[0x100000 / 4]; | ||
249 | uint64_t d[0x100000 / 8]; | ||
250 | } cp_devio_raw_flush[6]; /* 0xA00000-0xBFFFFF */ | ||
251 | |||
252 | #define cp_devio_flush(n) cp_devio_raw_flush[((n)<2)?(n*2):(n+2)] | ||
253 | |||
254 | }; | ||
255 | |||
256 | #endif /* _ASM_IA64_SN_PCI_TIOCP_H */ | ||