aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ia64/sn/sn_sal.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-ia64/sn/sn_sal.h')
-rw-r--r--include/asm-ia64/sn/sn_sal.h111
1 files changed, 89 insertions, 22 deletions
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
index 88c31b53dc09..56d74ca76b5d 100644
--- a/include/asm-ia64/sn/sn_sal.h
+++ b/include/asm-ia64/sn/sn_sal.h
@@ -8,7 +8,7 @@
8 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details. 9 * for more details.
10 * 10 *
11 * Copyright (c) 2000-2004 Silicon Graphics, Inc. All rights reserved. 11 * Copyright (c) 2000-2005 Silicon Graphics, Inc. All rights reserved.
12 */ 12 */
13 13
14 14
@@ -35,8 +35,8 @@
35#define SN_SAL_PRINT_ERROR 0x02000012 35#define SN_SAL_PRINT_ERROR 0x02000012
36#define SN_SAL_SET_ERROR_HANDLING_FEATURES 0x0200001a // reentrant 36#define SN_SAL_SET_ERROR_HANDLING_FEATURES 0x0200001a // reentrant
37#define SN_SAL_GET_FIT_COMPT 0x0200001b // reentrant 37#define SN_SAL_GET_FIT_COMPT 0x0200001b // reentrant
38#define SN_SAL_GET_SN_INFO 0x0200001c
39#define SN_SAL_GET_SAPIC_INFO 0x0200001d 38#define SN_SAL_GET_SAPIC_INFO 0x0200001d
39#define SN_SAL_GET_SN_INFO 0x0200001e
40#define SN_SAL_CONSOLE_PUTC 0x02000021 40#define SN_SAL_CONSOLE_PUTC 0x02000021
41#define SN_SAL_CONSOLE_GETC 0x02000022 41#define SN_SAL_CONSOLE_GETC 0x02000022
42#define SN_SAL_CONSOLE_PUTS 0x02000023 42#define SN_SAL_CONSOLE_PUTS 0x02000023
@@ -64,6 +64,7 @@
64 64
65#define SN_SAL_SYSCTL_IOBRICK_PCI_OP 0x02000042 // reentrant 65#define SN_SAL_SYSCTL_IOBRICK_PCI_OP 0x02000042 // reentrant
66#define SN_SAL_IROUTER_OP 0x02000043 66#define SN_SAL_IROUTER_OP 0x02000043
67#define SN_SAL_SYSCTL_EVENT 0x02000044
67#define SN_SAL_IOIF_INTERRUPT 0x0200004a 68#define SN_SAL_IOIF_INTERRUPT 0x0200004a
68#define SN_SAL_HWPERF_OP 0x02000050 // lock 69#define SN_SAL_HWPERF_OP 0x02000050 // lock
69#define SN_SAL_IOIF_ERROR_INTERRUPT 0x02000051 70#define SN_SAL_IOIF_ERROR_INTERRUPT 0x02000051
@@ -76,7 +77,8 @@
76#define SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST 0x02000058 77#define SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST 0x02000058
77 78
78#define SN_SAL_HUB_ERROR_INTERRUPT 0x02000060 79#define SN_SAL_HUB_ERROR_INTERRUPT 0x02000060
79 80#define SN_SAL_BTE_RECOVER 0x02000061
81#define SN_SAL_IOIF_GET_PCI_TOPOLOGY 0x02000062
80 82
81/* 83/*
82 * Service-specific constants 84 * Service-specific constants
@@ -555,7 +557,8 @@ static inline u64
555ia64_sn_partition_serial_get(void) 557ia64_sn_partition_serial_get(void)
556{ 558{
557 struct ia64_sal_retval ret_stuff; 559 struct ia64_sal_retval ret_stuff;
558 SAL_CALL(ret_stuff, SN_SAL_PARTITION_SERIAL_GET, 0, 0, 0, 0, 0, 0, 0); 560 ia64_sal_oemcall_reentrant(&ret_stuff, SN_SAL_PARTITION_SERIAL_GET, 0,
561 0, 0, 0, 0, 0, 0);
559 if (ret_stuff.status != 0) 562 if (ret_stuff.status != 0)
560 return 0; 563 return 0;
561 return ret_stuff.v0; 564 return ret_stuff.v0;
@@ -563,11 +566,10 @@ ia64_sn_partition_serial_get(void)
563 566
564static inline u64 567static inline u64
565sn_partition_serial_number_val(void) { 568sn_partition_serial_number_val(void) {
566 if (sn_partition_serial_number) { 569 if (unlikely(sn_partition_serial_number == 0)) {
567 return(sn_partition_serial_number); 570 sn_partition_serial_number = ia64_sn_partition_serial_get();
568 } else {
569 return(sn_partition_serial_number = ia64_sn_partition_serial_get());
570 } 571 }
572 return sn_partition_serial_number;
571} 573}
572 574
573/* 575/*
@@ -578,8 +580,8 @@ static inline partid_t
578ia64_sn_sysctl_partition_get(nasid_t nasid) 580ia64_sn_sysctl_partition_get(nasid_t nasid)
579{ 581{
580 struct ia64_sal_retval ret_stuff; 582 struct ia64_sal_retval ret_stuff;
581 SAL_CALL(ret_stuff, SN_SAL_SYSCTL_PARTITION_GET, nasid, 583 ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_SYSCTL_PARTITION_GET, nasid,
582 0, 0, 0, 0, 0, 0); 584 0, 0, 0, 0, 0, 0);
583 if (ret_stuff.status != 0) 585 if (ret_stuff.status != 0)
584 return INVALID_PARTID; 586 return INVALID_PARTID;
585 return ((partid_t)ret_stuff.v0); 587 return ((partid_t)ret_stuff.v0);
@@ -593,11 +595,38 @@ extern partid_t sn_partid;
593 595
594static inline partid_t 596static inline partid_t
595sn_local_partid(void) { 597sn_local_partid(void) {
596 if (sn_partid < 0) { 598 if (unlikely(sn_partid < 0)) {
597 return (sn_partid = ia64_sn_sysctl_partition_get(cpuid_to_nasid(smp_processor_id()))); 599 sn_partid = ia64_sn_sysctl_partition_get(cpuid_to_nasid(smp_processor_id()));
598 } else {
599 return sn_partid;
600 } 600 }
601 return sn_partid;
602}
603
604/*
605 * Returns the physical address of the partition's reserved page through
606 * an iterative number of calls.
607 *
608 * On first call, 'cookie' and 'len' should be set to 0, and 'addr'
609 * set to the nasid of the partition whose reserved page's address is
610 * being sought.
611 * On subsequent calls, pass the values, that were passed back on the
612 * previous call.
613 *
614 * While the return status equals SALRET_MORE_PASSES, keep calling
615 * this function after first copying 'len' bytes starting at 'addr'
616 * into 'buf'. Once the return status equals SALRET_OK, 'addr' will
617 * be the physical address of the partition's reserved page. If the
618 * return status equals neither of these, an error as occurred.
619 */
620static inline s64
621sn_partition_reserved_page_pa(u64 buf, u64 *cookie, u64 *addr, u64 *len)
622{
623 struct ia64_sal_retval rv;
624 ia64_sal_oemcall_reentrant(&rv, SN_SAL_GET_PARTITION_ADDR, *cookie,
625 *addr, buf, *len, 0, 0, 0);
626 *cookie = rv.v0;
627 *addr = rv.v1;
628 *len = rv.v2;
629 return rv.status;
601} 630}
602 631
603/* 632/*
@@ -619,8 +648,8 @@ static inline int
619sn_register_xp_addr_region(u64 paddr, u64 len, int operation) 648sn_register_xp_addr_region(u64 paddr, u64 len, int operation)
620{ 649{
621 struct ia64_sal_retval ret_stuff; 650 struct ia64_sal_retval ret_stuff;
622 SAL_CALL(ret_stuff, SN_SAL_XP_ADDR_REGION, paddr, len, (u64)operation, 651 ia64_sal_oemcall(&ret_stuff, SN_SAL_XP_ADDR_REGION, paddr, len,
623 0, 0, 0, 0); 652 (u64)operation, 0, 0, 0, 0);
624 return ret_stuff.status; 653 return ret_stuff.status;
625} 654}
626 655
@@ -644,8 +673,8 @@ sn_register_nofault_code(u64 start_addr, u64 end_addr, u64 return_addr,
644 } else { 673 } else {
645 call = SN_SAL_NO_FAULT_ZONE_PHYSICAL; 674 call = SN_SAL_NO_FAULT_ZONE_PHYSICAL;
646 } 675 }
647 SAL_CALL(ret_stuff, call, start_addr, end_addr, return_addr, (u64)1, 676 ia64_sal_oemcall(&ret_stuff, call, start_addr, end_addr, return_addr,
648 0, 0, 0); 677 (u64)1, 0, 0, 0);
649 return ret_stuff.status; 678 return ret_stuff.status;
650} 679}
651 680
@@ -666,8 +695,8 @@ static inline int
666sn_change_coherence(u64 *new_domain, u64 *old_domain) 695sn_change_coherence(u64 *new_domain, u64 *old_domain)
667{ 696{
668 struct ia64_sal_retval ret_stuff; 697 struct ia64_sal_retval ret_stuff;
669 SAL_CALL(ret_stuff, SN_SAL_COHERENCE, new_domain, old_domain, 0, 0, 698 ia64_sal_oemcall(&ret_stuff, SN_SAL_COHERENCE, (u64)new_domain,
670 0, 0, 0); 699 (u64)old_domain, 0, 0, 0, 0, 0);
671 return ret_stuff.status; 700 return ret_stuff.status;
672} 701}
673 702
@@ -686,8 +715,8 @@ sn_change_memprotect(u64 paddr, u64 len, u64 perms, u64 *nasid_array)
686 cnodeid = nasid_to_cnodeid(get_node_number(paddr)); 715 cnodeid = nasid_to_cnodeid(get_node_number(paddr));
687 // spin_lock(&NODEPDA(cnodeid)->bist_lock); 716 // spin_lock(&NODEPDA(cnodeid)->bist_lock);
688 local_irq_save(irq_flags); 717 local_irq_save(irq_flags);
689 SAL_CALL_NOLOCK(ret_stuff, SN_SAL_MEMPROTECT, paddr, len, nasid_array, 718 ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_MEMPROTECT, paddr, len,
690 perms, 0, 0, 0); 719 (u64)nasid_array, perms, 0, 0, 0);
691 local_irq_restore(irq_flags); 720 local_irq_restore(irq_flags);
692 // spin_unlock(&NODEPDA(cnodeid)->bist_lock); 721 // spin_unlock(&NODEPDA(cnodeid)->bist_lock);
693 return ret_stuff.status; 722 return ret_stuff.status;
@@ -849,6 +878,19 @@ ia64_sn_irtr_intr_disable(nasid_t nasid, int subch, u64 intr)
849 return (int) rv.v0; 878 return (int) rv.v0;
850} 879}
851 880
881/*
882 * Set up a node as the point of contact for system controller
883 * environmental event delivery.
884 */
885static inline int
886ia64_sn_sysctl_event_init(nasid_t nasid)
887{
888 struct ia64_sal_retval rv;
889 SAL_CALL_REENTRANT(rv, SN_SAL_SYSCTL_EVENT, (u64) nasid,
890 0, 0, 0, 0, 0, 0);
891 return (int) rv.v0;
892}
893
852/** 894/**
853 * ia64_sn_get_fit_compt - read a FIT entry from the PROM header 895 * ia64_sn_get_fit_compt - read a FIT entry from the PROM header
854 * @nasid: NASID of node to read 896 * @nasid: NASID of node to read
@@ -1012,4 +1054,29 @@ ia64_sn_hwperf_op(nasid_t nasid, u64 opcode, u64 a0, u64 a1, u64 a2,
1012 return (int) rv.status; 1054 return (int) rv.status;
1013} 1055}
1014 1056
1057static inline int
1058ia64_sn_ioif_get_pci_topology(u64 rack, u64 bay, u64 slot, u64 slab,
1059 u64 buf, u64 len)
1060{
1061 struct ia64_sal_retval rv;
1062 SAL_CALL_NOLOCK(rv, SN_SAL_IOIF_GET_PCI_TOPOLOGY,
1063 rack, bay, slot, slab, buf, len, 0);
1064 return (int) rv.status;
1065}
1066
1067/*
1068 * BTE error recovery is implemented in SAL
1069 */
1070static inline int
1071ia64_sn_bte_recovery(nasid_t nasid)
1072{
1073 struct ia64_sal_retval rv;
1074
1075 rv.status = 0;
1076 SAL_CALL_NOLOCK(rv, SN_SAL_BTE_RECOVER, 0, 0, 0, 0, 0, 0, 0);
1077 if (rv.status == SALRET_NOT_IMPLEMENTED)
1078 return 0;
1079 return (int) rv.status;
1080}
1081
1015#endif /* _ASM_IA64_SN_SN_SAL_H */ 1082#endif /* _ASM_IA64_SN_SN_SAL_H */