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, 3564ccf2f9SRuss Anderson UV_BIOS_FREQ_BASE, 3664ccf2f9SRuss Anderson UV_BIOS_WATCHLIST_ALLOC, 37e8929c8aSRuss Anderson UV_BIOS_WATCHLIST_FREE, 38e8929c8aSRuss Anderson UV_BIOS_MEMPROTECT 39bb898558SAl Viro }; 40bb898558SAl Viro 41bb898558SAl Viro /* 42bb898558SAl Viro * Status values returned from a BIOS call. 43bb898558SAl Viro */ 44bb898558SAl Viro enum { 45bb898558SAl Viro BIOS_STATUS_SUCCESS = 0, 46bb898558SAl Viro BIOS_STATUS_UNIMPLEMENTED = -ENOSYS, 47bb898558SAl Viro BIOS_STATUS_EINVAL = -EINVAL, 48bb898558SAl Viro BIOS_STATUS_UNAVAIL = -EBUSY 49bb898558SAl Viro }; 50bb898558SAl Viro 51bb898558SAl Viro /* 52bb898558SAl Viro * The UV system table describes specific firmware 53bb898558SAl Viro * capabilities available to the Linux kernel at runtime. 54bb898558SAl Viro */ 55bb898558SAl Viro struct uv_systab { 56bb898558SAl Viro char signature[4]; /* must be "UVST" */ 57bb898558SAl Viro u32 revision; /* distinguish different firmware revs */ 58bb898558SAl Viro u64 function; /* BIOS runtime callback function ptr */ 59bb898558SAl Viro }; 60bb898558SAl Viro 61bb898558SAl Viro enum { 62bb898558SAl Viro BIOS_FREQ_BASE_PLATFORM = 0, 63bb898558SAl Viro BIOS_FREQ_BASE_INTERVAL_TIMER = 1, 64bb898558SAl Viro BIOS_FREQ_BASE_REALTIME_CLOCK = 2 65bb898558SAl Viro }; 66bb898558SAl Viro 67bb898558SAl Viro union partition_info_u { 68bb898558SAl Viro u64 val; 69bb898558SAl Viro struct { 70bb898558SAl Viro u64 hub_version : 8, 71bb898558SAl Viro partition_id : 16, 72bb898558SAl Viro coherence_id : 16, 73bb898558SAl Viro region_size : 24; 74bb898558SAl Viro }; 75bb898558SAl Viro }; 76bb898558SAl Viro 7764ccf2f9SRuss Anderson union uv_watchlist_u { 7864ccf2f9SRuss Anderson u64 val; 7964ccf2f9SRuss Anderson struct { 8064ccf2f9SRuss Anderson u64 blade : 16, 8164ccf2f9SRuss Anderson size : 32, 8264ccf2f9SRuss Anderson filler : 16; 8364ccf2f9SRuss Anderson }; 8464ccf2f9SRuss Anderson }; 8564ccf2f9SRuss Anderson 86e8929c8aSRuss Anderson enum uv_memprotect { 87e8929c8aSRuss Anderson UV_MEMPROT_RESTRICT_ACCESS, 88e8929c8aSRuss Anderson UV_MEMPROT_ALLOW_AMO, 89e8929c8aSRuss Anderson UV_MEMPROT_ALLOW_RW 90e8929c8aSRuss Anderson }; 91e8929c8aSRuss Anderson 92bb898558SAl Viro /* 93bb898558SAl Viro * bios calls have 6 parameters 94bb898558SAl Viro */ 95bb898558SAl Viro extern s64 uv_bios_call(enum uv_bios_cmd, u64, u64, u64, u64, u64); 96bb898558SAl Viro extern s64 uv_bios_call_irqsave(enum uv_bios_cmd, u64, u64, u64, u64, u64); 97bb898558SAl Viro extern s64 uv_bios_call_reentrant(enum uv_bios_cmd, u64, u64, u64, u64, u64); 98bb898558SAl Viro 99bb898558SAl Viro extern s64 uv_bios_get_sn_info(int, int *, long *, long *, long *); 100bb898558SAl Viro extern s64 uv_bios_freq_base(u64, u64 *); 10164ccf2f9SRuss Anderson extern int uv_bios_mq_watchlist_alloc(int, void *, unsigned int, 10264ccf2f9SRuss Anderson unsigned long *); 10364ccf2f9SRuss Anderson extern int uv_bios_mq_watchlist_free(int, int); 104e8929c8aSRuss Anderson extern s64 uv_bios_change_memprotect(u64, u64, enum uv_memprotect); 105bb898558SAl Viro 106bb898558SAl Viro extern void uv_bios_init(void); 107bb898558SAl Viro 10864ccf2f9SRuss Anderson extern unsigned long sn_rtc_cycles_per_second; 109bb898558SAl Viro extern int uv_type; 110bb898558SAl Viro extern long sn_partition_id; 1115292ae11SIngo Molnar extern long sn_coherency_id; 1125292ae11SIngo Molnar extern long sn_region_size; 1135292ae11SIngo Molnar #define partition_coherence_id() (sn_coherency_id) 114bb898558SAl Viro 115bb898558SAl Viro extern struct kobject *sgi_uv_kobj; /* /sys/firmware/sgi_uv */ 116bb898558SAl Viro 11705e4d316SH. Peter Anvin #endif /* _ASM_X86_UV_BIOS_H */ 118