diff options
Diffstat (limited to 'include/asm-x86/uv/bios.h')
-rw-r--r-- | include/asm-x86/uv/bios.h | 94 |
1 files changed, 60 insertions, 34 deletions
diff --git a/include/asm-x86/uv/bios.h b/include/asm-x86/uv/bios.h index 7cd6d7ec1308..215f1969c266 100644 --- a/include/asm-x86/uv/bios.h +++ b/include/asm-x86/uv/bios.h | |||
@@ -2,9 +2,7 @@ | |||
2 | #define ASM_X86__UV__BIOS_H | 2 | #define ASM_X86__UV__BIOS_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * BIOS layer definitions. | 5 | * UV BIOS layer definitions. |
6 | * | ||
7 | * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved. | ||
8 | * | 6 | * |
9 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
@@ -19,50 +17,78 @@ | |||
19 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License |
20 | * along with this program; if not, write to the Free Software | 18 | * along with this program; if not, write to the Free Software |
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 | * | ||
21 | * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved. | ||
22 | * Copyright (c) Russ Anderson | ||
22 | */ | 23 | */ |
23 | 24 | ||
24 | #include <linux/rtc.h> | 25 | #include <linux/rtc.h> |
25 | 26 | ||
26 | #define BIOS_FREQ_BASE 0x01000001 | 27 | /* |
28 | * Values for the BIOS calls. It is passed as the first * argument in the | ||
29 | * BIOS call. Passing any other value in the first argument will result | ||
30 | * in a BIOS_STATUS_UNIMPLEMENTED return status. | ||
31 | */ | ||
32 | enum uv_bios_cmd { | ||
33 | UV_BIOS_COMMON, | ||
34 | UV_BIOS_GET_SN_INFO, | ||
35 | UV_BIOS_FREQ_BASE | ||
36 | }; | ||
27 | 37 | ||
38 | /* | ||
39 | * Status values returned from a BIOS call. | ||
40 | */ | ||
28 | enum { | 41 | enum { |
29 | BIOS_FREQ_BASE_PLATFORM = 0, | 42 | BIOS_STATUS_SUCCESS = 0, |
30 | BIOS_FREQ_BASE_INTERVAL_TIMER = 1, | 43 | BIOS_STATUS_UNIMPLEMENTED = -ENOSYS, |
31 | BIOS_FREQ_BASE_REALTIME_CLOCK = 2 | 44 | BIOS_STATUS_EINVAL = -EINVAL, |
45 | BIOS_STATUS_UNAVAIL = -EBUSY | ||
32 | }; | 46 | }; |
33 | 47 | ||
34 | # define BIOS_CALL(result, a0, a1, a2, a3, a4, a5, a6, a7) \ | 48 | /* |
35 | do { \ | 49 | * The UV system table describes specific firmware |
36 | /* XXX - the real call goes here */ \ | 50 | * capabilities available to the Linux kernel at runtime. |
37 | result.status = BIOS_STATUS_UNIMPLEMENTED; \ | 51 | */ |
38 | isrv.v0 = 0; \ | 52 | struct uv_systab { |
39 | isrv.v1 = 0; \ | 53 | char signature[4]; /* must be "UVST" */ |
40 | } while (0) | 54 | u32 revision; /* distinguish different firmware revs */ |
55 | u64 function; /* BIOS runtime callback function ptr */ | ||
56 | }; | ||
41 | 57 | ||
42 | enum { | 58 | enum { |
43 | BIOS_STATUS_SUCCESS = 0, | 59 | BIOS_FREQ_BASE_PLATFORM = 0, |
44 | BIOS_STATUS_UNIMPLEMENTED = -1, | 60 | BIOS_FREQ_BASE_INTERVAL_TIMER = 1, |
45 | BIOS_STATUS_EINVAL = -2, | 61 | BIOS_FREQ_BASE_REALTIME_CLOCK = 2 |
46 | BIOS_STATUS_ERROR = -3 | ||
47 | }; | 62 | }; |
48 | 63 | ||
49 | struct uv_bios_retval { | 64 | union partition_info_u { |
50 | /* | 65 | u64 val; |
51 | * A zero status value indicates call completed without error. | 66 | struct { |
52 | * A negative status value indicates reason of call failure. | 67 | u64 hub_version : 8, |
53 | * A positive status value indicates success but an | 68 | partition_id : 16, |
54 | * informational value should be printed (e.g., "reboot for | 69 | coherence_id : 16, |
55 | * change to take effect"). | 70 | region_size : 24; |
56 | */ | 71 | }; |
57 | s64 status; | ||
58 | u64 v0; | ||
59 | u64 v1; | ||
60 | u64 v2; | ||
61 | }; | 72 | }; |
62 | 73 | ||
63 | extern long | 74 | /* |
64 | x86_bios_freq_base(unsigned long which, unsigned long *ticks_per_second, | 75 | * bios calls have 6 parameters |
65 | unsigned long *drift_info); | 76 | */ |
66 | extern const char *x86_bios_strerror(long status); | 77 | extern s64 uv_bios_call(enum uv_bios_cmd, u64, u64, u64, u64, u64); |
78 | extern s64 uv_bios_call_irqsave(enum uv_bios_cmd, u64, u64, u64, u64, u64); | ||
79 | extern s64 uv_bios_call_reentrant(enum uv_bios_cmd, u64, u64, u64, u64, u64); | ||
80 | |||
81 | extern s64 uv_bios_get_sn_info(int, int *, long *, long *, long *); | ||
82 | extern s64 uv_bios_freq_base(u64, u64 *); | ||
83 | |||
84 | extern void uv_bios_init(void); | ||
85 | |||
86 | extern int uv_type; | ||
87 | extern long sn_partition_id; | ||
88 | extern long uv_coherency_id; | ||
89 | extern long uv_region_size; | ||
90 | #define partition_coherence_id() (uv_coherency_id) | ||
91 | |||
92 | extern struct kobject *sgi_uv_kobj; /* /sys/firmware/sgi_uv */ | ||
67 | 93 | ||
68 | #endif /* ASM_X86__UV__BIOS_H */ | 94 | #endif /* ASM_X86__UV__BIOS_H */ |