xref: /openbmc/linux/arch/x86/include/asm/uv/bios.h (revision 05e4d316)
105e4d316SH. Peter Anvin #ifndef _ASM_X86_UV_BIOS_H
205e4d316SH. Peter Anvin #define _ASM_X86_UV_BIOS_H
3bb898558SAl Viro 
4bb898558SAl Viro /*
5bb898558SAl Viro  * UV BIOS layer definitions.
6bb898558SAl Viro  *
7bb898558SAl Viro  *  This program is free software; you can redistribute it and/or modify
8bb898558SAl Viro  *  it under the terms of the GNU General Public License as published by
9bb898558SAl Viro  *  the Free Software Foundation; either version 2 of the License, or
10bb898558SAl Viro  *  (at your option) any later version.
11bb898558SAl Viro  *
12bb898558SAl Viro  *  This program is distributed in the hope that it will be useful,
13bb898558SAl Viro  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14bb898558SAl Viro  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15bb898558SAl Viro  *  GNU General Public License for more details.
16bb898558SAl Viro  *
17bb898558SAl Viro  *  You should have received a copy of the GNU General Public License
18bb898558SAl Viro  *  along with this program; if not, write to the Free Software
19bb898558SAl Viro  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
20bb898558SAl Viro  *
21bb898558SAl Viro  *  Copyright (c) 2008 Silicon Graphics, Inc.  All Rights Reserved.
22bb898558SAl Viro  *  Copyright (c) Russ Anderson
23bb898558SAl Viro  */
24bb898558SAl Viro 
25bb898558SAl Viro #include <linux/rtc.h>
26bb898558SAl Viro 
27bb898558SAl Viro /*
28bb898558SAl Viro  * Values for the BIOS calls.  It is passed as the first * argument in the
29bb898558SAl Viro  * BIOS call.  Passing any other value in the first argument will result
30bb898558SAl Viro  * in a BIOS_STATUS_UNIMPLEMENTED return status.
31bb898558SAl Viro  */
32bb898558SAl Viro enum uv_bios_cmd {
33bb898558SAl Viro 	UV_BIOS_COMMON,
34bb898558SAl Viro 	UV_BIOS_GET_SN_INFO,
35bb898558SAl Viro 	UV_BIOS_FREQ_BASE
36bb898558SAl Viro };
37bb898558SAl Viro 
38bb898558SAl Viro /*
39bb898558SAl Viro  * Status values returned from a BIOS call.
40bb898558SAl Viro  */
41bb898558SAl Viro enum {
42bb898558SAl Viro 	BIOS_STATUS_SUCCESS		=  0,
43bb898558SAl Viro 	BIOS_STATUS_UNIMPLEMENTED	= -ENOSYS,
44bb898558SAl Viro 	BIOS_STATUS_EINVAL		= -EINVAL,
45bb898558SAl Viro 	BIOS_STATUS_UNAVAIL		= -EBUSY
46bb898558SAl Viro };
47bb898558SAl Viro 
48bb898558SAl Viro /*
49bb898558SAl Viro  * The UV system table describes specific firmware
50bb898558SAl Viro  * capabilities available to the Linux kernel at runtime.
51bb898558SAl Viro  */
52bb898558SAl Viro struct uv_systab {
53bb898558SAl Viro 	char signature[4];	/* must be "UVST" */
54bb898558SAl Viro 	u32 revision;		/* distinguish different firmware revs */
55bb898558SAl Viro 	u64 function;		/* BIOS runtime callback function ptr */
56bb898558SAl Viro };
57bb898558SAl Viro 
58bb898558SAl Viro enum {
59bb898558SAl Viro 	BIOS_FREQ_BASE_PLATFORM = 0,
60bb898558SAl Viro 	BIOS_FREQ_BASE_INTERVAL_TIMER = 1,
61bb898558SAl Viro 	BIOS_FREQ_BASE_REALTIME_CLOCK = 2
62bb898558SAl Viro };
63bb898558SAl Viro 
64bb898558SAl Viro union partition_info_u {
65bb898558SAl Viro 	u64	val;
66bb898558SAl Viro 	struct {
67bb898558SAl Viro 		u64	hub_version	:  8,
68bb898558SAl Viro 			partition_id	: 16,
69bb898558SAl Viro 			coherence_id	: 16,
70bb898558SAl Viro 			region_size	: 24;
71bb898558SAl Viro 	};
72bb898558SAl Viro };
73bb898558SAl Viro 
74bb898558SAl Viro /*
75bb898558SAl Viro  * bios calls have 6 parameters
76bb898558SAl Viro  */
77bb898558SAl Viro extern s64 uv_bios_call(enum uv_bios_cmd, u64, u64, u64, u64, u64);
78bb898558SAl Viro extern s64 uv_bios_call_irqsave(enum uv_bios_cmd, u64, u64, u64, u64, u64);
79bb898558SAl Viro extern s64 uv_bios_call_reentrant(enum uv_bios_cmd, u64, u64, u64, u64, u64);
80bb898558SAl Viro 
81bb898558SAl Viro extern s64 uv_bios_get_sn_info(int, int *, long *, long *, long *);
82bb898558SAl Viro extern s64 uv_bios_freq_base(u64, u64 *);
83bb898558SAl Viro 
84bb898558SAl Viro extern void uv_bios_init(void);
85bb898558SAl Viro 
86bb898558SAl Viro extern int uv_type;
87bb898558SAl Viro extern long sn_partition_id;
88bb898558SAl Viro extern long uv_coherency_id;
89bb898558SAl Viro extern long uv_region_size;
90bb898558SAl Viro #define partition_coherence_id()	(uv_coherency_id)
91bb898558SAl Viro 
92bb898558SAl Viro extern struct kobject *sgi_uv_kobj;	/* /sys/firmware/sgi_uv */
93bb898558SAl Viro 
9405e4d316SH. Peter Anvin #endif /* _ASM_X86_UV_BIOS_H */
95