1 #ifndef _ASM_IA64_PAL_H
2 #define _ASM_IA64_PAL_H
33 #define PAL_CACHE_FLUSH 1
34 #define PAL_CACHE_INFO 2
35 #define PAL_CACHE_INIT 3
36 #define PAL_CACHE_SUMMARY 4
37 #define PAL_MEM_ATTRIB 5
38 #define PAL_PTCE_INFO 6
40 #define PAL_VM_SUMMARY 8
41 #define PAL_BUS_GET_FEATURES 9
42 #define PAL_BUS_SET_FEATURES 10
43 #define PAL_DEBUG_INFO 11
44 #define PAL_FIXED_ADDR 12
45 #define PAL_FREQ_BASE 13
46 #define PAL_FREQ_RATIOS 14
47 #define PAL_PERF_MON_INFO 15
48 #define PAL_PLATFORM_ADDR 16
49 #define PAL_PROC_GET_FEATURES 17
50 #define PAL_PROC_SET_FEATURES 18
51 #define PAL_RSE_INFO 19
52 #define PAL_VERSION 20
53 #define PAL_MC_CLEAR_LOG 21
54 #define PAL_MC_DRAIN 22
55 #define PAL_MC_EXPECTED 23
56 #define PAL_MC_DYNAMIC_STATE 24
57 #define PAL_MC_ERROR_INFO 25
58 #define PAL_MC_RESUME 26
59 #define PAL_MC_REGISTER_MEM 27
61 #define PAL_HALT_LIGHT 29
62 #define PAL_COPY_INFO 30
63 #define PAL_CACHE_LINE_INIT 31
64 #define PAL_PMI_ENTRYPOINT 32
65 #define PAL_ENTER_IA_32_ENV 33
66 #define PAL_VM_PAGE_SIZE 34
68 #define PAL_MEM_FOR_TEST 37
69 #define PAL_CACHE_PROT_INFO 38
70 #define PAL_REGISTER_INFO 39
71 #define PAL_SHUTDOWN 40
72 #define PAL_PREFETCH_VISIBILITY 41
73 #define PAL_LOGICAL_TO_PHYSICAL 42
74 #define PAL_CACHE_SHARED_INFO 43
75 #define PAL_GET_HW_POLICY 48
76 #define PAL_SET_HW_POLICY 49
77 #define PAL_VP_INFO 50
78 #define PAL_MC_HW_TRACKING 51
80 #define PAL_COPY_PAL 256
81 #define PAL_HALT_INFO 257
82 #define PAL_TEST_PROC 258
83 #define PAL_CACHE_READ 259
84 #define PAL_CACHE_WRITE 260
85 #define PAL_VM_TR_READ 261
86 #define PAL_GET_PSTATE 262
87 #define PAL_SET_PSTATE 263
88 #define PAL_BRAND_INFO 274
90 #define PAL_GET_PSTATE_TYPE_LASTSET 0
91 #define PAL_GET_PSTATE_TYPE_AVGANDRESET 1
92 #define PAL_GET_PSTATE_TYPE_AVGNORESET 2
93 #define PAL_GET_PSTATE_TYPE_INSTANT 3
95 #define PAL_MC_ERROR_INJECT 276
99 #include <linux/types.h>
110 #define PAL_STATUS_SUCCESS 0
111 #define PAL_STATUS_UNIMPLEMENTED (-1)
112 #define PAL_STATUS_EINVAL (-2)
113 #define PAL_STATUS_ERROR (-3)
114 #define PAL_STATUS_CACHE_INIT_FAIL (-4)
119 #define PAL_STATUS_REQUIRES_MEMORY (-9)
123 #define PAL_CACHE_LEVEL_L0 0
124 #define PAL_CACHE_LEVEL_L1 1
125 #define PAL_CACHE_LEVEL_L2 2
131 #define PAL_CACHE_TYPE_INSTRUCTION 1
132 #define PAL_CACHE_TYPE_DATA 2
133 #define PAL_CACHE_TYPE_INSTRUCTION_DATA 3
136 #define PAL_CACHE_FLUSH_INVALIDATE 1
137 #define PAL_CACHE_FLUSH_CHK_INTRS 2
144 #define PAL_CACHE_LINE_STATE_INVALID 0
145 #define PAL_CACHE_LINE_STATE_SHARED 1
146 #define PAL_CACHE_LINE_STATE_EXCLUSIVE 2
147 #define PAL_CACHE_LINE_STATE_MODIFIED 3
193 #define pcci_ld_hints pcci_info_1.pcci1_bits.load_hints
194 #define pcci_st_hints pcci_info_1.pcci1_bits.store_hints
195 #define pcci_ld_latency pcci_info_1.pcci1_bits.load_latency
196 #define pcci_st_latency pcci_info_1.pcci1_bits.store_latency
197 #define pcci_stride pcci_info_1.pcci1_bits.stride
198 #define pcci_line_size pcci_info_1.pcci1_bits.line_size
199 #define pcci_assoc pcci_info_1.pcci1_bits.associativity
200 #define pcci_cache_attr pcci_info_1.pcci1_bits.at
201 #define pcci_unified pcci_info_1.pcci1_bits.u
202 #define pcci_tag_msb pcci_info_2.pcci2_bits.tag_ms_bit
203 #define pcci_tag_lsb pcci_info_2.pcci2_bits.tag_ls_bit
204 #define pcci_alias_boundary pcci_info_2.pcci2_bits.alias_boundary
205 #define pcci_cache_size pcci_info_2.pcci2_bits.cache_size
211 #define PAL_CACHE_ATTR_WT 0
212 #define PAL_CACHE_ATTR_WB 1
213 #define PAL_CACHE_ATTR_WT_OR_WB 2
221 #define PAL_CACHE_HINT_TEMP_1 0
222 #define PAL_CACHE_HINT_NTEMP_1 1
223 #define PAL_CACHE_HINT_NTEMP_ALL 3
248 #define pcpi_cache_prot_part pcp_info.t_d
249 #define pcpi_prot_method pcp_info.method
250 #define pcpi_prot_bits pcp_info.prot_bits
251 #define pcpi_tagprot_msb pcp_info.tagprot_msb
252 #define pcpi_tagprot_lsb pcp_info.tagprot_lsb
253 #define pcpi_data_bits pcp_info.data_bits
256 #define PAL_CACHE_PROT_PART_DATA 0
257 #define PAL_CACHE_PROT_PART_TAG 1
258 #define PAL_CACHE_PROT_PART_TAG_DATA 2
261 #define PAL_CACHE_PROT_PART_DATA_TAG 3
264 #define PAL_CACHE_PROT_PART_MAX 6
274 #define PAL_CACHE_PROT_METHOD_NONE 0
275 #define PAL_CACHE_PROT_METHOD_ODD_PARITY 1
276 #define PAL_CACHE_PROT_METHOD_EVEN_PARITY 2
277 #define PAL_CACHE_PROT_METHOD_ECC 3
324 #define pclid_read_part pclid_info_read.part
325 #define pclid_read_way pclid_info_read.way
326 #define pclid_read_level pclid_info_read.level
327 #define pclid_read_cache_type pclid_info_read.cache_type
329 #define pclid_write_trigger pclid_info_write.trigger
330 #define pclid_write_length pclid_info_write.length
331 #define pclid_write_start pclid_info_write.start
332 #define pclid_write_mesi pclid_info_write.mesi
333 #define pclid_write_part pclid_info_write.part
334 #define pclid_write_way pclid_info_write.way
335 #define pclid_write_level pclid_info_write.level
336 #define pclid_write_cache_type pclid_info_write.cache_type
339 #define PAL_CACHE_LINE_ID_PART_DATA 0
340 #define PAL_CACHE_LINE_ID_PART_TAG 1
341 #define PAL_CACHE_LINE_ID_PART_DATA_PROT 2
342 #define PAL_CACHE_LINE_ID_PART_TAG_PROT 3
343 #define PAL_CACHE_LINE_ID_PART_DATA_TAG_PROT 4
362 #define PAL_MC_PENDING_MCA (1 << 0)
363 #define PAL_MC_PENDING_INIT (1 << 1)
368 #define PAL_MC_INFO_PROCESSOR 0
369 #define PAL_MC_INFO_CACHE_CHECK 1
370 #define PAL_MC_INFO_TLB_CHECK 2
371 #define PAL_MC_INFO_BUS_CHECK 3
372 #define PAL_MC_INFO_REQ_ADDR 4
373 #define PAL_MC_INFO_RESP_ADDR 5
374 #define PAL_MC_INFO_TARGET_ADDR 6
375 #define PAL_MC_INFO_IMPL_DEP 7
379 #define PAL_TLB_CHECK_OP_PURGE 8
678 #define pmci_proc_unknown_check pme_processor.uc
679 #define pmci_proc_bus_check pme_processor.bc
680 #define pmci_proc_tlb_check pme_processor.tc
681 #define pmci_proc_cache_check pme_processor.cc
682 #define pmci_proc_dynamic_state_size pme_processor.dsize
683 #define pmci_proc_gpr_valid pme_processor.gr
684 #define pmci_proc_preserved_bank0_gpr_valid pme_processor.b0
685 #define pmci_proc_preserved_bank1_gpr_valid pme_processor.b1
686 #define pmci_proc_fp_valid pme_processor.fp
687 #define pmci_proc_predicate_regs_valid pme_processor.pr
688 #define pmci_proc_branch_regs_valid pme_processor.br
689 #define pmci_proc_app_regs_valid pme_processor.ar
690 #define pmci_proc_region_regs_valid pme_processor.rr
691 #define pmci_proc_translation_regs_valid pme_processor.tr
692 #define pmci_proc_debug_regs_valid pme_processor.dr
693 #define pmci_proc_perf_counters_valid pme_processor.pc
694 #define pmci_proc_control_regs_valid pme_processor.cr
695 #define pmci_proc_machine_check_expected pme_processor.ex
696 #define pmci_proc_machine_check_corrected pme_processor.cm
697 #define pmci_proc_rse_valid pme_processor.rs
698 #define pmci_proc_machine_check_or_init pme_processor.in
699 #define pmci_proc_dynamic_state_valid pme_processor.dy
700 #define pmci_proc_operation pme_processor.op
701 #define pmci_proc_trap_lost pme_processor.tl
702 #define pmci_proc_hardware_damage pme_processor.hd
703 #define pmci_proc_uncontained_storage_damage pme_processor.us
704 #define pmci_proc_machine_check_isolated pme_processor.ci
705 #define pmci_proc_continuable pme_processor.co
706 #define pmci_proc_storage_intergrity_synced pme_processor.sy
707 #define pmci_proc_min_state_save_area_regd pme_processor.mn
708 #define pmci_proc_distinct_multiple_errors pme_processor.me
709 #define pmci_proc_pal_attempted_rendezvous pme_processor.ra
710 #define pmci_proc_pal_rendezvous_complete pme_processor.rz
713 #define pmci_cache_level pme_cache.level
714 #define pmci_cache_line_state pme_cache.mesi
715 #define pmci_cache_line_state_valid pme_cache.mv
716 #define pmci_cache_line_index pme_cache.index
717 #define pmci_cache_instr_cache_fail pme_cache.ic
718 #define pmci_cache_data_cache_fail pme_cache.dc
719 #define pmci_cache_line_tag_fail pme_cache.tl
720 #define pmci_cache_line_data_fail pme_cache.dl
721 #define pmci_cache_operation pme_cache.op
722 #define pmci_cache_way_valid pme_cache.wv
723 #define pmci_cache_target_address_valid pme_cache.tv
724 #define pmci_cache_way pme_cache.way
725 #define pmci_cache_mc pme_cache.mc
727 #define pmci_tlb_instr_translation_cache_fail pme_tlb.itc
728 #define pmci_tlb_data_translation_cache_fail pme_tlb.dtc
729 #define pmci_tlb_instr_translation_reg_fail pme_tlb.itr
730 #define pmci_tlb_data_translation_reg_fail pme_tlb.dtr
731 #define pmci_tlb_translation_reg_slot pme_tlb.tr_slot
732 #define pmci_tlb_mc pme_tlb.mc
734 #define pmci_bus_status_info pme_bus.bsi
735 #define pmci_bus_req_address_valid pme_bus.rq
736 #define pmci_bus_resp_address_valid pme_bus.rp
737 #define pmci_bus_target_address_valid pme_bus.tv
738 #define pmci_bus_error_severity pme_bus.sev
739 #define pmci_bus_transaction_type pme_bus.type
740 #define pmci_bus_cache_cache_transfer pme_bus.cc
741 #define pmci_bus_transaction_size pme_bus.size
742 #define pmci_bus_internal_error pme_bus.ib
743 #define pmci_bus_external_error pme_bus.eb
744 #define pmci_bus_mc pme_bus.mc
798 #define PAL_CALL(iprv,a0,a1,a2,a3) do { \
799 struct ia64_fpreg fr[6]; \
800 ia64_save_scratch_fpregs(fr); \
801 iprv = ia64_pal_call_static(a0, a1, a2, a3); \
802 ia64_load_scratch_fpregs(fr); \
805 #define PAL_CALL_STK(iprv,a0,a1,a2,a3) do { \
806 struct ia64_fpreg fr[6]; \
807 ia64_save_scratch_fpregs(fr); \
808 iprv = ia64_pal_call_stacked(a0, a1, a2, a3); \
809 ia64_load_scratch_fpregs(fr); \
812 #define PAL_CALL_PHYS(iprv,a0,a1,a2,a3) do { \
813 struct ia64_fpreg fr[6]; \
814 ia64_save_scratch_fpregs(fr); \
815 iprv = ia64_pal_call_phys_static(a0, a1, a2, a3); \
816 ia64_load_scratch_fpregs(fr); \
819 #define PAL_CALL_PHYS_STK(iprv,a0,a1,a2,a3) do { \
820 struct ia64_fpreg fr[6]; \
821 ia64_save_scratch_fpregs(fr); \
822 iprv = ia64_pal_call_phys_stacked(a0, a1, a2, a3); \
823 ia64_load_scratch_fpregs(fr); \
891 if (features_control)
913 if (iprv.status == 0) {
931 if (iprv.status == 0) {
992 static inline long ia64_pal_cache_summary(
unsigned long *cache_levels,
993 unsigned long *unique_caches)
998 *cache_levels = iprv.v0;
1000 *unique_caches = iprv.v1;
1010 physical_addr, data);
1017 ia64_pal_copy_info (
u64 copy_type,
u64 num_procs,
u64 num_iopics,
1018 u64 *buffer_size,
u64 *buffer_align)
1023 *buffer_size = iprv.v0;
1025 *buffer_align = iprv.v1;
1035 if (pal_proc_offset)
1036 *pal_proc_offset = iprv.v0;
1041 static inline long ia64_pal_debug_info(
unsigned long *inst_regs,
1042 unsigned long *data_regs)
1047 *inst_regs = iprv.v0;
1049 *data_regs = iprv.v1;
1057 ia64_pal_enter_ia32_env (ia32_env1, ia32_env2, ia32_env3)
1067 ia64_pal_fixed_addr (
u64 *global_unique_addr)
1071 if (global_unique_addr)
1072 *global_unique_addr = iprv.v0;
1077 static inline long ia64_pal_freq_base(
unsigned long *platform_base_freq)
1081 if (platform_base_freq)
1082 *platform_base_freq = iprv.v0;
1097 *(
u64 *)proc_ratio = iprv.v0;
1099 *(
u64 *)bus_ratio = iprv.v1;
1101 *(
u64 *)itc_ratio = iprv.v2;
1109 ia64_pal_get_hw_policy (
u64 proc_num,
u64 *cur_policy,
u64 *num_impacted,
1115 *cur_policy = iprv.v0;
1117 *num_impacted = iprv.v1;
1128 ia64_pal_halt (
u64 halt_state)
1158 ia64_pal_get_pstate (
u64 *pstate_index,
unsigned long type)
1162 *pstate_index = iprv.v0;
1168 ia64_pal_set_pstate (
u64 pstate_index)
1177 ia64_pal_get_brand_info (
char *brand_info)
1188 ia64_pal_halt_light (
void)
1200 ia64_pal_mc_clear_log (
u64 *pending_vector)
1205 *pending_vector = iprv.v0;
1213 ia64_pal_mc_drain (
void)
1222 ia64_pal_mc_dynamic_state (
u64 info_type,
u64 dy_buffer,
u64 *
size)
1233 ia64_pal_mc_error_info (
u64 info_index,
u64 type_index,
u64 *size,
u64 *error_info)
1240 *error_info = iprv.v1;
1248 ia64_pal_mc_error_inject_phys (
u64 err_type_info,
u64 err_struct_info,
1253 err_struct_info, err_data_buffer);
1255 *capabilities= iprv.v0;
1257 *resources= iprv.v1;
1262 ia64_pal_mc_error_inject_virt (
u64 err_type_info,
u64 err_struct_info,
1263 u64 err_data_buffer,
u64 *capabilities,
u64 *resources)
1267 err_struct_info, err_data_buffer);
1269 *capabilities= iprv.v0;
1271 *resources= iprv.v1;
1279 ia64_pal_mc_expected (
u64 expected,
u64 *previous)
1284 *previous = iprv.
v0;
1322 *req_size = iprv.v0;
1330 ia64_pal_mc_resume (
u64 set_cmci,
u64 save_ptr)
1339 ia64_pal_mem_attrib (
u64 *mem_attrib)
1344 *mem_attrib = iprv.v0 & 0xff;
1357 *bytes_needed = iprv.
v0;
1359 *alignment = iprv.
v1;
1391 ia64_pal_platform_addr (
u64 type,
u64 physical_addr)
1400 ia64_pal_pmi_entrypoint (
u64 sal_pmi_entry_addr)
1407 struct pal_features_s;
1410 ia64_pal_proc_get_features (
u64 *features_avail,
1411 u64 *features_status,
1412 u64 *features_control,
1417 if (iprv.status == 0) {
1418 *features_avail = iprv.v0;
1419 *features_status = iprv.v1;
1420 *features_control = iprv.v2;
1427 ia64_pal_proc_set_features (
u64 feature_select)
1456 if (iprv.status == 0) {
1457 ptce->
base = iprv.v0;
1458 ptce->
count[0] = iprv.v1 >> 32;
1459 ptce->
count[1] = iprv.v1 & 0xffffffff;
1460 ptce->
stride[0] = iprv.v2 >> 32;
1461 ptce->
stride[1] = iprv.v2 & 0xffffffff;
1468 ia64_pal_register_info (
u64 info_request,
u64 *reg_info_1,
u64 *reg_info_2)
1473 *reg_info_1 = iprv.
v0;
1475 *reg_info_2 = iprv.
v1;
1482 unsigned long si : 1,
1491 static inline long ia64_pal_rse_info(
unsigned long *num_phys_stacked,
1496 if (num_phys_stacked)
1497 *num_phys_stacked = iprv.v0;
1507 ia64_pal_set_hw_policy (
u64 policy)
1519 ia64_pal_shutdown (
void)
1532 if (self_test_state)
1533 *self_test_state = iprv.v0;
1562 if (pal_min_version)
1565 if (pal_cur_version)
1584 #define tc_reduce_tr pal_tc_info_s.reduce_tr
1585 #define tc_unified pal_tc_info_s.unified
1586 #define tc_pf pal_tc_info_s.pf
1587 #define tc_num_entries pal_tc_info_s.num_entries
1588 #define tc_associativity pal_tc_info_s.associativity
1589 #define tc_num_sets pal_tc_info_s.num_sets
1603 *tc_pages = iprv.
v1;
1610 static inline s64 ia64_pal_vm_page_size(
u64 *tr_pages,
u64 *vw_pages)
1615 *tr_pages = iprv.
v0;
1617 *vw_pages = iprv.
v1;
1636 #define PAL_MAX_PURGES 0xFFFF
1675 ia64_pal_vp_info (
u64 feature_set,
u64 vp_buffer,
u64 *vp_info,
u64 *vmm_id)
1711 #define PAL_VISIBILITY_VIRTUAL 0
1712 #define PAL_VISIBILITY_PHYSICAL 1
1717 #define PAL_VISIBILITY_OK 1
1718 #define PAL_VISIBILITY_OK_REMOTE_NEEDED 0
1719 #define PAL_VISIBILITY_INVAL_ARG -2
1720 #define PAL_VISIBILITY_ERROR -3
1723 ia64_pal_prefetch_visibility (
s64 trans_type)
1771 #define overview_num_log overview.overview_bits.num_log
1772 #define overview_tpc overview.overview_bits.tpc
1773 #define overview_cpp overview.overview_bits.cpp
1774 #define overview_ppid overview.overview_bits.ppid
1775 #define log1_tid ppli1.ppli1_bits.tid
1776 #define log1_cid ppli1.ppli1_bits.cid
1777 #define log2_la ppli2.ppli2_bits.la
1806 ia64_pal_cache_shared_info(
u64 level,