| .. | .. | 
|---|
 | 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */  | 
|---|
| 1 | 2 |  #ifndef _ASM_X86_UV_BIOS_H | 
|---|
| 2 | 3 |  #define _ASM_X86_UV_BIOS_H | 
|---|
| 3 | 4 |   | 
|---|
| 4 | 5 |  /* | 
|---|
| 5 | 6 |   * UV BIOS layer definitions. | 
|---|
| 6 | 7 |   * | 
|---|
| 7 |  | - *  This program is free software; you can redistribute it and/or modify  | 
|---|
| 8 |  | - *  it under the terms of the GNU General Public License as published by  | 
|---|
| 9 |  | - *  the Free Software Foundation; either version 2 of the License, or  | 
|---|
| 10 |  | - *  (at your option) any later version.  | 
|---|
| 11 |  | - *  | 
|---|
| 12 |  | - *  This program is distributed in the hope that it will be useful,  | 
|---|
| 13 |  | - *  but WITHOUT ANY WARRANTY; without even the implied warranty of  | 
|---|
| 14 |  | - *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  | 
|---|
| 15 |  | - *  GNU General Public License for more details.  | 
|---|
| 16 |  | - *  | 
|---|
| 17 |  | - *  You should have received a copy of the GNU General Public License  | 
|---|
| 18 |  | - *  along with this program; if not, write to the Free Software  | 
|---|
| 19 |  | - *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA  | 
|---|
| 20 |  | - *  | 
|---|
| 21 |  | - *  Copyright (c) 2008-2009 Silicon Graphics, Inc.  All Rights Reserved.  | 
|---|
| 22 |  | - *  Copyright (c) Russ Anderson <rja@sgi.com>  | 
|---|
 | 8 | + * (C) Copyright 2020 Hewlett Packard Enterprise Development LP  | 
|---|
 | 9 | + * Copyright (C) 2007-2017 Silicon Graphics, Inc. All rights reserved.  | 
|---|
 | 10 | + * Copyright (c) Russ Anderson <rja@sgi.com>  | 
|---|
| 23 | 11 |   */ | 
|---|
| 24 | 12 |   | 
|---|
| 25 | 13 |  #include <linux/rtc.h> | 
|---|
| .. | .. | 
|---|
| 84 | 72 |  	u32	limit;		/* PA bits 56:26 (UV_GAM_RANGE_SHFT) */ | 
|---|
| 85 | 73 |  }; | 
|---|
| 86 | 74 |   | 
|---|
 | 75 | +#define	UV_AT_SIZE	8	/* 7 character arch type + NULL char */  | 
|---|
 | 76 | +struct uv_arch_type_entry {  | 
|---|
 | 77 | +	char	archtype[UV_AT_SIZE];  | 
|---|
 | 78 | +};  | 
|---|
 | 79 | +  | 
|---|
| 87 | 80 |  #define	UV_SYSTAB_SIG			"UVST" | 
|---|
| 88 |  | -#define	UV_SYSTAB_VERSION_1		1	/* UV1/2/3 BIOS version */  | 
|---|
 | 81 | +#define	UV_SYSTAB_VERSION_1		1	/* UV2/3 BIOS version */  | 
|---|
| 89 | 82 |  #define	UV_SYSTAB_VERSION_UV4		0x400	/* UV4 BIOS base version */ | 
|---|
| 90 | 83 |  #define	UV_SYSTAB_VERSION_UV4_1		0x401	/* + gpa_shift */ | 
|---|
| 91 | 84 |  #define	UV_SYSTAB_VERSION_UV4_2		0x402	/* + TYPE_NVRAM/WINDOW/MBOX */ | 
|---|
| 92 | 85 |  #define	UV_SYSTAB_VERSION_UV4_3		0x403	/* - GAM Range PXM Value */ | 
|---|
| 93 | 86 |  #define	UV_SYSTAB_VERSION_UV4_LATEST	UV_SYSTAB_VERSION_UV4_3 | 
|---|
| 94 | 87 |   | 
|---|
 | 88 | +#define	UV_SYSTAB_VERSION_UV5		0x500	/* UV5 GAM base version */  | 
