1#ifndef __PARISC_PATPDC_H
2#define __PARISC_PATPDC_H
3
4
5
6
7
8
9
10
11
12
13
14#define PDC_PAT_CELL 64L
15
16#define PDC_PAT_CELL_GET_NUMBER 0L
17#define PDC_PAT_CELL_GET_INFO 1L
18#define PDC_PAT_CELL_MODULE 2L
19#define PDC_PAT_CELL_SET_ATTENTION 9L
20#define PDC_PAT_CELL_NUMBER_TO_LOC 10L
21#define PDC_PAT_CELL_WALK_FABRIC 11L
22#define PDC_PAT_CELL_GET_RDT_SIZE 12L
23#define PDC_PAT_CELL_GET_RDT 13L
24#define PDC_PAT_CELL_GET_LOCAL_PDH_SZ 14L
25#define PDC_PAT_CELL_SET_LOCAL_PDH 15L
26#define PDC_PAT_CELL_GET_REMOTE_PDH_SZ 16L
27#define PDC_PAT_CELL_GET_REMOTE_PDH 17L
28#define PDC_PAT_CELL_GET_DBG_INFO 128L
29#define PDC_PAT_CELL_CHANGE_ALIAS 129L
30
31
32
33
34
35
36
37
38#define IO_VIEW 0UL
39#define PA_VIEW 1UL
40
41
42#define PAT_ENTITY_CA 0
43#define PAT_ENTITY_PROC 1
44#define PAT_ENTITY_MEM 2
45#define PAT_ENTITY_SBA 3
46#define PAT_ENTITY_LBA 4
47#define PAT_ENTITY_PBC 5
48#define PAT_ENTITY_XBC 6
49#define PAT_ENTITY_RC 7
50
51
52#define PAT_PBNUM 0
53#define PAT_LMMIO 1
54#define PAT_GMMIO 2
55#define PAT_NPIOP 3
56#define PAT_PIOP 4
57#define PAT_AHPA 5
58#define PAT_UFO 6
59#define PAT_GNIP 7
60
61
62
63
64
65#define PDC_PAT_CHASSIS_LOG 65L
66#define PDC_PAT_CHASSIS_WRITE_LOG 0L
67#define PDC_PAT_CHASSIS_READ_LOG 1L
68
69
70
71
72#define PDC_PAT_CPU 67L
73#define PDC_PAT_CPU_INFO 0L
74#define PDC_PAT_CPU_DELETE 1L
75#define PDC_PAT_CPU_ADD 2L
76#define PDC_PAT_CPU_GET_NUMBER 3L
77#define PDC_PAT_CPU_GET_HPA 4L
78#define PDC_PAT_CPU_STOP 5L
79#define PDC_PAT_CPU_RENDEZVOUS 6L
80#define PDC_PAT_CPU_GET_CLOCK_INFO 7L
81#define PDC_PAT_CPU_GET_RENDEZVOUS_STATE 8L
82#define PDC_PAT_CPU_PLUNGE_FABRIC 128L
83#define PDC_PAT_CPU_UPDATE_CACHE_CLEANSING 129L
84
85
86
87#define PDC_PAT_EVENT 68L
88#define PDC_PAT_EVENT_GET_CAPS 0L
89#define PDC_PAT_EVENT_SET_MODE 1L
90#define PDC_PAT_EVENT_SCAN 2L
91#define PDC_PAT_EVENT_HANDLE 3L
92#define PDC_PAT_EVENT_GET_NB_CALL 4L
93
94
95
96
97
98#define PDC_PAT_HPMC 70L
99#define PDC_PAT_HPMC_RENDEZ_CPU 0L
100#define PDC_PAT_HPMC_SET_PARAMS 1L
101
102
103
104
105#define HPMC_SET_PARAMS_INTR 1L
106#define HPMC_SET_PARAMS_WAKE 2L
107
108
109
110
111#define PDC_PAT_IO 71L
112#define PDC_PAT_IO_GET_SLOT_STATUS 5L
113#define PDC_PAT_IO_GET_LOC_FROM_HARDWARE 6L
114
115#define PDC_PAT_IO_GET_HARDWARE_FROM_LOC 7L
116
117#define PDC_PAT_IO_GET_PCI_CONFIG_FROM_HW 11L
118
119#define PDC_PAT_IO_GET_HW_FROM_PCI_CONFIG 12L
120
121#define PDC_PAT_IO_READ_HOST_BRIDGE_INFO 13L
122#define PDC_PAT_IO_CLEAR_HOST_BRIDGE_INFO 14L
123#define PDC_PAT_IO_GET_PCI_ROUTING_TABLE_SIZE 15L
124
125#define PDC_PAT_IO_GET_PCI_ROUTING_TABLE 16L
126#define PDC_PAT_IO_GET_HINT_TABLE_SIZE 17L
127#define PDC_PAT_IO_GET_HINT_TABLE 18L
128#define PDC_PAT_IO_PCI_CONFIG_READ 19L
129#define PDC_PAT_IO_PCI_CONFIG_WRITE 20L
130#define PDC_PAT_IO_GET_NUM_IO_SLOTS 21L
131
132#define PDC_PAT_IO_GET_LOC_IO_SLOTS 22L
133
134#define PDC_PAT_IO_BAY_STATUS_INFO 28L
135#define PDC_PAT_IO_GET_PROC_VIEW 29L
136#define PDC_PAT_IO_PROG_SBA_DIR_RANGE 30L
137
138
139
140
141#define PDC_PAT_MEM 72L
142#define PDC_PAT_MEM_PD_INFO 0L
143#define PDC_PAT_MEM_PD_CLEAR 1L
144#define PDC_PAT_MEM_PD_READ 2L
145#define PDC_PAT_MEM_PD_RESET 3L
146#define PDC_PAT_MEM_CELL_INFO 5L
147#define PDC_PAT_MEM_CELL_CLEAR 6L
148#define PDC_PAT_MEM_CELL_READ 7L
149#define PDC_PAT_MEM_CELL_RESET 8L
150#define PDC_PAT_MEM_SETGM 9L
151#define PDC_PAT_MEM_ADD_PAGE 10L
152#define PDC_PAT_MEM_ADDRESS 11L
153
154#define PDC_PAT_MEM_GET_TXT_SIZE 12L
155#define PDC_PAT_MEM_GET_PD_TXT 13L
156#define PDC_PAT_MEM_GET_CELL_TXT 14L
157#define PDC_PAT_MEM_RD_STATE_INFO 15L
158#define PDC_PAT_MEM_CLR_STATE_INFO 16L
159#define PDC_PAT_MEM_CLEAN_RANGE 128L
160#define PDC_PAT_MEM_GET_TBL_SIZE 131L
161#define PDC_PAT_MEM_GET_TBL 132L
162
163
164
165
166#define PDC_PAT_NVOLATILE 73L
167#define PDC_PAT_NVOLATILE_READ 0L
168#define PDC_PAT_NVOLATILE_WRITE 1L
169#define PDC_PAT_NVOLATILE_GET_SIZE 2L
170#define PDC_PAT_NVOLATILE_VERIFY 3L
171#define PDC_PAT_NVOLATILE_INIT 4L
172
173
174#define PDC_PAT_PD 74L
175#define PDC_PAT_PD_GET_ADDR_MAP 0L
176
177
178#define PAT_MEMORY_DESCRIPTOR 1
179
180
181#define PAT_MEMTYPE_MEMORY 0
182#define PAT_MEMTYPE_FIRMWARE 4
183
184
185#define PAT_MEMUSE_GENERAL 0
186#define PAT_MEMUSE_GI 128
187#define PAT_MEMUSE_GNI 129
188
189
190#ifndef __ASSEMBLY__
191#include <linux/types.h>
192
193#ifdef CONFIG_64BIT
194#define is_pdc_pat() (PDC_TYPE_PAT == pdc_type)
195extern int pdc_pat_get_irt_size(unsigned long *num_entries, unsigned long cell_num);
196extern int pdc_pat_get_irt(void *r_addr, unsigned long cell_num);
197#else
198
199#define is_pdc_pat() (0)
200#define pdc_pat_get_irt_size(num_entries, cell_numn) PDC_BAD_PROC
201#define pdc_pat_get_irt(r_addr, cell_num) PDC_BAD_PROC
202#endif
203
204
205struct pdc_pat_cell_num {
206 unsigned long cell_num;
207 unsigned long cell_loc;
208};
209
210struct pdc_pat_cpu_num {
211 unsigned long cpu_num;
212 unsigned long cpu_loc;
213};
214
215struct pdc_pat_pd_addr_map_entry {
216 unsigned char entry_type;
217 unsigned char reserve1[5];
218 unsigned char memory_type;
219 unsigned char memory_usage;
220 unsigned long paddr;
221 unsigned int pages;
222 unsigned int reserve2;
223 unsigned long cell_map;
224};
225
226
227
228
229
230
231
232
233#define PAT_GET_CBA(value) ((value) & 0xfffffffffffff000UL)
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250#define PAT_GET_ENTITY(value) (((value) >> 56) & 0xffUL)
251#define PAT_GET_DVI(value) (((value) >> 48) & 0xffUL)
252#define PAT_GET_IOC(value) (((value) >> 40) & 0xffUL)
253#define PAT_GET_MOD_PAGES(value) ((value) & 0xffffffUL)
254
255
256
257
258
259typedef struct pdc_pat_cell_info_rtn_block {
260 unsigned long cpu_info;
261 unsigned long cell_info;
262 unsigned long cell_location;
263 unsigned long reo_location;
264 unsigned long mem_size;
265 unsigned long dimm_status;
266 unsigned long pdc_rev;
267 unsigned long fabric_info0;
268 unsigned long fabric_info1;
269 unsigned long fabric_info2;
270 unsigned long fabric_info3;
271 unsigned long reserved[21];
272} pdc_pat_cell_info_rtn_block_t;
273
274
275
276struct pdc_pat_cell_mod_maddr_block {
277 unsigned long cba;
278 unsigned long mod_info;
279 unsigned long mod_location;
280 struct hardware_path mod_path;
281 unsigned long mod[508];
282} __attribute__((aligned(8))) ;
283
284typedef struct pdc_pat_cell_mod_maddr_block pdc_pat_cell_mod_maddr_block_t;
285
286
287extern int pdc_pat_chassis_send_log(unsigned long status, unsigned long data);
288extern int pdc_pat_cell_get_number(struct pdc_pat_cell_num *cell_info);
289extern int pdc_pat_cell_module(unsigned long *actcnt, unsigned long ploc, unsigned long mod, unsigned long view_type, void *mem_addr);
290extern int pdc_pat_cell_num_to_loc(void *, unsigned long);
291
292extern int pdc_pat_cpu_get_number(struct pdc_pat_cpu_num *cpu_info, void *hpa);
293
294extern int pdc_pat_pd_get_addr_map(unsigned long *actual_len, void *mem_addr, unsigned long count, unsigned long offset);
295
296
297extern int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *val);
298extern int pdc_pat_io_pci_cfg_write(unsigned long pci_addr, int pci_size, u32 val);
299
300
301
302
303
304extern int pdc_pat;
305
306#endif
307
308#endif
309