1#ifndef _PARISC_PDC_H
2#define _PARISC_PDC_H
3
4
5
6
7
8#define PDC_POW_FAIL 1
9#define PDC_POW_FAIL_PREPARE 0
10
11#define PDC_CHASSIS 2
12#define PDC_CHASSIS_DISP 0
13#define PDC_CHASSIS_WARN 1
14#define PDC_CHASSIS_DISPWARN 2
15#define PDC_RETURN_CHASSIS_INFO 128
16
17#define PDC_PIM 3
18#define PDC_PIM_HPMC 0
19#define PDC_PIM_RETURN_SIZE 1
20#define PDC_PIM_LPMC 2
21#define PDC_PIM_SOFT_BOOT 3
22#define PDC_PIM_TOC 4
23
24#define PDC_MODEL 4
25#define PDC_MODEL_INFO 0
26#define PDC_MODEL_BOOTID 1
27#define PDC_MODEL_VERSIONS 2
28#define PDC_MODEL_SYSMODEL 3
29#define PDC_MODEL_ENSPEC 4
30#define PDC_MODEL_DISPEC 5
31#define PDC_MODEL_CPU_ID 6
32#define PDC_MODEL_CAPABILITIES 7
33#define PDC_MODEL_GET_BOOT__OP 8
34#define PDC_MODEL_SET_BOOT__OP 9
35
36#define PDC_CACHE 5
37#define PDC_CACHE_INFO 0
38#define PDC_CACHE_SET_COH 1
39#define PDC_CACHE_RET_SPID 2
40
41#define PDC_HPA 6
42#define PDC_HPA_PROCESSOR 0
43#define PDC_HPA_MODULES 1
44
45#define PDC_IODC 8
46#define PDC_IODC_READ 0
47
48#define PDC_IODC_RI_DATA_BYTES 0
49
50#define PDC_IODC_RI_INIT 3
51#define PDC_IODC_RI_IO 4
52#define PDC_IODC_RI_SPA 5
53#define PDC_IODC_RI_CONFIG 6
54
55#define PDC_IODC_RI_TEST 8
56#define PDC_IODC_RI_TLB 9
57#define PDC_IODC_NINIT 2
58#define PDC_IODC_DINIT 3
59#define PDC_IODC_MEMERR 4
60#define PDC_IODC_INDEX_DATA 0
61#define PDC_IODC_BUS_ERROR -4
62#define PDC_IODC_INVALID_INDEX -5
63#define PDC_IODC_COUNT -6
64
65#define PDC_TOD 9
66#define PDC_TOD_READ 0
67#define PDC_TOD_WRITE 1
68#define PDC_TOD_ITIMER 2
69
70#define PDC_ADD_VALID 12
71#define PDC_ADD_VALID_VERIFY 0
72
73#define PDC_INSTR 15
74
75#define PDC_BLOCK_TLB 18
76#define PDC_BTLB_INFO 0
77#define PDC_BTLB_INSERT 1
78#define PDC_BTLB_PURGE 2
79#define PDC_BTLB_PURGE_ALL 3
80
81#define PDC_TLB 19
82#define PDC_TLB_INFO 0
83#define PDC_TLB_SETUP 1
84
85#define PDC_SYSTEM_MAP 22
86#define PDC_FIND_MODULE 0
87
88
89
90
91#define PDC_IO 135
92
93#define PDC_BROADCAST_RESET 136
94#define PDC_DO_RESET 0UL
95#define PDC_DO_FIRM_TEST_RESET 1UL
96#define PDC_BR_RECONFIGURATION 2UL
97#define PDC_FIRM_TEST_MAGIC 0xab9ec36fUL
98
99#define PDC_LAN_STATION_ID 138
100#define PDC_LAN_STATION_ID_READ 0
101
102#define PDC_LAN_STATION_ID_SIZE 6
103
104
105#define PDC_PCI_INDEX 147UL
106#define PDC_PCI_GET_INT_TBL_SIZE 13UL
107#define PDC_PCI_GET_INT_TBL 14UL
108
109
110
111#define PDC_WARN 3
112#define PDC_REQ_ERR_1 2
113#define PDC_REQ_ERR_0 1
114#define PDC_OK 0
115#define PDC_BAD_PROC -1
116#define PDC_BAD_OPTION -2
117#define PDC_ERROR -3
118#define PDC_INVALID_ARG -10
119#define PDC_BUS_POW_WARN -12
120
121
122
123
124
125#define PDC_RET_OK 0L
126#define PDC_RET_NE_PROC -1L
127#define PDC_RET_NE_OPT -2L
128#define PDC_RET_NE_MOD -5L
129#define PDC_RET_NE_CELL_MOD -7L
130#define PDC_RET_INV_ARG -10L
131#define PDC_RET_NOT_NARROW -17L
132
133
134
135
136#define PDC_ADD_VALID_WARN 3
137#define PDC_ADD_VALID_REQ_ERR_1 2
138#define PDC_ADD_VALID_REQ_ERR_0 1
139#define PDC_ADD_VALID_OK 0
140#define PDC_ADD_VALID_BAD_OPTION -2
141#define PDC_ADD_VALID_ERROR -3
142#define PDC_ADD_VALID_INVALID_ARG -10
143#define PDC_ADD_VALID_BUS_POW_WARN -12
144
145
146
147#define PDC_MEM_MAP 128
148#define PDC_MEM_MAP_HPA 0
149
150
151#define OS_ID_NONE 0
152#define OS_ID_HPUX 1
153#define OS_ID_MPEXL 2
154#define OS_ID_OSF 3
155#define OS_ID_LINUX OS_ID_HPUX
156
157
158#define OSTAT_OFF 0
159#define OSTAT_FLT 1
160#define OSTAT_TEST 2
161#define OSTAT_INIT 3
162#define OSTAT_SHUT 4
163#define OSTAT_WARN 5
164#define OSTAT_RUN 6
165#define OSTAT_ON 7
166
167#ifndef __ASSEMBLY__
168
169#include <linux/types.h>
170
171struct pdc_model {
172 unsigned long hversion;
173 unsigned long sversion;
174 unsigned long hw_id;
175 unsigned long boot_id;
176 unsigned long sw_id;
177 unsigned long sw_cap;
178 unsigned long arch_rev;
179 unsigned long pot_key;
180 unsigned long curr_key;
181 unsigned long pad[32-9];
182} __attribute__((aligned(8))) ;
183
184
185#if 0
186struct pdc_chassis_warn {
187 unsigned long warn;
188 unsigned long pad[32-1];
189} __attribute__((aligned(8))) ;
190#endif
191
192struct pdc_model_sysmodel {
193 unsigned long mod_len;
194 unsigned long pad[32-1];
195} __attribute__((aligned(8))) ;
196
197struct pdc_model_cpuid {
198 unsigned long cpuid;
199 unsigned long pad[32-1];
200} __attribute__((aligned(8))) ;
201
202struct pdc_cache_cf {
203 unsigned long
204#ifdef __LP64__
205 cc_padW:32,
206#endif
207 cc_alias:4,
208 cc_block: 4,
209 cc_line : 3,
210 cc_pad0 : 2,
211 cc_wt : 1,
212 cc_sh : 2,
213 cc_cst : 3,
214 cc_pad1 : 5,
215 cc_assoc: 8;
216};
217
218struct pdc_tlb_cf {
219 unsigned long tc_pad0:12,
220#ifdef __LP64__
221 tc_padW:32,
222#endif
223 tc_sh : 2,
224 tc_hv : 1,
225 tc_page : 1,
226 tc_cst : 3,
227 tc_aid : 5,
228 tc_pad1 : 8;
229};
230
231struct pdc_cache_info {
232
233 unsigned long ic_size;
234 struct pdc_cache_cf ic_conf;
235 unsigned long ic_base;
236 unsigned long ic_stride;
237 unsigned long ic_count;
238 unsigned long ic_loop;
239
240 unsigned long dc_size;
241 struct pdc_cache_cf dc_conf;
242 unsigned long dc_base;
243 unsigned long dc_stride;
244 unsigned long dc_count;
245 unsigned long dc_loop;
246
247 unsigned long it_size;
248 struct pdc_tlb_cf it_conf;
249 unsigned long it_sp_base;
250 unsigned long it_sp_stride;
251 unsigned long it_sp_count;
252 unsigned long it_off_base;
253 unsigned long it_off_stride;
254 unsigned long it_off_count;
255 unsigned long it_loop;
256
257 unsigned long dt_size;
258 struct pdc_tlb_cf dt_conf;
259 unsigned long dt_sp_base;
260 unsigned long dt_sp_stride;
261 unsigned long dt_sp_count;
262 unsigned long dt_off_base;
263 unsigned long dt_off_stride;
264 unsigned long dt_off_count;
265 unsigned long dt_loop;
266
267 unsigned long pad[32-30];
268} __attribute__((aligned(8))) ;
269
270struct pdc_hpa {
271 unsigned long hpa;
272 unsigned long filler[31];
273} __attribute__((aligned(8))) ;
274
275#if 0
276
277
278
279struct pdc_iodc {
280 unsigned char hversion_model;
281 unsigned char hversion;
282 unsigned char spa;
283 unsigned char type;
284 unsigned int sversion_rev:4;
285 unsigned int sversion_model:19;
286 unsigned int sversion_opt:8;
287 unsigned char rev;
288 unsigned char dep;
289 unsigned char features;
290 unsigned char filler1;
291 unsigned int checksum:16;
292 unsigned int length:16;
293 unsigned int filler[15];
294} __attribute__((aligned(8))) ;
295#endif
296
297#ifndef __LP64__
298
299struct pdc_btlb_info_range {
300 __u8 res00;
301 __u8 num_i;
302 __u8 num_d;
303 __u8 num_comb;
304};
305
306struct pdc_btlb_info {
307 unsigned int min_size;
308 unsigned int max_size;
309 struct pdc_btlb_info_range fixed_range_info;
310 struct pdc_btlb_info_range variable_range_info;
311 unsigned int pad[32-4];
312} __attribute__((aligned(8))) ;
313#endif
314
315struct pdc_tlb {
316 unsigned long min_size;
317 unsigned long max_size;
318 unsigned long pad[32-2];
319} __attribute__((aligned(8))) ;
320
321struct pdc_system_map {
322 void * mod_addr;
323 unsigned long mod_pgs;
324 unsigned long add_addrs;
325 unsigned long filler[29];
326} __attribute__((aligned(8))) ;
327
328
329
330
331struct pdc_module_path {
332 char flags;
333 char bc[6];
334
335 char mod;
336 unsigned int layers[6];
337} __attribute__((aligned(8))) ;
338
339#ifndef __LP64__
340
341struct pdc_memory_map {
342 unsigned int hpa;
343 unsigned int more_pgs;
344} __attribute__((aligned(8))) ;
345
346struct pdc_lan_station_id {
347 unsigned char addr[PDC_LAN_STATION_ID_SIZE];
348 unsigned char pad0[2];
349 int pad1[30];
350};
351#endif
352
353struct pdc_tod {
354 unsigned long tod_sec;
355 unsigned long tod_usec;
356 long pad[30];
357} __attribute__((aligned(8))) ;
358
359
360
361struct pdc_hpmc_pim_11 {
362 __u32 gr[32];
363 __u32 cr[32];
364 __u32 sr[8];
365 __u32 iasq_back;
366 __u32 iaoq_back;
367 __u32 check_type;
368 __u32 cpu_state;
369 __u32 rsvd1;
370 __u32 cache_check;
371 __u32 tlb_check;
372 __u32 bus_check;
373 __u32 assists_check;
374 __u32 rsvd2;
375 __u32 assist_state;
376 __u32 responder_addr;
377 __u32 requestor_addr;
378 __u32 path_info;
379 __u64 fr[32];
380};
381
382
383
384
385
386
387
388
389
390
391
392
393
394struct pdc_hpmc_pim_20 {
395 __u64 gr[32];
396 __u64 cr[32];
397 __u64 sr[8];
398 __u64 iasq_back;
399 __u64 iaoq_back;
400 __u32 check_type;
401 __u32 cpu_state;
402 __u32 cache_check;
403 __u32 tlb_check;
404 __u32 bus_check;
405 __u32 assists_check;
406 __u32 assist_state;
407 __u32 path_info;
408 __u64 responder_addr;
409 __u64 requestor_addr;
410 __u64 fr[32];
411};
412
413#endif
414
415
416#define PF_AUTOBOOT 0x80
417#define PF_AUTOSEARCH 0x40
418#define PF_TIMER 0x0F
419
420#ifndef __ASSEMBLY__
421
422struct device_path {
423 unsigned char flags;
424 unsigned char bc[6];
425 unsigned char mod;
426 unsigned int layers[6];
427} __attribute__((aligned(8))) ;
428
429struct pz_device {
430 struct device_path dp;
431
432 unsigned int hpa;
433
434 unsigned int spa;
435
436 unsigned int iodc_io;
437 short pad;
438 unsigned short cl_class;
439} __attribute__((aligned(8))) ;
440
441#endif
442
443
444
445
446
447#define CL_NULL 0
448#define CL_RANDOM 1
449#define CL_SEQU 2
450#define CL_DUPLEX 7
451#define CL_KEYBD 8
452#define CL_DISPL 9
453#define CL_FC 10
454
455#if 0
456
457#define DEVCLASS_RANDOM 1
458#define DEVCLASS_SEQU 2
459#define DEVCLASS_DUPLEX 7
460#define DEVCLASS_KEYBD 8
461#define DEVCLASS_DISP 9
462#endif
463
464
465#define ENTRY_INIT_SRCH_FRST 2
466#define ENTRY_INIT_SRCH_NEXT 3
467#define ENTRY_INIT_MOD_DEV 4
468#define ENTRY_INIT_DEV 5
469#define ENTRY_INIT_MOD 6
470#define ENTRY_INIT_MSG 9
471
472
473#define ENTRY_IO_BOOTIN 0
474#define ENTRY_IO_CIN 2
475#define ENTRY_IO_COUT 3
476#define ENTRY_IO_CLOSE 4
477#define ENTRY_IO_GETMSG 9
478
479
480
481
482
483
484
485
486
487
488
489
490
491#ifndef __ASSEMBLY__
492
493#define PAGE0 ((struct zeropage *)0xc0000000)
494
495struct zeropage {
496
497 unsigned int vec_special;
498
499 unsigned int vec_pow_fail;
500
501 unsigned int vec_toc;
502 unsigned int vec_toclen;
503
504 unsigned int vec_rendz;
505 int vec_pow_fail_flen;
506 int vec_pad[10];
507
508
509 int pad0[112];
510
511
512 int pad1[84];
513
514
515 int memc_cont;
516 int memc_phsize;
517 int memc_adsize;
518 unsigned int mem_pdc_hi;
519
520
521
522 unsigned int mem_booterr[8];
523 unsigned int mem_free;
524
525 unsigned int mem_hpa;
526
527 unsigned int mem_pdc;
528 unsigned int mem_10msec;
529
530
531
532 unsigned int imm_hpa;
533 int imm_soft_boot;
534 unsigned int imm_spa_size;
535 unsigned int imm_max_mem;
536
537
538 struct pz_device mem_cons;
539 struct pz_device mem_boot;
540 struct pz_device mem_kbd;
541
542
543 int pad430[116];
544
545
546 __u32 pad600[1];
547 __u32 proc_sti;
548 __u32 pad608[126];
549};
550
551#endif
552
553
554
555#define BOOT_CONSOLE_HPA_OFFSET 0x3c0
556#define BOOT_CONSOLE_SPA_OFFSET 0x3c4
557#define BOOT_CONSOLE_PATH_OFFSET 0x3a8
558
559#ifndef __ASSEMBLY__
560
561struct pdc_pat_io_num {
562 unsigned long num;
563 unsigned long reserved[31];
564};
565
566
567
568extern void pdc_console_init(void);
569extern int pdc_getc(void);
570extern void pdc_putc(unsigned char);
571
572
573
574
575int pdc_add_valid(void *address);
576int pdc_hpa_processor(void *address);
577#if 0
578int pdc_hpa_modules(void *address);
579#endif
580int pdc_iodc_read(void *address, void *hpa, unsigned int index,
581 void *iodc_data, unsigned int iodc_data_size);
582int pdc_system_map_find_mods(void *pdc_mod_info, void *mod_path, int index);
583int pdc_model_info(struct pdc_model *model);
584int pdc_model_sysmodel(char *name);
585int pdc_model_cpuid(struct pdc_model_cpuid *cpu_id);
586int pdc_model_versions(struct pdc_model_cpuid *cpu_id, int id);
587int pdc_cache_info(struct pdc_cache_info *cache);
588#ifndef __LP64__
589int pdc_btlb_info( struct pdc_btlb_info *btlb);
590int pdc_lan_station_id( char *lan_addr, void *net_hpa);
591#endif
592int pdc_mem_map_hpa(void *r_addr, void *mod_path);
593
594extern int pdc_chassis_disp(unsigned long disp);
595extern int pdc_chassis_info(void *pdc_result, void *chassis_info, unsigned long len);
596
597#ifdef __LP64__
598int pdc_pat_get_irt_size(void *r_addr, unsigned long cell_num);
599int pdc_pat_get_irt(void *r_addr, unsigned long cell_num);
600#else
601
602#define pdc_pat_get_irt_size(r_addr, cell_numn) PDC_RET_NE_PROC
603#define pdc_pat_get_irt(r_addr, cell_num) PDC_RET_NE_PROC
604#endif
605int pdc_pci_irt_size(void *r_addr, void *hpa);
606int pdc_pci_irt(void *r_addr, void *hpa, void *tbl);
607
608int pdc_tod_read(struct pdc_tod *tod);
609int pdc_tod_set(unsigned long sec, unsigned long usec);
610
611
612
613
614
615
616
617#ifdef __LP64__
618# define mem_pdc_call(args...) real64_call(0L, ##args)
619#else
620# define mem_pdc_call(args...) real32_call(0L, ##args)
621#endif
622
623extern long real64_call(unsigned long function, ...);
624extern long real32_call(unsigned long function, ...);
625extern void pdc_init(void);
626
627#endif
628
629#endif
630