1 #ifndef _ASM_IA64_PAL_H
2 #define _ASM_IA64_PAL_H
5 * Processor Abstraction Layer definitions.
7 * This is based on Intel IA-64 Architecture Software Developer's Manual rev 1.0
8 * chapter 11 IA-64 Processor Abstraction Layer
10 * Copyright (C) 1998-2001 Hewlett-Packard Co
11 * David Mosberger-Tang <davidm@hpl.hp.com>
12 * Stephane Eranian <eranian@hpl.hp.com>
13 * Copyright (C) 1999 VA Linux Systems
14 * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
15 * Copyright (C) 1999 Srinivasa Prasad Thirumalachar <sprasad@sprasad.engr.sgi.com>
17 * 99/10/01 davidm Make sure we pass zero for reserved parameters.
18 * 00/03/07 davidm Updated pal_cache_flush() to be in sync with PAL v2.6.
19 * 00/03/23 cfleck Modified processor min-state save area to match updated PAL & SAL info
20 * 00/05/24 eranian Updated to latest PAL spec, fix structures bugs, added
21 * 00/05/25 eranian Support for stack calls, and static physical calls
22 * 00/06/18 eranian Support for stacked physical calls
23 * 06/10/26 rja Support for Intel Itanium Architecture Software Developer's
24 * Manual Rev 2.2 (Jan 2006)
28 * Note that some of these calls use a static-register only calling
29 * convention which has nothing to do with the regular calling
32 #define PAL_CACHE_FLUSH 1 /* flush i/d cache */
33 #define PAL_CACHE_INFO 2 /* get detailed i/d cache info */
34 #define PAL_CACHE_INIT 3 /* initialize i/d cache */
35 #define PAL_CACHE_SUMMARY 4 /* get summary of cache heirarchy */
36 #define PAL_MEM_ATTRIB 5 /* list supported memory attributes */
37 #define PAL_PTCE_INFO 6 /* purge TLB info */
38 #define PAL_VM_INFO 7 /* return supported virtual memory features */
39 #define PAL_VM_SUMMARY 8 /* return summary on supported vm features */
40 #define PAL_BUS_GET_FEATURES 9 /* return processor bus interface features settings */
41 #define PAL_BUS_SET_FEATURES 10 /* set processor bus features */
42 #define PAL_DEBUG_INFO 11 /* get number of debug registers */
43 #define PAL_FIXED_ADDR 12 /* get fixed component of processors's directed address */
44 #define PAL_FREQ_BASE 13 /* base frequency of the platform */
45 #define PAL_FREQ_RATIOS 14 /* ratio of processor, bus and ITC frequency */
46 #define PAL_PERF_MON_INFO 15 /* return performance monitor info */
47 #define PAL_PLATFORM_ADDR 16 /* set processor interrupt block and IO port space addr */
48 #define PAL_PROC_GET_FEATURES 17 /* get configurable processor features & settings */
49 #define PAL_PROC_SET_FEATURES 18 /* enable/disable configurable processor features */
50 #define PAL_RSE_INFO 19 /* return rse information */
51 #define PAL_VERSION 20 /* return version of PAL code */
52 #define PAL_MC_CLEAR_LOG 21 /* clear all processor log info */
53 #define PAL_MC_DRAIN 22 /* drain operations which could result in an MCA */
54 #define PAL_MC_EXPECTED 23 /* set/reset expected MCA indicator */
55 #define PAL_MC_DYNAMIC_STATE 24 /* get processor dynamic state */
56 #define PAL_MC_ERROR_INFO 25 /* get processor MCA info and static state */
57 #define PAL_MC_RESUME 26 /* Return to interrupted process */
58 #define PAL_MC_REGISTER_MEM 27 /* Register memory for PAL to use during MCAs and inits */
59 #define PAL_HALT 28 /* enter the low power HALT state */
60 #define PAL_HALT_LIGHT 29 /* enter the low power light halt state*/
61 #define PAL_COPY_INFO 30 /* returns info needed to relocate PAL */
62 #define PAL_CACHE_LINE_INIT 31 /* init tags & data of cache line */
63 #define PAL_PMI_ENTRYPOINT 32 /* register PMI memory entry points with the processor */
64 #define PAL_ENTER_IA_32_ENV 33 /* enter IA-32 system environment */
65 #define PAL_VM_PAGE_SIZE 34 /* return vm TC and page walker page sizes */
67 #define PAL_MEM_FOR_TEST 37 /* get amount of memory needed for late processor test */
68 #define PAL_CACHE_PROT_INFO 38 /* get i/d cache protection info */
69 #define PAL_REGISTER_INFO 39 /* return AR and CR register information*/
70 #define PAL_SHUTDOWN 40 /* enter processor shutdown state */
71 #define PAL_PREFETCH_VISIBILITY 41 /* Make Processor Prefetches Visible */
72 #define PAL_LOGICAL_TO_PHYSICAL 42 /* returns information on logical to physical processor mapping */
73 #define PAL_CACHE_SHARED_INFO 43 /* returns information on caches shared by logical processor */
74 #define PAL_GET_HW_POLICY 48 /* Get current hardware resource sharing policy */
75 #define PAL_SET_HW_POLICY 49 /* Set current hardware resource sharing policy */
77 #define PAL_COPY_PAL 256 /* relocate PAL procedures and PAL PMI */
78 #define PAL_HALT_INFO 257 /* return the low power capabilities of processor */
79 #define PAL_TEST_PROC 258 /* perform late processor self-test */
80 #define PAL_CACHE_READ 259 /* read tag & data of cacheline for diagnostic testing */
81 #define PAL_CACHE_WRITE 260 /* write tag & data of cacheline for diagnostic testing */
82 #define PAL_VM_TR_READ 261 /* read contents of translation register */
83 #define PAL_GET_PSTATE 262 /* get the current P-state */
84 #define PAL_SET_PSTATE 263 /* set the P-state */
85 #define PAL_BRAND_INFO 274 /* Processor branding information */
87 #define PAL_GET_PSTATE_TYPE_LASTSET 0
88 #define PAL_GET_PSTATE_TYPE_AVGANDRESET 1
89 #define PAL_GET_PSTATE_TYPE_AVGNORESET 2
90 #define PAL_GET_PSTATE_TYPE_INSTANT 3
92 #define PAL_MC_ERROR_INJECT 276 /* Injects processor error or returns injection capabilities */
96 #include <linux/types.h>
100 * Data types needed to pass information into PAL procedures and
101 * interpret information returned by them.
104 /* Return status from the PAL procedure */
105 typedef s64 pal_status_t;
107 #define PAL_STATUS_SUCCESS 0 /* No error */
108 #define PAL_STATUS_UNIMPLEMENTED (-1) /* Unimplemented procedure */
109 #define PAL_STATUS_EINVAL (-2) /* Invalid argument */
110 #define PAL_STATUS_ERROR (-3) /* Error */
111 #define PAL_STATUS_CACHE_INIT_FAIL (-4) /* Could not initialize the
112 * specified level and type of
113 * cache without sideeffects
114 * and "restrict" was 1
116 #define PAL_STATUS_REQUIRES_MEMORY (-9) /* Call requires PAL memory buffer */
118 /* Processor cache level in the heirarchy */
119 typedef u64 pal_cache_level_t;
120 #define PAL_CACHE_LEVEL_L0 0 /* L0 */
121 #define PAL_CACHE_LEVEL_L1 1 /* L1 */
122 #define PAL_CACHE_LEVEL_L2 2 /* L2 */
125 /* Processor cache type at a particular level in the heirarchy */
127 typedef u64 pal_cache_type_t;
128 #define PAL_CACHE_TYPE_INSTRUCTION 1 /* Instruction cache */
129 #define PAL_CACHE_TYPE_DATA 2 /* Data or unified cache */
130 #define PAL_CACHE_TYPE_INSTRUCTION_DATA 3 /* Both Data & Instruction */
133 #define PAL_CACHE_FLUSH_INVALIDATE 1 /* Invalidate clean lines */
134 #define PAL_CACHE_FLUSH_CHK_INTRS 2 /* check for interrupts/mc while flushing */
136 /* Processor cache line size in bytes */
137 typedef int pal_cache_line_size_t;
139 /* Processor cache line state */
140 typedef u64 pal_cache_line_state_t;
141 #define PAL_CACHE_LINE_STATE_INVALID 0 /* Invalid */
142 #define PAL_CACHE_LINE_STATE_SHARED 1 /* Shared */
143 #define PAL_CACHE_LINE_STATE_EXCLUSIVE 2 /* Exclusive */
144 #define PAL_CACHE_LINE_STATE_MODIFIED 3 /* Modified */
146 typedef struct pal_freq_ratio {
147 u32 den, num; /* numerator & denominator */
148 } itc_ratio, proc_ratio;
150 typedef union pal_cache_config_info_1_s {
152 u64 u : 1, /* 0 Unified cache ? */
153 at : 2, /* 2-1 Cache mem attr*/
154 reserved : 5, /* 7-3 Reserved */
155 associativity : 8, /* 16-8 Associativity*/
156 line_size : 8, /* 23-17 Line size */
157 stride : 8, /* 31-24 Stride */
158 store_latency : 8, /*39-32 Store latency*/
159 load_latency : 8, /* 47-40 Load latency*/
160 store_hints : 8, /* 55-48 Store hints*/
161 load_hints : 8; /* 63-56 Load hints */
164 } pal_cache_config_info_1_t;
166 typedef union pal_cache_config_info_2_s {
168 u32 cache_size; /*cache size in bytes*/
171 u32 alias_boundary : 8, /* 39-32 aliased addr
175 tag_ls_bit : 8, /* 47-40 LSb of addr*/
176 tag_ms_bit : 8, /* 55-48 MSb of addr*/
177 reserved : 8; /* 63-56 Reserved */
180 } pal_cache_config_info_2_t;
183 typedef struct pal_cache_config_info_s {
184 pal_status_t pcci_status;
185 pal_cache_config_info_1_t pcci_info_1;
186 pal_cache_config_info_2_t pcci_info_2;
188 } pal_cache_config_info_t;
190 #define pcci_ld_hints pcci_info_1.pcci1_bits.load_hints
191 #define pcci_st_hints pcci_info_1.pcci1_bits.store_hints
192 #define pcci_ld_latency pcci_info_1.pcci1_bits.load_latency
193 #define pcci_st_latency pcci_info_1.pcci1_bits.store_latency
194 #define pcci_stride pcci_info_1.pcci1_bits.stride
195 #define pcci_line_size pcci_info_1.pcci1_bits.line_size
196 #define pcci_assoc pcci_info_1.pcci1_bits.associativity
197 #define pcci_cache_attr pcci_info_1.pcci1_bits.at
198 #define pcci_unified pcci_info_1.pcci1_bits.u
199 #define pcci_tag_msb pcci_info_2.pcci2_bits.tag_ms_bit
200 #define pcci_tag_lsb pcci_info_2.pcci2_bits.tag_ls_bit
201 #define pcci_alias_boundary pcci_info_2.pcci2_bits.alias_boundary
202 #define pcci_cache_size pcci_info_2.pcci2_bits.cache_size
206 /* Possible values for cache attributes */
208 #define PAL_CACHE_ATTR_WT 0 /* Write through cache */
209 #define PAL_CACHE_ATTR_WB 1 /* Write back cache */
210 #define PAL_CACHE_ATTR_WT_OR_WB 2 /* Either write thru or write
211 * back depending on TLB
216 /* Possible values for cache hints */
218 #define PAL_CACHE_HINT_TEMP_1 0 /* Temporal level 1 */
219 #define PAL_CACHE_HINT_NTEMP_1 1 /* Non-temporal level 1 */
220 #define PAL_CACHE_HINT_NTEMP_ALL 3 /* Non-temporal all levels */
222 /* Processor cache protection information */
223 typedef union pal_cache_protection_element_u {
226 u32 data_bits : 8, /* # data bits covered by
227 * each unit of protection
230 tagprot_lsb : 6, /* Least -do- */
231 tagprot_msb : 6, /* Most Sig. tag address
235 prot_bits : 6, /* # of protection bits */
236 method : 4, /* Protection method */
237 t_d : 2; /* Indicates which part
239 * protection encoding
243 } pal_cache_protection_element_t;
245 #define pcpi_cache_prot_part pcp_info.t_d
246 #define pcpi_prot_method pcp_info.method
247 #define pcpi_prot_bits pcp_info.prot_bits
248 #define pcpi_tagprot_msb pcp_info.tagprot_msb
249 #define pcpi_tagprot_lsb pcp_info.tagprot_lsb
250 #define pcpi_data_bits pcp_info.data_bits
252 /* Processor cache part encodings */
253 #define PAL_CACHE_PROT_PART_DATA 0 /* Data protection */
254 #define PAL_CACHE_PROT_PART_TAG 1 /* Tag protection */
255 #define PAL_CACHE_PROT_PART_TAG_DATA 2 /* Tag+data protection (tag is
258 #define PAL_CACHE_PROT_PART_DATA_TAG 3 /* Data+tag protection (data is
261 #define PAL_CACHE_PROT_PART_MAX 6
264 typedef struct pal_cache_protection_info_s {
265 pal_status_t pcpi_status;
266 pal_cache_protection_element_t pcp_info[PAL_CACHE_PROT_PART_MAX];
267 } pal_cache_protection_info_t;
270 /* Processor cache protection method encodings */
271 #define PAL_CACHE_PROT_METHOD_NONE 0 /* No protection */
272 #define PAL_CACHE_PROT_METHOD_ODD_PARITY 1 /* Odd parity */
273 #define PAL_CACHE_PROT_METHOD_EVEN_PARITY 2 /* Even parity */
274 #define PAL_CACHE_PROT_METHOD_ECC 3 /* ECC protection */
277 /* Processor cache line identification in the heirarchy */
278 typedef union pal_cache_line_id_u {
281 u64 cache_type : 8, /* 7-0 cache type */
282 level : 8, /* 15-8 level of the
286 way : 8, /* 23-16 way in the set
288 part : 8, /* 31-24 part of the
291 reserved : 32; /* 63-32 is reserved*/
294 u64 cache_type : 8, /* 7-0 cache type */
295 level : 8, /* 15-8 level of the
299 way : 8, /* 23-16 way in the set
301 part : 8, /* 31-24 part of the
304 mesi : 8, /* 39-32 cache line
307 start : 8, /* 47-40 lsb of data to
310 length : 8, /* 55-48 #bits to
313 trigger : 8; /* 63-56 Trigger error
319 } pal_cache_line_id_u_t;
321 #define pclid_read_part pclid_info_read.part
322 #define pclid_read_way pclid_info_read.way
323 #define pclid_read_level pclid_info_read.level
324 #define pclid_read_cache_type pclid_info_read.cache_type
326 #define pclid_write_trigger pclid_info_write.trigger
327 #define pclid_write_length pclid_info_write.length
328 #define pclid_write_start pclid_info_write.start
329 #define pclid_write_mesi pclid_info_write.mesi
330 #define pclid_write_part pclid_info_write.part
331 #define pclid_write_way pclid_info_write.way
332 #define pclid_write_level pclid_info_write.level
333 #define pclid_write_cache_type pclid_info_write.cache_type
335 /* Processor cache line part encodings */
336 #define PAL_CACHE_LINE_ID_PART_DATA 0 /* Data */
337 #define PAL_CACHE_LINE_ID_PART_TAG 1 /* Tag */
338 #define PAL_CACHE_LINE_ID_PART_DATA_PROT 2 /* Data protection */
339 #define PAL_CACHE_LINE_ID_PART_TAG_PROT 3 /* Tag protection */
340 #define PAL_CACHE_LINE_ID_PART_DATA_TAG_PROT 4 /* Data+tag
343 typedef struct pal_cache_line_info_s {
344 pal_status_t pcli_status; /* Return status of the read cache line
347 u64 pcli_data; /* 64-bit data, tag, protection bits .. */
348 u64 pcli_data_len; /* data length in bits */
349 pal_cache_line_state_t pcli_cache_line_state; /* mesi state */
351 } pal_cache_line_info_t;
354 /* Machine Check related crap */
356 /* Pending event status bits */
357 typedef u64 pal_mc_pending_events_t;
359 #define PAL_MC_PENDING_MCA (1 << 0)
360 #define PAL_MC_PENDING_INIT (1 << 1)
362 /* Error information type */
363 typedef u64 pal_mc_info_index_t;
365 #define PAL_MC_INFO_PROCESSOR 0 /* Processor */
366 #define PAL_MC_INFO_CACHE_CHECK 1 /* Cache check */
367 #define PAL_MC_INFO_TLB_CHECK 2 /* Tlb check */
368 #define PAL_MC_INFO_BUS_CHECK 3 /* Bus check */
369 #define PAL_MC_INFO_REQ_ADDR 4 /* Requestor address */
370 #define PAL_MC_INFO_RESP_ADDR 5 /* Responder address */
371 #define PAL_MC_INFO_TARGET_ADDR 6 /* Target address */
372 #define PAL_MC_INFO_IMPL_DEP 7 /* Implementation
377 typedef struct pal_process_state_info_s {
379 rz : 1, /* PAL_CHECK processor
384 ra : 1, /* PAL_CHECK attempted
387 me : 1, /* Distinct multiple
391 mn : 1, /* Min. state save
393 * registered with PAL
396 sy : 1, /* Storage integrity
401 co : 1, /* Continuable */
402 ci : 1, /* MC isolated */
403 us : 1, /* Uncontained storage
408 hd : 1, /* Non-essential hw
412 * processor to run in
416 tl : 1, /* 1 => MC occurred
418 * executed but before
420 * resulted from instr
425 mi : 1, /* More information available
426 * call PAL_MC_ERROR_INFO
428 pi : 1, /* Precise instruction pointer */
429 pm : 1, /* Precise min-state save area */
431 dy : 1, /* Processor dynamic
436 in : 1, /* 0 = MC, 1 = INIT */
437 rs : 1, /* RSE valid */
438 cm : 1, /* MC corrected */
439 ex : 1, /* MC is expected */
440 cr : 1, /* Control regs valid*/
441 pc : 1, /* Perf cntrs valid */
442 dr : 1, /* Debug regs valid */
443 tr : 1, /* Translation regs
446 rr : 1, /* Region regs valid */
447 ar : 1, /* App regs valid */
448 br : 1, /* Branch regs valid */
449 pr : 1, /* Predicate registers
453 fp : 1, /* fp registers valid*/
454 b1 : 1, /* Preserved bank one
458 b0 : 1, /* Preserved bank zero
462 gr : 1, /* General registers
464 * (excl. banked regs)
466 dsize : 16, /* size of dynamic
471 se : 1, /* Shared error. MCA in a
474 cc : 1, /* Cache check */
475 tc : 1, /* TLB check */
476 bc : 1, /* Bus check */
477 rc : 1, /* Register file check */
478 uc : 1; /* Uarch check */
480 } pal_processor_state_info_t;
482 typedef struct pal_cache_check_info_s {
483 u64 op : 4, /* Type of cache
488 level : 2, /* Cache level */
490 dl : 1, /* Failure in data part
493 tl : 1, /* Failure in tag part
496 dc : 1, /* Failure in dcache */
497 ic : 1, /* Failure in icache */
498 mesi : 3, /* Cache line state */
499 mv : 1, /* mesi valid */
500 way : 5, /* Way in which the
503 wiv : 1, /* Way field valid */
505 dp : 1, /* Data poisoned on MBE */
508 index : 20, /* Cache line index */
511 is : 1, /* instruction set (1 == ia32) */
512 iv : 1, /* instruction set field valid */
513 pl : 2, /* privilege level */
514 pv : 1, /* privilege level field valid */
515 mcc : 1, /* Machine check corrected */
516 tv : 1, /* Target address
519 rq : 1, /* Requester identifier
522 rp : 1, /* Responder identifier
525 pi : 1; /* Precise instruction pointer
528 } pal_cache_check_info_t;
530 typedef struct pal_tlb_check_info_s {
532 u64 tr_slot : 8, /* Slot# of TR where
535 trv : 1, /* tr_slot field is valid */
537 level : 2, /* TLB level where failure occurred */
539 dtr : 1, /* Fail in data TR */
540 itr : 1, /* Fail in inst TR */
541 dtc : 1, /* Fail in data TC */
542 itc : 1, /* Fail in inst. TC */
543 op : 4, /* Cache operation */
546 is : 1, /* instruction set (1 == ia32) */
547 iv : 1, /* instruction set field valid */
548 pl : 2, /* privilege level */
549 pv : 1, /* privilege level field valid */
550 mcc : 1, /* Machine check corrected */
551 tv : 1, /* Target address
554 rq : 1, /* Requester identifier
557 rp : 1, /* Responder identifier
560 pi : 1; /* Precise instruction pointer
563 } pal_tlb_check_info_t;
565 typedef struct pal_bus_check_info_s {
566 u64 size : 5, /* Xaction size */
567 ib : 1, /* Internal bus error */
568 eb : 1, /* External bus error */
569 cc : 1, /* Error occurred
573 type : 8, /* Bus xaction type*/
574 sev : 5, /* Bus error severity*/
575 hier : 2, /* Bus hierarchy level */
576 dp : 1, /* Data poisoned on MBE */
577 bsi : 8, /* Bus error status
582 is : 1, /* instruction set (1 == ia32) */
583 iv : 1, /* instruction set field valid */
584 pl : 2, /* privilege level */
585 pv : 1, /* privilege level field valid */
586 mcc : 1, /* Machine check corrected */
587 tv : 1, /* Target address
590 rq : 1, /* Requester identifier
593 rp : 1, /* Responder identifier
596 pi : 1; /* Precise instruction pointer
599 } pal_bus_check_info_t;
601 typedef struct pal_reg_file_check_info_s {
602 u64 id : 4, /* Register file identifier */
603 op : 4, /* Type of register
608 reg_num : 7, /* Register number */
609 rnv : 1, /* reg_num valid */
612 is : 1, /* instruction set (1 == ia32) */
613 iv : 1, /* instruction set field valid */
614 pl : 2, /* privilege level */
615 pv : 1, /* privilege level field valid */
616 mcc : 1, /* Machine check corrected */
618 pi : 1; /* Precise instruction pointer
621 } pal_reg_file_check_info_t;
623 typedef struct pal_uarch_check_info_s {
624 u64 sid : 5, /* Structure identification */
625 level : 3, /* Level of failure */
626 array_id : 4, /* Array identification */
632 way : 6, /* Way of structure */
633 wv : 1, /* way valid */
634 xv : 1, /* index valid */
636 index : 8, /* Index or set of the uarch
637 * structure that failed.
641 is : 1, /* instruction set (1 == ia32) */
642 iv : 1, /* instruction set field valid */
643 pl : 2, /* privilege level */
644 pv : 1, /* privilege level field valid */
645 mcc : 1, /* Machine check corrected */
646 tv : 1, /* Target address
649 rq : 1, /* Requester identifier
652 rp : 1, /* Responder identifier
655 pi : 1; /* Precise instruction pointer
658 } pal_uarch_check_info_t;
660 typedef union pal_mc_error_info_u {
662 pal_processor_state_info_t pme_processor;
663 pal_cache_check_info_t pme_cache;
664 pal_tlb_check_info_t pme_tlb;
665 pal_bus_check_info_t pme_bus;
666 pal_reg_file_check_info_t pme_reg_file;
667 pal_uarch_check_info_t pme_uarch;
668 } pal_mc_error_info_t;
670 #define pmci_proc_unknown_check pme_processor.uc
671 #define pmci_proc_bus_check pme_processor.bc
672 #define pmci_proc_tlb_check pme_processor.tc
673 #define pmci_proc_cache_check pme_processor.cc
674 #define pmci_proc_dynamic_state_size pme_processor.dsize
675 #define pmci_proc_gpr_valid pme_processor.gr
676 #define pmci_proc_preserved_bank0_gpr_valid pme_processor.b0
677 #define pmci_proc_preserved_bank1_gpr_valid pme_processor.b1
678 #define pmci_proc_fp_valid pme_processor.fp
679 #define pmci_proc_predicate_regs_valid pme_processor.pr
680 #define pmci_proc_branch_regs_valid pme_processor.br
681 #define pmci_proc_app_regs_valid pme_processor.ar
682 #define pmci_proc_region_regs_valid pme_processor.rr
683 #define pmci_proc_translation_regs_valid pme_processor.tr
684 #define pmci_proc_debug_regs_valid pme_processor.dr
685 #define pmci_proc_perf_counters_valid pme_processor.pc
686 #define pmci_proc_control_regs_valid pme_processor.cr
687 #define pmci_proc_machine_check_expected pme_processor.ex
688 #define pmci_proc_machine_check_corrected pme_processor.cm
689 #define pmci_proc_rse_valid pme_processor.rs
690 #define pmci_proc_machine_check_or_init pme_processor.in
691 #define pmci_proc_dynamic_state_valid pme_processor.dy
692 #define pmci_proc_operation pme_processor.op
693 #define pmci_proc_trap_lost pme_processor.tl
694 #define pmci_proc_hardware_damage pme_processor.hd
695 #define pmci_proc_uncontained_storage_damage pme_processor.us
696 #define pmci_proc_machine_check_isolated pme_processor.ci
697 #define pmci_proc_continuable pme_processor.co
698 #define pmci_proc_storage_intergrity_synced pme_processor.sy
699 #define pmci_proc_min_state_save_area_regd pme_processor.mn
700 #define pmci_proc_distinct_multiple_errors pme_processor.me
701 #define pmci_proc_pal_attempted_rendezvous pme_processor.ra
702 #define pmci_proc_pal_rendezvous_complete pme_processor.rz
705 #define pmci_cache_level pme_cache.level
706 #define pmci_cache_line_state pme_cache.mesi
707 #define pmci_cache_line_state_valid pme_cache.mv
708 #define pmci_cache_line_index pme_cache.index
709 #define pmci_cache_instr_cache_fail pme_cache.ic
710 #define pmci_cache_data_cache_fail pme_cache.dc
711 #define pmci_cache_line_tag_fail pme_cache.tl
712 #define pmci_cache_line_data_fail pme_cache.dl
713 #define pmci_cache_operation pme_cache.op
714 #define pmci_cache_way_valid pme_cache.wv
715 #define pmci_cache_target_address_valid pme_cache.tv
716 #define pmci_cache_way pme_cache.way
717 #define pmci_cache_mc pme_cache.mc
719 #define pmci_tlb_instr_translation_cache_fail pme_tlb.itc
720 #define pmci_tlb_data_translation_cache_fail pme_tlb.dtc
721 #define pmci_tlb_instr_translation_reg_fail pme_tlb.itr
722 #define pmci_tlb_data_translation_reg_fail pme_tlb.dtr
723 #define pmci_tlb_translation_reg_slot pme_tlb.tr_slot
724 #define pmci_tlb_mc pme_tlb.mc
726 #define pmci_bus_status_info pme_bus.bsi
727 #define pmci_bus_req_address_valid pme_bus.rq
728 #define pmci_bus_resp_address_valid pme_bus.rp
729 #define pmci_bus_target_address_valid pme_bus.tv
730 #define pmci_bus_error_severity pme_bus.sev
731 #define pmci_bus_transaction_type pme_bus.type
732 #define pmci_bus_cache_cache_transfer pme_bus.cc
733 #define pmci_bus_transaction_size pme_bus.size
734 #define pmci_bus_internal_error pme_bus.ib
735 #define pmci_bus_external_error pme_bus.eb
736 #define pmci_bus_mc pme_bus.mc
739 * NOTE: this min_state_save area struct only includes the 1KB
740 * architectural state save area. The other 3 KB is scratch space
744 typedef struct pal_min_state_area_s {
745 u64 pmsa_nat_bits; /* nat bits for saved GRs */
746 u64 pmsa_gr[15]; /* GR1 - GR15 */
747 u64 pmsa_bank0_gr[16]; /* GR16 - GR31 */
748 u64 pmsa_bank1_gr[16]; /* GR16 - GR31 */
749 u64 pmsa_pr; /* predicate registers */
750 u64 pmsa_br0; /* branch register 0 */
751 u64 pmsa_rsc; /* ar.rsc */
752 u64 pmsa_iip; /* cr.iip */
753 u64 pmsa_ipsr; /* cr.ipsr */
754 u64 pmsa_ifs; /* cr.ifs */
755 u64 pmsa_xip; /* previous iip */
756 u64 pmsa_xpsr; /* previous psr */
757 u64 pmsa_xfs; /* previous ifs */
758 u64 pmsa_br1; /* branch register 1 */
759 u64 pmsa_reserved[70]; /* pal_min_state_area should total to 1KB */
760 } pal_min_state_area_t;
763 struct ia64_pal_retval {
765 * A zero status value indicates call completed without error.
766 * A negative status value indicates reason of call failure.
767 * A positive status value indicates success but an
768 * informational value should be printed (e.g., "reboot for
769 * change to take effect").
778 * Note: Currently unused PAL arguments are generally labeled
779 * "reserved" so the value specified in the PAL documentation
780 * (generally 0) MUST be passed. Reserved parameters are not optional
783 extern struct ia64_pal_retval ia64_pal_call_static (u64, u64, u64, u64);
784 extern struct ia64_pal_retval ia64_pal_call_stacked (u64, u64, u64, u64);
785 extern struct ia64_pal_retval ia64_pal_call_phys_static (u64, u64, u64, u64);
786 extern struct ia64_pal_retval ia64_pal_call_phys_stacked (u64, u64, u64, u64);
787 extern void ia64_save_scratch_fpregs (struct ia64_fpreg *);
788 extern void ia64_load_scratch_fpregs (struct ia64_fpreg *);
790 #define PAL_CALL(iprv,a0,a1,a2,a3) do { \
791 struct ia64_fpreg fr[6]; \
792 ia64_save_scratch_fpregs(fr); \
793 iprv = ia64_pal_call_static(a0, a1, a2, a3); \
794 ia64_load_scratch_fpregs(fr); \
797 #define PAL_CALL_STK(iprv,a0,a1,a2,a3) do { \
798 struct ia64_fpreg fr[6]; \
799 ia64_save_scratch_fpregs(fr); \
800 iprv = ia64_pal_call_stacked(a0, a1, a2, a3); \
801 ia64_load_scratch_fpregs(fr); \
804 #define PAL_CALL_PHYS(iprv,a0,a1,a2,a3) do { \
805 struct ia64_fpreg fr[6]; \
806 ia64_save_scratch_fpregs(fr); \
807 iprv = ia64_pal_call_phys_static(a0, a1, a2, a3); \
808 ia64_load_scratch_fpregs(fr); \
811 #define PAL_CALL_PHYS_STK(iprv,a0,a1,a2,a3) do { \
812 struct ia64_fpreg fr[6]; \
813 ia64_save_scratch_fpregs(fr); \
814 iprv = ia64_pal_call_phys_stacked(a0, a1, a2, a3); \
815 ia64_load_scratch_fpregs(fr); \
818 typedef int (*ia64_pal_handler) (u64, ...);
819 extern ia64_pal_handler ia64_pal;
820 extern void ia64_pal_handler_init (void *);
822 extern ia64_pal_handler ia64_pal;
824 extern pal_cache_config_info_t l0d_cache_config_info;
825 extern pal_cache_config_info_t l0i_cache_config_info;
826 extern pal_cache_config_info_t l1_cache_config_info;
827 extern pal_cache_config_info_t l2_cache_config_info;
829 extern pal_cache_protection_info_t l0d_cache_protection_info;
830 extern pal_cache_protection_info_t l0i_cache_protection_info;
831 extern pal_cache_protection_info_t l1_cache_protection_info;
832 extern pal_cache_protection_info_t l2_cache_protection_info;
834 extern pal_cache_config_info_t pal_cache_config_info_get(pal_cache_level_t,
837 extern pal_cache_protection_info_t pal_cache_protection_info_get(pal_cache_level_t,
841 extern void pal_error(int);
844 /* Useful wrappers for the current list of pal procedures */
846 typedef union pal_bus_features_u {
847 u64 pal_bus_features_val;
849 u64 pbf_reserved1 : 29;
850 u64 pbf_req_bus_parking : 1;
851 u64 pbf_bus_lock_mask : 1;
852 u64 pbf_enable_half_xfer_rate : 1;
853 u64 pbf_reserved2 : 20;
854 u64 pbf_enable_shared_line_replace : 1;
855 u64 pbf_enable_exclusive_line_replace : 1;
856 u64 pbf_disable_xaction_queueing : 1;
857 u64 pbf_disable_resp_err_check : 1;
858 u64 pbf_disable_berr_check : 1;
859 u64 pbf_disable_bus_req_internal_err_signal : 1;
860 u64 pbf_disable_bus_req_berr_signal : 1;
861 u64 pbf_disable_bus_init_event_check : 1;
862 u64 pbf_disable_bus_init_event_signal : 1;
863 u64 pbf_disable_bus_addr_err_check : 1;
864 u64 pbf_disable_bus_addr_err_signal : 1;
865 u64 pbf_disable_bus_data_err_check : 1;
866 } pal_bus_features_s;
867 } pal_bus_features_u_t;
869 extern void pal_bus_features_print (u64);
871 /* Provide information about configurable processor bus features */
873 ia64_pal_bus_get_features (pal_bus_features_u_t *features_avail,
874 pal_bus_features_u_t *features_status,
875 pal_bus_features_u_t *features_control)
877 struct ia64_pal_retval iprv;
878 PAL_CALL_PHYS(iprv, PAL_BUS_GET_FEATURES, 0, 0, 0);
880 features_avail->pal_bus_features_val = iprv.v0;
882 features_status->pal_bus_features_val = iprv.v1;
883 if (features_control)
884 features_control->pal_bus_features_val = iprv.v2;
888 /* Enables/disables specific processor bus features */
890 ia64_pal_bus_set_features (pal_bus_features_u_t feature_select)
892 struct ia64_pal_retval iprv;
893 PAL_CALL_PHYS(iprv, PAL_BUS_SET_FEATURES, feature_select.pal_bus_features_val, 0, 0);
897 /* Get detailed cache information */
899 ia64_pal_cache_config_info (u64 cache_level, u64 cache_type, pal_cache_config_info_t *conf)
901 struct ia64_pal_retval iprv;
903 PAL_CALL(iprv, PAL_CACHE_INFO, cache_level, cache_type, 0);
905 if (iprv.status == 0) {
906 conf->pcci_status = iprv.status;
907 conf->pcci_info_1.pcci1_data = iprv.v0;
908 conf->pcci_info_2.pcci2_data = iprv.v1;
909 conf->pcci_reserved = iprv.v2;
915 /* Get detailed cche protection information */
917 ia64_pal_cache_prot_info (u64 cache_level, u64 cache_type, pal_cache_protection_info_t *prot)
919 struct ia64_pal_retval iprv;
921 PAL_CALL(iprv, PAL_CACHE_PROT_INFO, cache_level, cache_type, 0);
923 if (iprv.status == 0) {
924 prot->pcpi_status = iprv.status;
925 prot->pcp_info[0].pcpi_data = iprv.v0 & 0xffffffff;
926 prot->pcp_info[1].pcpi_data = iprv.v0 >> 32;
927 prot->pcp_info[2].pcpi_data = iprv.v1 & 0xffffffff;
928 prot->pcp_info[3].pcpi_data = iprv.v1 >> 32;
929 prot->pcp_info[4].pcpi_data = iprv.v2 & 0xffffffff;
930 prot->pcp_info[5].pcpi_data = iprv.v2 >> 32;
936 * Flush the processor instruction or data caches. *PROGRESS must be
937 * initialized to zero before calling this for the first time..
940 ia64_pal_cache_flush (u64 cache_type, u64 invalidate, u64 *progress, u64 *vector)
942 struct ia64_pal_retval iprv;
943 PAL_CALL(iprv, PAL_CACHE_FLUSH, cache_type, invalidate, *progress);
951 /* Initialize the processor controlled caches */
953 ia64_pal_cache_init (u64 level, u64 cache_type, u64 rest)
955 struct ia64_pal_retval iprv;
956 PAL_CALL(iprv, PAL_CACHE_INIT, level, cache_type, rest);
960 /* Initialize the tags and data of a data or unified cache line of
961 * processor controlled cache to known values without the availability
965 ia64_pal_cache_line_init (u64 physical_addr, u64 data_value)
967 struct ia64_pal_retval iprv;
968 PAL_CALL(iprv, PAL_CACHE_LINE_INIT, physical_addr, data_value, 0);
973 /* Read the data and tag of a processor controlled cache line for diags */
975 ia64_pal_cache_read (pal_cache_line_id_u_t line_id, u64 physical_addr)
977 struct ia64_pal_retval iprv;
978 PAL_CALL_PHYS_STK(iprv, PAL_CACHE_READ, line_id.pclid_data,
983 /* Return summary information about the heirarchy of caches controlled by the processor */
985 ia64_pal_cache_summary (u64 *cache_levels, u64 *unique_caches)
987 struct ia64_pal_retval iprv;
988 PAL_CALL(iprv, PAL_CACHE_SUMMARY, 0, 0, 0);
990 *cache_levels = iprv.v0;
992 *unique_caches = iprv.v1;
996 /* Write the data and tag of a processor-controlled cache line for diags */
998 ia64_pal_cache_write (pal_cache_line_id_u_t line_id, u64 physical_addr, u64 data)
1000 struct ia64_pal_retval iprv;
1001 PAL_CALL_PHYS_STK(iprv, PAL_CACHE_WRITE, line_id.pclid_data,
1002 physical_addr, data);
1007 /* Return the parameters needed to copy relocatable PAL procedures from ROM to memory */
1009 ia64_pal_copy_info (u64 copy_type, u64 num_procs, u64 num_iopics,
1010 u64 *buffer_size, u64 *buffer_align)
1012 struct ia64_pal_retval iprv;
1013 PAL_CALL(iprv, PAL_COPY_INFO, copy_type, num_procs, num_iopics);
1015 *buffer_size = iprv.v0;
1017 *buffer_align = iprv.v1;
1021 /* Copy relocatable PAL procedures from ROM to memory */
1023 ia64_pal_copy_pal (u64 target_addr, u64 alloc_size, u64 processor, u64 *pal_proc_offset)
1025 struct ia64_pal_retval iprv;
1026 PAL_CALL(iprv, PAL_COPY_PAL, target_addr, alloc_size, processor);
1027 if (pal_proc_offset)
1028 *pal_proc_offset = iprv.v0;
1032 /* Return the number of instruction and data debug register pairs */
1034 ia64_pal_debug_info (u64 *inst_regs, u64 *data_regs)
1036 struct ia64_pal_retval iprv;
1037 PAL_CALL(iprv, PAL_DEBUG_INFO, 0, 0, 0);
1039 *inst_regs = iprv.v0;
1041 *data_regs = iprv.v1;
1047 /* Switch from IA64-system environment to IA-32 system environment */
1049 ia64_pal_enter_ia32_env (ia32_env1, ia32_env2, ia32_env3)
1051 struct ia64_pal_retval iprv;
1052 PAL_CALL(iprv, PAL_ENTER_IA_32_ENV, ia32_env1, ia32_env2, ia32_env3);
1057 /* Get unique geographical address of this processor on its bus */
1059 ia64_pal_fixed_addr (u64 *global_unique_addr)
1061 struct ia64_pal_retval iprv;
1062 PAL_CALL(iprv, PAL_FIXED_ADDR, 0, 0, 0);
1063 if (global_unique_addr)
1064 *global_unique_addr = iprv.v0;
1068 /* Get base frequency of the platform if generated by the processor */
1070 ia64_pal_freq_base (u64 *platform_base_freq)
1072 struct ia64_pal_retval iprv;
1073 PAL_CALL(iprv, PAL_FREQ_BASE, 0, 0, 0);
1074 if (platform_base_freq)
1075 *platform_base_freq = iprv.v0;
1080 * Get the ratios for processor frequency, bus frequency and interval timer to
1081 * to base frequency of the platform
1084 ia64_pal_freq_ratios (struct pal_freq_ratio *proc_ratio, struct pal_freq_ratio *bus_ratio,
1085 struct pal_freq_ratio *itc_ratio)
1087 struct ia64_pal_retval iprv;
1088 PAL_CALL(iprv, PAL_FREQ_RATIOS, 0, 0, 0);
1090 *(u64 *)proc_ratio = iprv.v0;
1092 *(u64 *)bus_ratio = iprv.v1;
1094 *(u64 *)itc_ratio = iprv.v2;
1099 * Get the current hardware resource sharing policy of the processor
1102 ia64_pal_get_hw_policy (u64 proc_num, u64 *cur_policy, u64 *num_impacted,
1105 struct ia64_pal_retval iprv;
1106 PAL_CALL(iprv, PAL_GET_HW_POLICY, proc_num, 0, 0);
1108 *cur_policy = iprv.v0;
1110 *num_impacted = iprv.v1;
1116 /* Make the processor enter HALT or one of the implementation dependent low
1117 * power states where prefetching and execution are suspended and cache and
1118 * TLB coherency is not maintained.
1121 ia64_pal_halt (u64 halt_state)
1123 struct ia64_pal_retval iprv;
1124 PAL_CALL(iprv, PAL_HALT, halt_state, 0, 0);
1128 typedef union pal_power_mgmt_info_u {
1131 u64 exit_latency : 16,
1133 power_consumption : 28,
1137 } pal_power_mgmt_info_s;
1138 } pal_power_mgmt_info_u_t;
1140 /* Return information about processor's optional power management capabilities. */
1142 ia64_pal_halt_info (pal_power_mgmt_info_u_t *power_buf)
1144 struct ia64_pal_retval iprv;
1145 PAL_CALL_STK(iprv, PAL_HALT_INFO, (unsigned long) power_buf, 0, 0);
1149 /* Get the current P-state information */
1151 ia64_pal_get_pstate (u64 *pstate_index, unsigned long type)
1153 struct ia64_pal_retval iprv;
1154 PAL_CALL_STK(iprv, PAL_GET_PSTATE, type, 0, 0);
1155 *pstate_index = iprv.v0;
1159 /* Set the P-state */
1161 ia64_pal_set_pstate (u64 pstate_index)
1163 struct ia64_pal_retval iprv;
1164 PAL_CALL_STK(iprv, PAL_SET_PSTATE, pstate_index, 0, 0);
1168 /* Processor branding information*/
1170 ia64_pal_get_brand_info (char *brand_info)
1172 struct ia64_pal_retval iprv;
1173 PAL_CALL_STK(iprv, PAL_BRAND_INFO, 0, (u64)brand_info, 0);
1177 /* Cause the processor to enter LIGHT HALT state, where prefetching and execution are
1178 * suspended, but cache and TLB coherency is maintained.
1181 ia64_pal_halt_light (void)
1183 struct ia64_pal_retval iprv;
1184 PAL_CALL(iprv, PAL_HALT_LIGHT, 0, 0, 0);
1188 /* Clear all the processor error logging registers and reset the indicator that allows
1189 * the error logging registers to be written. This procedure also checks the pending
1190 * machine check bit and pending INIT bit and reports their states.
1193 ia64_pal_mc_clear_log (u64 *pending_vector)
1195 struct ia64_pal_retval iprv;
1196 PAL_CALL(iprv, PAL_MC_CLEAR_LOG, 0, 0, 0);
1198 *pending_vector = iprv.v0;
1202 /* Ensure that all outstanding transactions in a processor are completed or that any
1203 * MCA due to thes outstanding transaction is taken.
1206 ia64_pal_mc_drain (void)
1208 struct ia64_pal_retval iprv;
1209 PAL_CALL(iprv, PAL_MC_DRAIN, 0, 0, 0);
1213 /* Return the machine check dynamic processor state */
1215 ia64_pal_mc_dynamic_state (u64 offset, u64 *size, u64 *pds)
1217 struct ia64_pal_retval iprv;
1218 PAL_CALL(iprv, PAL_MC_DYNAMIC_STATE, offset, 0, 0);
1226 /* Return processor machine check information */
1228 ia64_pal_mc_error_info (u64 info_index, u64 type_index, u64 *size, u64 *error_info)
1230 struct ia64_pal_retval iprv;
1231 PAL_CALL(iprv, PAL_MC_ERROR_INFO, info_index, type_index, 0);
1235 *error_info = iprv.v1;
1239 /* Injects the requested processor error or returns info on
1240 * supported injection capabilities for current processor implementation
1243 ia64_pal_mc_error_inject_phys (u64 err_type_info, u64 err_struct_info,
1244 u64 err_data_buffer, u64 *capabilities, u64 *resources)
1246 struct ia64_pal_retval iprv;
1247 PAL_CALL_PHYS_STK(iprv, PAL_MC_ERROR_INJECT, err_type_info,
1248 err_struct_info, err_data_buffer);
1250 *capabilities= iprv.v0;
1252 *resources= iprv.v1;
1257 ia64_pal_mc_error_inject_virt (u64 err_type_info, u64 err_struct_info,
1258 u64 err_data_buffer, u64 *capabilities, u64 *resources)
1260 struct ia64_pal_retval iprv;
1261 PAL_CALL_STK(iprv, PAL_MC_ERROR_INJECT, err_type_info,
1262 err_struct_info, err_data_buffer);
1264 *capabilities= iprv.v0;
1266 *resources= iprv.v1;
1270 /* Inform PALE_CHECK whether a machine check is expected so that PALE_CHECK willnot
1271 * attempt to correct any expected machine checks.
1274 ia64_pal_mc_expected (u64 expected, u64 *previous)
1276 struct ia64_pal_retval iprv;
1277 PAL_CALL(iprv, PAL_MC_EXPECTED, expected, 0, 0);
1279 *previous = iprv.v0;
1283 /* Register a platform dependent location with PAL to which it can save
1284 * minimal processor state in the event of a machine check or initialization
1288 ia64_pal_mc_register_mem (u64 physical_addr)
1290 struct ia64_pal_retval iprv;
1291 PAL_CALL(iprv, PAL_MC_REGISTER_MEM, physical_addr, 0, 0);
1295 /* Restore minimal architectural processor state, set CMC interrupt if necessary
1296 * and resume execution
1299 ia64_pal_mc_resume (u64 set_cmci, u64 save_ptr)
1301 struct ia64_pal_retval iprv;
1302 PAL_CALL(iprv, PAL_MC_RESUME, set_cmci, save_ptr, 0);
1306 /* Return the memory attributes implemented by the processor */
1308 ia64_pal_mem_attrib (u64 *mem_attrib)
1310 struct ia64_pal_retval iprv;
1311 PAL_CALL(iprv, PAL_MEM_ATTRIB, 0, 0, 0);
1313 *mem_attrib = iprv.v0 & 0xff;
1317 /* Return the amount of memory needed for second phase of processor
1318 * self-test and the required alignment of memory.
1321 ia64_pal_mem_for_test (u64 *bytes_needed, u64 *alignment)
1323 struct ia64_pal_retval iprv;
1324 PAL_CALL(iprv, PAL_MEM_FOR_TEST, 0, 0, 0);
1326 *bytes_needed = iprv.v0;
1328 *alignment = iprv.v1;
1332 typedef union pal_perf_mon_info_u {
1340 } pal_perf_mon_info_s;
1341 } pal_perf_mon_info_u_t;
1343 /* Return the performance monitor information about what can be counted
1344 * and how to configure the monitors to count the desired events.
1347 ia64_pal_perf_mon_info (u64 *pm_buffer, pal_perf_mon_info_u_t *pm_info)
1349 struct ia64_pal_retval iprv;
1350 PAL_CALL(iprv, PAL_PERF_MON_INFO, (unsigned long) pm_buffer, 0, 0);
1352 pm_info->ppmi_data = iprv.v0;
1356 /* Specifies the physical address of the processor interrupt block
1357 * and I/O port space.
1360 ia64_pal_platform_addr (u64 type, u64 physical_addr)
1362 struct ia64_pal_retval iprv;
1363 PAL_CALL(iprv, PAL_PLATFORM_ADDR, type, physical_addr, 0);
1367 /* Set the SAL PMI entrypoint in memory */
1369 ia64_pal_pmi_entrypoint (u64 sal_pmi_entry_addr)
1371 struct ia64_pal_retval iprv;
1372 PAL_CALL(iprv, PAL_PMI_ENTRYPOINT, sal_pmi_entry_addr, 0, 0);
1376 struct pal_features_s;
1377 /* Provide information about configurable processor features */
1379 ia64_pal_proc_get_features (u64 *features_avail,
1380 u64 *features_status,
1381 u64 *features_control)
1383 struct ia64_pal_retval iprv;
1384 PAL_CALL_PHYS(iprv, PAL_PROC_GET_FEATURES, 0, 0, 0);
1385 if (iprv.status == 0) {
1386 *features_avail = iprv.v0;
1387 *features_status = iprv.v1;
1388 *features_control = iprv.v2;
1393 /* Enable/disable processor dependent features */
1395 ia64_pal_proc_set_features (u64 feature_select)
1397 struct ia64_pal_retval iprv;
1398 PAL_CALL_PHYS(iprv, PAL_PROC_SET_FEATURES, feature_select, 0, 0);
1403 * Put everything in a struct so we avoid the global offset table whenever
1406 typedef struct ia64_ptce_info_s {
1412 /* Return the information required for the architected loop used to purge
1413 * (initialize) the entire TC
1416 ia64_get_ptce (ia64_ptce_info_t *ptce)
1418 struct ia64_pal_retval iprv;
1423 PAL_CALL(iprv, PAL_PTCE_INFO, 0, 0, 0);
1424 if (iprv.status == 0) {
1425 ptce->base = iprv.v0;
1426 ptce->count[0] = iprv.v1 >> 32;
1427 ptce->count[1] = iprv.v1 & 0xffffffff;
1428 ptce->stride[0] = iprv.v2 >> 32;
1429 ptce->stride[1] = iprv.v2 & 0xffffffff;
1434 /* Return info about implemented application and control registers. */
1436 ia64_pal_register_info (u64 info_request, u64 *reg_info_1, u64 *reg_info_2)
1438 struct ia64_pal_retval iprv;
1439 PAL_CALL(iprv, PAL_REGISTER_INFO, info_request, 0, 0);
1441 *reg_info_1 = iprv.v0;
1443 *reg_info_2 = iprv.v1;
1447 typedef union pal_hints_u {
1456 /* Return information about the register stack and RSE for this processor
1460 ia64_pal_rse_info (u64 *num_phys_stacked, pal_hints_u_t *hints)
1462 struct ia64_pal_retval iprv;
1463 PAL_CALL(iprv, PAL_RSE_INFO, 0, 0, 0);
1464 if (num_phys_stacked)
1465 *num_phys_stacked = iprv.v0;
1467 hints->ph_data = iprv.v1;
1472 * Set the current hardware resource sharing policy of the processor
1475 ia64_pal_set_hw_policy (u64 policy)
1477 struct ia64_pal_retval iprv;
1478 PAL_CALL(iprv, PAL_SET_HW_POLICY, policy, 0, 0);
1482 /* Cause the processor to enter SHUTDOWN state, where prefetching and execution are
1483 * suspended, but cause cache and TLB coherency to be maintained.
1484 * This is usually called in IA-32 mode.
1487 ia64_pal_shutdown (void)
1489 struct ia64_pal_retval iprv;
1490 PAL_CALL(iprv, PAL_SHUTDOWN, 0, 0, 0);
1494 /* Perform the second phase of processor self-test. */
1496 ia64_pal_test_proc (u64 test_addr, u64 test_size, u64 attributes, u64 *self_test_state)
1498 struct ia64_pal_retval iprv;
1499 PAL_CALL(iprv, PAL_TEST_PROC, test_addr, test_size, attributes);
1500 if (self_test_state)
1501 *self_test_state = iprv.v0;
1505 typedef union pal_version_u {
1506 u64 pal_version_val;
1508 u64 pv_pal_b_rev : 8;
1509 u64 pv_pal_b_model : 8;
1510 u64 pv_reserved1 : 8;
1511 u64 pv_pal_vendor : 8;
1512 u64 pv_pal_a_rev : 8;
1513 u64 pv_pal_a_model : 8;
1514 u64 pv_reserved2 : 16;
1520 * Return PAL version information. While the documentation states that
1521 * PAL_VERSION can be called in either physical or virtual mode, some
1522 * implementations only allow physical calls. We don't call it very often,
1523 * so the overhead isn't worth eliminating.
1526 ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_version)
1528 struct ia64_pal_retval iprv;
1529 PAL_CALL_PHYS(iprv, PAL_VERSION, 0, 0, 0);
1530 if (pal_min_version)
1531 pal_min_version->pal_version_val = iprv.v0;
1533 if (pal_cur_version)
1534 pal_cur_version->pal_version_val = iprv.v1;
1539 typedef union pal_tc_info_u {
1552 #define tc_reduce_tr pal_tc_info_s.reduce_tr
1553 #define tc_unified pal_tc_info_s.unified
1554 #define tc_pf pal_tc_info_s.pf
1555 #define tc_num_entries pal_tc_info_s.num_entries
1556 #define tc_associativity pal_tc_info_s.associativity
1557 #define tc_num_sets pal_tc_info_s.num_sets
1560 /* Return information about the virtual memory characteristics of the processor
1564 ia64_pal_vm_info (u64 tc_level, u64 tc_type, pal_tc_info_u_t *tc_info, u64 *tc_pages)
1566 struct ia64_pal_retval iprv;
1567 PAL_CALL(iprv, PAL_VM_INFO, tc_level, tc_type, 0);
1569 tc_info->pti_val = iprv.v0;
1571 *tc_pages = iprv.v1;
1575 /* Get page size information about the virtual memory characteristics of the processor
1579 ia64_pal_vm_page_size (u64 *tr_pages, u64 *vw_pages)
1581 struct ia64_pal_retval iprv;
1582 PAL_CALL(iprv, PAL_VM_PAGE_SIZE, 0, 0, 0);
1584 *tr_pages = iprv.v0;
1586 *vw_pages = iprv.v1;
1590 typedef union pal_vm_info_1_u {
1603 } pal_vm_info_1_u_t;
1605 #define PAL_MAX_PURGES 0xFFFF /* all ones is means unlimited */
1607 typedef union pal_vm_info_2_u {
1610 u64 impl_va_msb : 8,
1615 } pal_vm_info_2_u_t;
1617 /* Get summary information about the virtual memory characteristics of the processor
1621 ia64_pal_vm_summary (pal_vm_info_1_u_t *vm_info_1, pal_vm_info_2_u_t *vm_info_2)
1623 struct ia64_pal_retval iprv;
1624 PAL_CALL(iprv, PAL_VM_SUMMARY, 0, 0, 0);
1626 vm_info_1->pvi1_val = iprv.v0;
1628 vm_info_2->pvi2_val = iprv.v1;
1632 typedef union pal_itr_valid_u {
1635 u64 access_rights_valid : 1,
1636 priv_level_valid : 1,
1637 dirty_bit_valid : 1,
1643 /* Read a translation register */
1645 ia64_pal_tr_read (u64 reg_num, u64 tr_type, u64 *tr_buffer, pal_tr_valid_u_t *tr_valid)
1647 struct ia64_pal_retval iprv;
1648 PAL_CALL_PHYS_STK(iprv, PAL_VM_TR_READ, reg_num, tr_type,(u64)ia64_tpa(tr_buffer));
1650 tr_valid->piv_val = iprv.v0;
1655 * PAL_PREFETCH_VISIBILITY transaction types
1657 #define PAL_VISIBILITY_VIRTUAL 0
1658 #define PAL_VISIBILITY_PHYSICAL 1
1661 * PAL_PREFETCH_VISIBILITY return codes
1663 #define PAL_VISIBILITY_OK 1
1664 #define PAL_VISIBILITY_OK_REMOTE_NEEDED 0
1665 #define PAL_VISIBILITY_INVAL_ARG -2
1666 #define PAL_VISIBILITY_ERROR -3
1669 ia64_pal_prefetch_visibility (s64 trans_type)
1671 struct ia64_pal_retval iprv;
1672 PAL_CALL(iprv, PAL_PREFETCH_VISIBILITY, trans_type, 0, 0);
1676 /* data structure for getting information on logical to physical mappings */
1677 typedef union pal_log_overview_u {
1679 u64 num_log :16, /* Total number of logical
1680 * processors on this die
1682 tpc :8, /* Threads per core */
1683 reserved3 :8, /* Reserved */
1684 cpp :8, /* Cores per processor */
1685 reserved2 :8, /* Reserved */
1686 ppid :8, /* Physical processor ID */
1687 reserved1 :8; /* Reserved */
1690 } pal_log_overview_t;
1692 typedef union pal_proc_n_log_info1_u{
1694 u64 tid :16, /* Thread id */
1695 reserved2 :16, /* Reserved */
1696 cid :16, /* Core id */
1697 reserved1 :16; /* Reserved */
1700 } pal_proc_n_log_info1_t;
1702 typedef union pal_proc_n_log_info2_u {
1704 u64 la :16, /* Logical address */
1705 reserved :48; /* Reserved */
1708 } pal_proc_n_log_info2_t;
1710 typedef struct pal_logical_to_physical_s
1712 pal_log_overview_t overview;
1713 pal_proc_n_log_info1_t ppli1;
1714 pal_proc_n_log_info2_t ppli2;
1715 } pal_logical_to_physical_t;
1717 #define overview_num_log overview.overview_bits.num_log
1718 #define overview_tpc overview.overview_bits.tpc
1719 #define overview_cpp overview.overview_bits.cpp
1720 #define overview_ppid overview.overview_bits.ppid
1721 #define log1_tid ppli1.ppli1_bits.tid
1722 #define log1_cid ppli1.ppli1_bits.cid
1723 #define log2_la ppli2.ppli2_bits.la
1725 /* Get information on logical to physical processor mappings. */
1727 ia64_pal_logical_to_phys(u64 proc_number, pal_logical_to_physical_t *mapping)
1729 struct ia64_pal_retval iprv;
1731 PAL_CALL(iprv, PAL_LOGICAL_TO_PHYSICAL, proc_number, 0, 0);
1733 if (iprv.status == PAL_STATUS_SUCCESS)
1735 mapping->overview.overview_data = iprv.v0;
1736 mapping->ppli1.ppli1_data = iprv.v1;
1737 mapping->ppli2.ppli2_data = iprv.v2;
1743 typedef struct pal_cache_shared_info_s
1746 pal_proc_n_log_info1_t ppli1;
1747 pal_proc_n_log_info2_t ppli2;
1748 } pal_cache_shared_info_t;
1750 /* Get information on logical to physical processor mappings. */
1752 ia64_pal_cache_shared_info(u64 level,
1755 pal_cache_shared_info_t *info)
1757 struct ia64_pal_retval iprv;
1759 PAL_CALL(iprv, PAL_CACHE_SHARED_INFO, level, type, proc_number);
1761 if (iprv.status == PAL_STATUS_SUCCESS) {
1762 info->num_shared = iprv.v0;
1763 info->ppli1.ppli1_data = iprv.v1;
1764 info->ppli2.ppli2_data = iprv.v2;
1769 #endif /* __ASSEMBLY__ */
1771 #endif /* _ASM_IA64_PAL_H */