|---|
 | 89 | +#define	UV_SYSTAB_VERSION_UV5_LATEST	UV_SYSTAB_VERSION_UV5  | 
|---|
 | 90 | +  | 
|---|
| 95 | 91 |  #define	UV_SYSTAB_TYPE_UNUSED		0	/* End of table (offset == 0) */ | 
|---|
| 96 | 92 |  #define	UV_SYSTAB_TYPE_GAM_PARAMS	1	/* GAM PARAM conversions */ | 
|---|
| 97 | 93 |  #define	UV_SYSTAB_TYPE_GAM_RNG_TBL	2	/* GAM entry table */ | 
|---|
| 98 |  | -#define	UV_SYSTAB_TYPE_MAX		3  | 
|---|
 | 94 | +#define	UV_SYSTAB_TYPE_ARCH_TYPE	3	/* UV arch type */  | 
|---|
 | 95 | +#define	UV_SYSTAB_TYPE_MAX		4  | 
|---|
| 99 | 96 |   | 
|---|
| 100 | 97 |  /* | 
|---|
| 101 | 98 |   * The UV system table describes specific firmware | 
|---|
| .. | .. | 
|---|
| 136 | 133 |  	UV_MEMPROT_ALLOW_RW | 
|---|
| 137 | 134 |  }; | 
|---|
| 138 | 135 |   | 
|---|
| 139 |  | -/*  | 
|---|
| 140 |  | - * bios calls have 6 parameters  | 
|---|
| 141 |  | - */  | 
|---|
| 142 |  | -extern s64 uv_bios_call(enum uv_bios_cmd, u64, u64, u64, u64, u64);  | 
|---|
| 143 |  | -extern s64 uv_bios_call_irqsave(enum uv_bios_cmd, u64, u64, u64, u64, u64);  | 
|---|
| 144 |  | -extern s64 uv_bios_call_reentrant(enum uv_bios_cmd, u64, u64, u64, u64, u64);  | 
|---|
| 145 |  | -  | 
|---|
| 146 | 136 |  extern s64 uv_bios_get_sn_info(int, int *, long *, long *, long *, long *); | 
|---|
| 147 | 137 |  extern s64 uv_bios_freq_base(u64, u64 *); | 
|---|
| 148 | 138 |  extern int uv_bios_mq_watchlist_alloc(unsigned long, unsigned int, | 
|---|
| .. | .. | 
|---|
| 152 | 142 |  extern s64 uv_bios_reserved_page_pa(u64, u64 *, u64 *, u64 *); | 
|---|
| 153 | 143 |  extern int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus); | 
|---|
| 154 | 144 |   | 
|---|
| 155 |  | -#ifdef CONFIG_EFI  | 
|---|
| 156 |  | -extern void uv_bios_init(void);  | 
|---|
| 157 |  | -#else  | 
|---|
| 158 |  | -void uv_bios_init(void) { }  | 
|---|
| 159 |  | -#endif  | 
|---|
 | 145 | +extern int uv_bios_init(void);  | 
|---|
 | 146 | +extern unsigned long get_uv_systab_phys(bool msg);  | 
|---|
| 160 | 147 |   | 
|---|
| 161 | 148 |  extern unsigned long sn_rtc_cycles_per_second; | 
|---|
| 162 | 149 |  extern int uv_type; | 
|---|
| .. | .. | 
|---|
| 164 | 151 |  extern long sn_coherency_id; | 
|---|
| 165 | 152 |  extern long sn_region_size; | 
|---|
| 166 | 153 |  extern long system_serial_number; | 
|---|
| 167 |  | -#define uv_partition_coherence_id()	(sn_coherency_id)  | 
|---|
| 168 | 154 |   | 
|---|
| 169 | 155 |  extern struct kobject *sgi_uv_kobj;	/* /sys/firmware/sgi_uv */ | 
|---|
| 170 | 156 |   | 
|---|