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, 3823c35700SRuss Anderson UV_BIOS_MEMPROTECT, 39841582eaSMike Travis UV_BIOS_GET_PARTITION_ADDR, 40841582eaSMike Travis UV_BIOS_SET_LEGACY_VGA_TARGET 41bb898558SAl Viro }; 42bb898558SAl Viro 43bb898558SAl Viro /* 44bb898558SAl Viro * Status values returned from a BIOS call. 45bb898558SAl Viro */ 46bb898558SAl Viro enum { 4723c35700SRuss Anderson BIOS_STATUS_MORE_PASSES = 1, 48bb898558SAl Viro BIOS_STATUS_SUCCESS = 0, 49bb898558SAl Viro BIOS_STATUS_UNIMPLEMENTED = -ENOSYS, 50bb898558SAl Viro BIOS_STATUS_EINVAL = -EINVAL, 51bb898558SAl Viro BIOS_STATUS_UNAVAIL = -EBUSY 52bb898558SAl Viro }; 53bb898558SAl Viro 54bb898558SAl Viro /* 55bb898558SAl Viro * The UV system table describes specific firmware 56bb898558SAl Viro * capabilities available to the Linux kernel at runtime. 57bb898558SAl Viro */ 58bb898558SAl Viro struct uv_systab { 59bb898558SAl Viro char signature[4]; /* must be "UVST" */ 60bb898558SAl Viro u32 revision; /* distinguish different firmware revs */ 61bb898558SAl Viro u64 function; /* BIOS runtime callback function ptr */ 62bb898558SAl Viro }; 63bb898558SAl Viro 64bb898558SAl Viro enum { 65bb898558SAl Viro BIOS_FREQ_BASE_PLATFORM = 0, 66bb898558SAl Viro BIOS_FREQ_BASE_INTERVAL_TIMER = 1, 67bb898558SAl Viro BIOS_FREQ_BASE_REALTIME_CLOCK = 2 68bb898558SAl Viro }; 69bb898558SAl Viro 70bb898558SAl Viro union partition_info_u { 71bb898558SAl Viro u64 val; 72bb898558SAl Viro struct { 73bb898558SAl Viro u64 hub_version : 8, 74bb898558SAl Viro partition_id : 16, 75bb898558SAl Viro coherence_id : 16, 76bb898558SAl Viro region_size : 24; 77bb898558SAl Viro }; 78bb898558SAl Viro }; 79bb898558SAl Viro 80e8929c8aSRuss Anderson enum uv_memprotect { 81e8929c8aSRuss Anderson UV_MEMPROT_RESTRICT_ACCESS, 82e8929c8aSRuss Anderson UV_MEMPROT_ALLOW_AMO, 83e8929c8aSRuss Anderson UV_MEMPROT_ALLOW_RW 84e8929c8aSRuss Anderson }; 85e8929c8aSRuss Anderson 86bb898558SAl Viro /* 87bb898558SAl Viro * bios calls have 6 parameters 88bb898558SAl Viro */ 89bb898558SAl Viro extern s64 uv_bios_call(enum uv_bios_cmd, u64, u64, u64, u64, u64); 90bb898558SAl Viro extern s64 uv_bios_call_irqsave(enum uv_bios_cmd, u64, u64, u64, u64, u64); 91bb898558SAl Viro extern s64 uv_bios_call_reentrant(enum uv_bios_cmd, u64, u64, u64, u64, u64); 92bb898558SAl Viro 93bb898558SAl Viro extern s64 uv_bios_get_sn_info(int, int *, long *, long *, long *); 94bb898558SAl Viro extern s64 uv_bios_freq_base(u64, u64 *); 95c2c9f115SRobin Holt extern int uv_bios_mq_watchlist_alloc(unsigned long, unsigned int, 9664ccf2f9SRuss Anderson unsigned long *); 9764ccf2f9SRuss Anderson extern int uv_bios_mq_watchlist_free(int, int); 98e8929c8aSRuss Anderson extern s64 uv_bios_change_memprotect(u64, u64, enum uv_memprotect); 9923c35700SRuss Anderson extern s64 uv_bios_reserved_page_pa(u64, u64 *, u64 *, u64 *); 100841582eaSMike Travis extern int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus); 101bb898558SAl Viro 102bb898558SAl Viro extern void uv_bios_init(void); 103bb898558SAl Viro 10464ccf2f9SRuss Anderson extern unsigned long sn_rtc_cycles_per_second; 105bb898558SAl Viro extern int uv_type; 106bb898558SAl Viro extern long sn_partition_id; 1075292ae11SIngo Molnar extern long sn_coherency_id; 1085292ae11SIngo Molnar extern long sn_region_size; 1095292ae11SIngo Molnar #define partition_coherence_id() (sn_coherency_id) 110bb898558SAl Viro 111bb898558SAl Viro extern struct kobject *sgi_uv_kobj; /* /sys/firmware/sgi_uv */ 112bb898558SAl Viro 11305e4d316SH. Peter Anvin #endif /* _ASM_X86_UV_BIOS_H */ 114