1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_IA64_SAL_H
3 #define _ASM_IA64_SAL_H
6 * System Abstraction Layer definitions.
8 * This is based on version 2.5 of the manual "IA-64 System
11 * Copyright (C) 2001 Intel
12 * Copyright (C) 2002 Jenna Hall <jenna.s.hall@intel.com>
13 * Copyright (C) 2001 Fred Lewis <frederick.v.lewis@intel.com>
14 * Copyright (C) 1998, 1999, 2001, 2003 Hewlett-Packard Co
15 * David Mosberger-Tang <davidm@hpl.hp.com>
16 * Copyright (C) 1999 Srinivasa Prasad Thirumalachar <sprasad@sprasad.engr.sgi.com>
18 * 02/01/04 J. Hall Updated Error Record Structures to conform to July 2001
19 * revision of the SAL spec.
20 * 01/01/03 fvlewis Updated Error Record Structures to conform with Nov. 2000
21 * revision of the SAL spec.
22 * 99/09/29 davidm Updated for SAL 2.6.
23 * 00/03/29 cfleck Updated SAL Error Logging info for processor (SAL 2.6)
24 * (plus examples of platform error info structures from smariset @ Intel)
27 #define IA64_SAL_PLATFORM_FEATURE_BUS_LOCK_BIT 0
28 #define IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT_BIT 1
29 #define IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT_BIT 2
30 #define IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT_BIT 3
32 #define IA64_SAL_PLATFORM_FEATURE_BUS_LOCK (1<<IA64_SAL_PLATFORM_FEATURE_BUS_LOCK_BIT)
33 #define IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT (1<<IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT_BIT)
34 #define IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT (1<<IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT_BIT)
35 #define IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT (1<<IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT_BIT)
39 #include <linux/bcd.h>
40 #include <linux/spinlock.h>
41 #include <linux/efi.h>
46 extern unsigned long sal_systab_phys
;
47 extern spinlock_t sal_lock
;
49 /* SAL spec _requires_ eight args for each call. */
50 #define __IA64_FW_CALL(entry,result,a0,a1,a2,a3,a4,a5,a6,a7) \
51 result = (*entry)(a0,a1,a2,a3,a4,a5,a6,a7)
53 # define IA64_FW_CALL(entry,result,args...) do { \
54 unsigned long __ia64_sc_flags; \
55 struct ia64_fpreg __ia64_sc_fr[6]; \
56 ia64_save_scratch_fpregs(__ia64_sc_fr); \
57 spin_lock_irqsave(&sal_lock, __ia64_sc_flags); \
58 __IA64_FW_CALL(entry, result, args); \
59 spin_unlock_irqrestore(&sal_lock, __ia64_sc_flags); \
60 ia64_load_scratch_fpregs(__ia64_sc_fr); \
63 # define SAL_CALL(result,args...) \
64 IA64_FW_CALL(ia64_sal, result, args);
66 # define SAL_CALL_NOLOCK(result,args...) do { \
67 unsigned long __ia64_scn_flags; \
68 struct ia64_fpreg __ia64_scn_fr[6]; \
69 ia64_save_scratch_fpregs(__ia64_scn_fr); \
70 local_irq_save(__ia64_scn_flags); \
71 __IA64_FW_CALL(ia64_sal, result, args); \
72 local_irq_restore(__ia64_scn_flags); \
73 ia64_load_scratch_fpregs(__ia64_scn_fr); \
76 # define SAL_CALL_REENTRANT(result,args...) do { \
77 struct ia64_fpreg __ia64_scs_fr[6]; \
78 ia64_save_scratch_fpregs(__ia64_scs_fr); \
80 __IA64_FW_CALL(ia64_sal, result, args); \
82 ia64_load_scratch_fpregs(__ia64_scs_fr); \
85 #define SAL_SET_VECTORS 0x01000000
86 #define SAL_GET_STATE_INFO 0x01000001
87 #define SAL_GET_STATE_INFO_SIZE 0x01000002
88 #define SAL_CLEAR_STATE_INFO 0x01000003
89 #define SAL_MC_RENDEZ 0x01000004
90 #define SAL_MC_SET_PARAMS 0x01000005
91 #define SAL_REGISTER_PHYSICAL_ADDR 0x01000006
93 #define SAL_CACHE_FLUSH 0x01000008
94 #define SAL_CACHE_INIT 0x01000009
95 #define SAL_PCI_CONFIG_READ 0x01000010
96 #define SAL_PCI_CONFIG_WRITE 0x01000011
97 #define SAL_FREQ_BASE 0x01000012
98 #define SAL_PHYSICAL_ID_INFO 0x01000013
100 #define SAL_UPDATE_PAL 0x01000020
102 struct ia64_sal_retval
{
104 * A zero status value indicates call completed without error.
105 * A negative status value indicates reason of call failure.
106 * A positive status value indicates success but an
107 * informational value should be printed (e.g., "reboot for
108 * change to take effect").
116 typedef struct ia64_sal_retval (*ia64_sal_handler
) (u64
, ...);
119 SAL_FREQ_BASE_PLATFORM
= 0,
120 SAL_FREQ_BASE_INTERVAL_TIMER
= 1,
121 SAL_FREQ_BASE_REALTIME_CLOCK
= 2
125 * The SAL system table is followed by a variable number of variable
126 * length descriptors. The structure of these descriptors follows
128 * The defininition follows SAL specs from July 2000
130 struct ia64_sal_systab
{
131 u8 signature
[4]; /* should be "SST_" */
132 u32 size
; /* size of this table in bytes */
135 u16 entry_count
; /* # of entries in variable portion */
142 /* oem_id & product_id: terminating NUL is missing if string is exactly 32 bytes long. */
144 u8 product_id
[32]; /* ASCII product id */
148 enum sal_systab_entry_type
{
149 SAL_DESC_ENTRY_POINT
= 0,
151 SAL_DESC_PLATFORM_FEATURE
= 2,
154 SAL_DESC_AP_WAKEUP
= 5
166 #define SAL_DESC_SIZE(type) "\060\040\020\040\020\020"[(unsigned) type]
168 typedef struct ia64_sal_desc_entry_point
{
175 }ia64_sal_desc_entry_point_t
;
177 typedef struct ia64_sal_desc_memory
{
179 u8 used_by_sal
; /* needs to be mapped for SAL? */
180 u8 mem_attr
; /* current memory attribute setting */
181 u8 access_rights
; /* access rights set up by SAL */
182 u8 mem_attr_mask
; /* mask of supported memory attributes */
184 u8 mem_type
; /* memory type */
185 u8 mem_usage
; /* memory usage */
186 u64 addr
; /* physical address of memory */
187 u32 length
; /* length (multiple of 4KB pages) */
190 } ia64_sal_desc_memory_t
;
192 typedef struct ia64_sal_desc_platform_feature
{
196 } ia64_sal_desc_platform_feature_t
;
198 typedef struct ia64_sal_desc_tr
{
200 u8 tr_type
; /* 0 == instruction, 1 == data */
201 u8 regnum
; /* translation register number */
203 u64 addr
; /* virtual address of area covered */
204 u64 page_size
; /* encoded page size */
206 } ia64_sal_desc_tr_t
;
208 typedef struct ia64_sal_desc_ptc
{
211 u32 num_domains
; /* # of coherence domains */
212 u64 domain_info
; /* physical address of domain info table */
213 } ia64_sal_desc_ptc_t
;
215 typedef struct ia64_sal_ptc_domain_info
{
216 u64 proc_count
; /* number of processors in domain */
217 u64 proc_list
; /* physical address of LID array */
218 } ia64_sal_ptc_domain_info_t
;
220 typedef struct ia64_sal_ptc_domain_proc_entry
{
221 u64 id
: 8; /* id of processor */
222 u64 eid
: 8; /* eid of processor */
223 } ia64_sal_ptc_domain_proc_entry_t
;
226 #define IA64_SAL_AP_EXTERNAL_INT 0
228 typedef struct ia64_sal_desc_ap_wakeup
{
230 u8 mechanism
; /* 0 == external interrupt */
232 u64 vector
; /* interrupt vector in range 0x10-0xff */
233 } ia64_sal_desc_ap_wakeup_t
;
235 extern ia64_sal_handler ia64_sal
;
236 extern struct ia64_sal_desc_ptc
*ia64_ptc_domain_info
;
238 extern unsigned short sal_revision
; /* supported SAL spec revision */
239 extern unsigned short sal_version
; /* SAL version; OEM dependent */
240 #define SAL_VERSION_CODE(major, minor) ((bin2bcd(major) << 8) | bin2bcd(minor))
242 extern const char *ia64_sal_strerror (long status
);
243 extern void ia64_sal_init (struct ia64_sal_systab
*sal_systab
);
245 /* SAL information type encodings */
247 SAL_INFO_TYPE_MCA
= 0, /* Machine check abort information */
248 SAL_INFO_TYPE_INIT
= 1, /* Init information */
249 SAL_INFO_TYPE_CMC
= 2, /* Corrected machine check information */
250 SAL_INFO_TYPE_CPE
= 3 /* Corrected platform error information */
253 /* Encodings for machine check parameter types */
255 SAL_MC_PARAM_RENDEZ_INT
= 1, /* Rendezvous interrupt */
256 SAL_MC_PARAM_RENDEZ_WAKEUP
= 2, /* Wakeup */
257 SAL_MC_PARAM_CPE_INT
= 3 /* Corrected Platform Error Int */
260 /* Encodings for rendezvous mechanisms */
262 SAL_MC_PARAM_MECHANISM_INT
= 1, /* Use interrupt */
263 SAL_MC_PARAM_MECHANISM_MEM
= 2 /* Use memory synchronization variable*/
266 /* Encodings for vectors which can be registered by the OS with SAL */
268 SAL_VECTOR_OS_MCA
= 0,
269 SAL_VECTOR_OS_INIT
= 1,
270 SAL_VECTOR_OS_BOOT_RENDEZ
= 2
273 /* Encodings for mca_opt parameter sent to SAL_MC_SET_PARAMS */
274 #define SAL_MC_PARAM_RZ_ALWAYS 0x1
275 #define SAL_MC_PARAM_BINIT_ESCALATE 0x10
278 * Definition of the SAL Error Log from the SAL spec
281 /* SAL Error Record Section GUID Definitions */
282 #define SAL_PROC_DEV_ERR_SECT_GUID \
283 EFI_GUID(0xe429faf1, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
284 #define SAL_PLAT_MEM_DEV_ERR_SECT_GUID \
285 EFI_GUID(0xe429faf2, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
286 #define SAL_PLAT_SEL_DEV_ERR_SECT_GUID \
287 EFI_GUID(0xe429faf3, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
288 #define SAL_PLAT_PCI_BUS_ERR_SECT_GUID \
289 EFI_GUID(0xe429faf4, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
290 #define SAL_PLAT_SMBIOS_DEV_ERR_SECT_GUID \
291 EFI_GUID(0xe429faf5, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
292 #define SAL_PLAT_PCI_COMP_ERR_SECT_GUID \
293 EFI_GUID(0xe429faf6, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
294 #define SAL_PLAT_SPECIFIC_ERR_SECT_GUID \
295 EFI_GUID(0xe429faf7, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
296 #define SAL_PLAT_HOST_CTLR_ERR_SECT_GUID \
297 EFI_GUID(0xe429faf8, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
298 #define SAL_PLAT_BUS_ERR_SECT_GUID \
299 EFI_GUID(0xe429faf9, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81)
300 #define PROCESSOR_ABSTRACTION_LAYER_OVERWRITE_GUID \
301 EFI_GUID(0x6cb0a200, 0x893a, 0x11da, 0x96, 0xd2, 0x0, 0x10, 0x83, 0xff, \
304 #define MAX_CACHE_ERRORS 6
305 #define MAX_TLB_ERRORS 6
306 #define MAX_BUS_ERRORS 1
308 /* Definition of version according to SAL spec for logging purposes */
309 typedef struct sal_log_revision
{
310 u8 minor
; /* BCD (0..99) */
311 u8 major
; /* BCD (0..99) */
312 } sal_log_revision_t
;
314 /* Definition of timestamp according to SAL spec for logging purposes */
315 typedef struct sal_log_timestamp
{
316 u8 slh_second
; /* Second (0..59) */
317 u8 slh_minute
; /* Minute (0..59) */
318 u8 slh_hour
; /* Hour (0..23) */
320 u8 slh_day
; /* Day (1..31) */
321 u8 slh_month
; /* Month (1..12) */
322 u8 slh_year
; /* Year (00..99) */
323 u8 slh_century
; /* Century (19, 20, 21, ...) */
324 } sal_log_timestamp_t
;
326 /* Definition of log record header structures */
327 typedef struct sal_log_record_header
{
328 u64 id
; /* Unique monotonically increasing ID */
329 sal_log_revision_t revision
; /* Major and Minor revision of header */
330 u8 severity
; /* Error Severity */
331 u8 validation_bits
; /* 0: platform_guid, 1: !timestamp */
332 u32 len
; /* Length of this error log in bytes */
333 sal_log_timestamp_t timestamp
; /* Timestamp */
334 efi_guid_t platform_guid
; /* Unique OEM Platform ID */
335 } sal_log_record_header_t
;
337 #define sal_log_severity_recoverable 0
338 #define sal_log_severity_fatal 1
339 #define sal_log_severity_corrected 2
342 * Error Recovery Info (ERI) bit decode. From SAL Spec section B.2.2 Table B-3
343 * Error Section Error_Recovery_Info Field Definition.
345 #define ERI_NOT_VALID 0x0 /* Error Recovery Field is not valid */
346 #define ERI_NOT_ACCESSIBLE 0x30 /* Resource not accessible */
347 #define ERI_CONTAINMENT_WARN 0x22 /* Corrupt data propagated */
348 #define ERI_UNCORRECTED_ERROR 0x20 /* Uncorrected error */
349 #define ERI_COMPONENT_RESET 0x24 /* Component must be reset */
350 #define ERI_CORR_ERROR_LOG 0x21 /* Corrected error, needs logging */
351 #define ERI_CORR_ERROR_THRESH 0x29 /* Corrected error threshold exceeded */
353 /* Definition of log section header structures */
354 typedef struct sal_log_sec_header
{
355 efi_guid_t guid
; /* Unique Section ID */
356 sal_log_revision_t revision
; /* Major and Minor revision of Section */
357 u8 error_recovery_info
; /* Platform error recovery status */
359 u32 len
; /* Section length */
360 } sal_log_section_hdr_t
;
362 typedef struct sal_log_mod_error_info
{
365 requestor_identifier
: 1,
366 responder_identifier
: 1,
367 target_identifier
: 1,
372 u64 requestor_identifier
;
373 u64 responder_identifier
;
374 u64 target_identifier
;
376 } sal_log_mod_error_info_t
;
378 typedef struct sal_processor_static_info
{
388 pal_min_state_area_t min_state_area
;
393 struct ia64_fpreg
__attribute__ ((packed
)) fr
[128];
394 } sal_processor_static_info_t
;
396 struct sal_cpuid_info
{
401 typedef struct sal_log_processor_info
{
402 sal_log_section_hdr_t header
;
404 u64 proc_error_map
: 1,
405 proc_state_param
: 1,
407 psi_static_struct
: 1,
411 num_reg_file_check
: 4,
417 u64 proc_state_parameter
;
420 * The rest of this structure consists of variable-length arrays, which can't be
423 sal_log_mod_error_info_t info
[0];
425 * This is what the rest looked like if C supported variable-length arrays:
427 * sal_log_mod_error_info_t cache_check_info[.valid.num_cache_check];
428 * sal_log_mod_error_info_t tlb_check_info[.valid.num_tlb_check];
429 * sal_log_mod_error_info_t bus_check_info[.valid.num_bus_check];
430 * sal_log_mod_error_info_t reg_file_check_info[.valid.num_reg_file_check];
431 * sal_log_mod_error_info_t ms_check_info[.valid.num_ms_check];
432 * struct sal_cpuid_info cpuid_info;
433 * sal_processor_static_info_t processor_static_info;
435 } sal_log_processor_info_t
;
437 /* Given a sal_log_processor_info_t pointer, return a pointer to the processor_static_info: */
438 #define SAL_LPI_PSI_INFO(l) \
439 ({ sal_log_processor_info_t *_l = (l); \
440 ((sal_processor_static_info_t *) \
441 ((char *) _l->info + ((_l->valid.num_cache_check + _l->valid.num_tlb_check \
442 + _l->valid.num_bus_check + _l->valid.num_reg_file_check \
443 + _l->valid.num_ms_check) * sizeof(sal_log_mod_error_info_t) \
444 + sizeof(struct sal_cpuid_info)))); \
447 /* platform error log structures */
449 typedef struct sal_log_mem_dev_err_info
{
450 sal_log_section_hdr_t header
;
452 u64 error_status
: 1,
487 u8 oem_data
[1]; /* Variable length data */
488 } sal_log_mem_dev_err_info_t
;
490 typedef struct sal_log_sel_dev_err_info
{
491 sal_log_section_hdr_t header
;
516 } sal_log_sel_dev_err_info_t
;
518 typedef struct sal_log_pci_bus_err_info
{
519 sal_log_section_hdr_t header
;
543 u8 oem_data
[1]; /* Variable length data */
544 } sal_log_pci_bus_err_info_t
;
546 typedef struct sal_log_smbios_dev_err_info
{
547 sal_log_section_hdr_t header
;
558 u8 data
[1]; /* data of variable length, length == slsmb_length */
559 } sal_log_smbios_dev_err_info_t
;
561 typedef struct sal_log_pci_comp_err_info
{
562 sal_log_section_hdr_t header
;
585 u64 reg_data_pairs
[1];
587 * array of address/data register pairs is num_mem_regs + num_io_regs elements
588 * long. Each array element consists of a u64 address followed by a u64 data
589 * value. The oem_data array immediately follows the reg_data_pairs array
591 u8 oem_data
[1]; /* Variable length data */
592 } sal_log_pci_comp_err_info_t
;
594 typedef struct sal_log_plat_specific_err_info
{
595 sal_log_section_hdr_t header
;
604 u8 oem_data
[1]; /* platform specific variable length data */
605 } sal_log_plat_specific_err_info_t
;
607 typedef struct sal_log_host_ctlr_err_info
{
608 sal_log_section_hdr_t header
;
623 u8 oem_data
[1]; /* Variable length OEM data */
624 } sal_log_host_ctlr_err_info_t
;
626 typedef struct sal_log_plat_bus_err_info
{
627 sal_log_section_hdr_t header
;
642 u8 oem_data
[1]; /* Variable length OEM data */
643 } sal_log_plat_bus_err_info_t
;
645 /* Overall platform error section structure */
646 typedef union sal_log_platform_err_info
{
647 sal_log_mem_dev_err_info_t mem_dev_err
;
648 sal_log_sel_dev_err_info_t sel_dev_err
;
649 sal_log_pci_bus_err_info_t pci_bus_err
;
650 sal_log_smbios_dev_err_info_t smbios_dev_err
;
651 sal_log_pci_comp_err_info_t pci_comp_err
;
652 sal_log_plat_specific_err_info_t plat_specific_err
;
653 sal_log_host_ctlr_err_info_t host_ctlr_err
;
654 sal_log_plat_bus_err_info_t plat_bus_err
;
655 } sal_log_platform_err_info_t
;
657 /* SAL log over-all, multi-section error record structure (processor+platform) */
658 typedef struct err_rec
{
659 sal_log_record_header_t sal_elog_header
;
660 sal_log_processor_info_t proc_err
;
661 sal_log_platform_err_info_t plat_err
;
662 u8 oem_data_pad
[1024];
666 * Now define a couple of inline functions for improved type checking
670 extern s64
ia64_sal_cache_flush (u64 cache_type
);
671 extern void __init
check_sal_cache_flush (void);
673 /* Initialize all the processor and platform level instruction and data caches */
675 ia64_sal_cache_init (void)
677 struct ia64_sal_retval isrv
;
678 SAL_CALL(isrv
, SAL_CACHE_INIT
, 0, 0, 0, 0, 0, 0, 0);
683 * Clear the processor and platform information logged by SAL with respect to the machine
684 * state at the time of MCA's, INITs, CMCs, or CPEs.
687 ia64_sal_clear_state_info (u64 sal_info_type
)
689 struct ia64_sal_retval isrv
;
690 SAL_CALL_REENTRANT(isrv
, SAL_CLEAR_STATE_INFO
, sal_info_type
, 0,
696 /* Get the processor and platform information logged by SAL with respect to the machine
697 * state at the time of the MCAs, INITs, CMCs, or CPEs.
700 ia64_sal_get_state_info (u64 sal_info_type
, u64
*sal_info
)
702 struct ia64_sal_retval isrv
;
703 SAL_CALL_REENTRANT(isrv
, SAL_GET_STATE_INFO
, sal_info_type
, 0,
704 sal_info
, 0, 0, 0, 0);
712 * Get the maximum size of the information logged by SAL with respect to the machine state
713 * at the time of MCAs, INITs, CMCs, or CPEs.
716 ia64_sal_get_state_info_size (u64 sal_info_type
)
718 struct ia64_sal_retval isrv
;
719 SAL_CALL_REENTRANT(isrv
, SAL_GET_STATE_INFO_SIZE
, sal_info_type
, 0,
727 * Causes the processor to go into a spin loop within SAL where SAL awaits a wakeup from
728 * the monarch processor. Must not lock, because it will not return on any cpu until the
729 * monarch processor sends a wake up.
732 ia64_sal_mc_rendez (void)
734 struct ia64_sal_retval isrv
;
735 SAL_CALL_NOLOCK(isrv
, SAL_MC_RENDEZ
, 0, 0, 0, 0, 0, 0, 0);
740 * Allow the OS to specify the interrupt number to be used by SAL to interrupt OS during
741 * the machine check rendezvous sequence as well as the mechanism to wake up the
742 * non-monarch processor at the end of machine check processing.
743 * Returns the complete ia64_sal_retval because some calls return more than just a status
746 static inline struct ia64_sal_retval
747 ia64_sal_mc_set_params (u64 param_type
, u64 i_or_m
, u64 i_or_m_val
, u64 timeout
, u64 rz_always
)
749 struct ia64_sal_retval isrv
;
750 SAL_CALL(isrv
, SAL_MC_SET_PARAMS
, param_type
, i_or_m
, i_or_m_val
,
751 timeout
, rz_always
, 0, 0);
755 /* Read from PCI configuration space */
757 ia64_sal_pci_config_read (u64 pci_config_addr
, int type
, u64 size
, u64
*value
)
759 struct ia64_sal_retval isrv
;
760 SAL_CALL(isrv
, SAL_PCI_CONFIG_READ
, pci_config_addr
, size
, type
, 0, 0, 0, 0);
766 /* Write to PCI configuration space */
768 ia64_sal_pci_config_write (u64 pci_config_addr
, int type
, u64 size
, u64 value
)
770 struct ia64_sal_retval isrv
;
771 SAL_CALL(isrv
, SAL_PCI_CONFIG_WRITE
, pci_config_addr
, size
, value
,
777 * Register physical addresses of locations needed by SAL when SAL procedures are invoked
781 ia64_sal_register_physical_addr (u64 phys_entry
, u64 phys_addr
)
783 struct ia64_sal_retval isrv
;
784 SAL_CALL(isrv
, SAL_REGISTER_PHYSICAL_ADDR
, phys_entry
, phys_addr
,
790 * Register software dependent code locations within SAL. These locations are handlers or
791 * entry points where SAL will pass control for the specified event. These event handlers
792 * are for the bott rendezvous, MCAs and INIT scenarios.
795 ia64_sal_set_vectors (u64 vector_type
,
796 u64 handler_addr1
, u64 gp1
, u64 handler_len1
,
797 u64 handler_addr2
, u64 gp2
, u64 handler_len2
)
799 struct ia64_sal_retval isrv
;
800 SAL_CALL(isrv
, SAL_SET_VECTORS
, vector_type
,
801 handler_addr1
, gp1
, handler_len1
,
802 handler_addr2
, gp2
, handler_len2
);
807 /* Update the contents of PAL block in the non-volatile storage device */
809 ia64_sal_update_pal (u64 param_buf
, u64 scratch_buf
, u64 scratch_buf_size
,
810 u64
*error_code
, u64
*scratch_buf_size_needed
)
812 struct ia64_sal_retval isrv
;
813 SAL_CALL(isrv
, SAL_UPDATE_PAL
, param_buf
, scratch_buf
, scratch_buf_size
,
816 *error_code
= isrv
.v0
;
817 if (scratch_buf_size_needed
)
818 *scratch_buf_size_needed
= isrv
.v1
;
822 /* Get physical processor die mapping in the platform. */
824 ia64_sal_physical_id_info(u16
*splid
)
826 struct ia64_sal_retval isrv
;
828 if (sal_revision
< SAL_VERSION_CODE(3,2))
831 SAL_CALL(isrv
, SAL_PHYSICAL_ID_INFO
, 0, 0, 0, 0, 0, 0, 0);
837 extern unsigned long sal_platform_features
;
839 extern int (*salinfo_platform_oemdata
)(const u8
*, u8
**, u64
*);
841 struct sal_ret_values
{
842 long r8
; long r9
; long r10
; long r11
;
845 #define IA64_SAL_OEMFUNC_MIN 0x02000000
846 #define IA64_SAL_OEMFUNC_MAX 0x03ffffff
848 extern int ia64_sal_oemcall(struct ia64_sal_retval
*, u64
, u64
, u64
, u64
, u64
,
850 extern int ia64_sal_oemcall_nolock(struct ia64_sal_retval
*, u64
, u64
, u64
,
851 u64
, u64
, u64
, u64
, u64
);
852 extern int ia64_sal_oemcall_reentrant(struct ia64_sal_retval
*, u64
, u64
, u64
,
853 u64
, u64
, u64
, u64
, u64
);
855 ia64_sal_freq_base (unsigned long which
, unsigned long *ticks_per_second
,
856 unsigned long *drift_info
);
857 #ifdef CONFIG_HOTPLUG_CPU
859 * System Abstraction Layer Specification
860 * Section 3.2.5.1: OS_BOOT_RENDEZ to SAL return State.
861 * Note: region regs are stored first in head.S _start. Hence they must
864 struct sal_to_os_boot
{
865 u64 rr
[8]; /* Region Registers */
867 * return addr into SAL boot rendez routine */
868 u64 gr1
; /* SAL:GP */
869 u64 gr12
; /* SAL:SP */
870 u64 gr13
; /* SAL: Task Pointer */
876 u64 dcr
; /* Default Control Register */
884 u64 pr
; /* Predicate registers */
885 u64 lc
; /* Loop Count */
886 struct ia64_fpreg fp
[20];
890 * Global array allocated for NR_CPUS at boot time
892 extern struct sal_to_os_boot sal_boot_rendez_state
[NR_CPUS
];
894 extern void ia64_jump_to_sal(struct sal_to_os_boot
*);
897 extern void ia64_sal_handler_init(void *entry_point
, void *gpval
);
899 #define PALO_MAX_TLB_PURGES 0xFFFF
900 #define PALO_SIG "PALO"
903 u8 signature
[4]; /* Should be "PALO" */
913 #define NPTCG_FROM_PAL 0
914 #define NPTCG_FROM_PALO 1
915 #define NPTCG_FROM_KERNEL_PARAMETER 2
917 #endif /* __ASSEMBLY__ */
919 #endif /* _ASM_IA64_SAL_H */