linux/arch/x86/include/asm/uv/bios.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef _ASM_X86_UV_BIOS_H
#define _ASM_X86_UV_BIOS_H

/*
 * UV BIOS layer definitions.
 *
 * (C) Copyright 2020 Hewlett Packard Enterprise Development LP
 * Copyright (C) 2007-2017 Silicon Graphics, Inc. All rights reserved.
 * Copyright (c) Russ Anderson <[email protected]>
 */

#include <linux/efi.h>
#include <linux/rtc.h>

/*
 * Values for the BIOS calls.  It is passed as the first * argument in the
 * BIOS call.  Passing any other value in the first argument will result
 * in a BIOS_STATUS_UNIMPLEMENTED return status.
 */
enum uv_bios_cmd {};

#define UV_BIOS_EXTRA
#define UV_BIOS_GET_PCI_TOPOLOGY
#define UV_BIOS_GET_GEOINFO

#define UV_BIOS_EXTRA_OP_MEM_COPYIN
#define UV_BIOS_EXTRA_OP_MEM_COPYOUT
#define UV_BIOS_EXTRA_OP_MASK
#define UV_BIOS_EXTRA_GET_HEAPSIZE
#define UV_BIOS_EXTRA_INSTALL_HEAP
#define UV_BIOS_EXTRA_MASTER_NASID
#define UV_BIOS_EXTRA_OBJECT_COUNT
#define UV_BIOS_EXTRA_ENUM_OBJECTS
#define UV_BIOS_EXTRA_ENUM_PORTS

/*
 * Status values returned from a BIOS call.
 */
enum {};

/* Address map parameters */
struct uv_gam_parameters {};

/* UV_TABLE_GAM_RANGE_ENTRY values */
#define UV_GAM_RANGE_TYPE_UNUSED
#define UV_GAM_RANGE_TYPE_RAM
#define UV_GAM_RANGE_TYPE_NVRAM
#define UV_GAM_RANGE_TYPE_NV_WINDOW
#define UV_GAM_RANGE_TYPE_NV_MAILBOX
#define UV_GAM_RANGE_TYPE_HOLE
#define UV_GAM_RANGE_TYPE_MAX

/* The structure stores PA bits 56:26, for 64MB granularity */
#define UV_GAM_RANGE_SHFT

struct uv_gam_range_entry {};

#define UV_AT_SIZE
struct uv_arch_type_entry {};

#define UV_SYSTAB_SIG
#define UV_SYSTAB_VERSION_1
#define UV_SYSTAB_VERSION_UV4
#define UV_SYSTAB_VERSION_UV4_1
#define UV_SYSTAB_VERSION_UV4_2
#define UV_SYSTAB_VERSION_UV4_3
#define UV_SYSTAB_VERSION_UV4_LATEST

#define UV_SYSTAB_VERSION_UV5
#define UV_SYSTAB_VERSION_UV5_LATEST

#define UV_SYSTAB_TYPE_UNUSED
#define UV_SYSTAB_TYPE_GAM_PARAMS
#define UV_SYSTAB_TYPE_GAM_RNG_TBL
#define UV_SYSTAB_TYPE_ARCH_TYPE
#define UV_SYSTAB_TYPE_MAX

/*
 * The UV system table describes specific firmware
 * capabilities available to the Linux kernel at runtime.
 */
struct uv_systab {};
extern struct uv_systab *uv_systab;

#define UV_BIOS_MAXSTRING
struct uv_bios_hub_info {};

struct uv_bios_port_info {};

/* (... end of definitions from UV BIOS ...) */

enum {};

partition_info_u;

enum uv_memprotect {};

extern s64 uv_bios_get_sn_info(int, int *, long *, long *, long *, long *);
extern s64 uv_bios_freq_base(u64, u64 *);
extern int uv_bios_mq_watchlist_alloc(unsigned long, unsigned int,
					unsigned long *);
extern int uv_bios_mq_watchlist_free(int, int);
extern s64 uv_bios_change_memprotect(u64, u64, enum uv_memprotect);
extern s64 uv_bios_reserved_page_pa(u64, u64 *, u64 *, u64 *);
extern int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus);

extern s64 uv_bios_get_master_nasid(u64 sz, u64 *nasid);
extern s64 uv_bios_get_heapsize(u64 nasid, u64 sz, u64 *heap_sz);
extern s64 uv_bios_install_heap(u64 nasid, u64 sz, u64 *heap);
extern s64 uv_bios_obj_count(u64 nasid, u64 sz, u64 *objcnt);
extern s64 uv_bios_enum_objs(u64 nasid, u64 sz, u64 *objbuf);
extern s64 uv_bios_enum_ports(u64 nasid, u64 obj_id, u64 sz, u64 *portbuf);
extern s64 uv_bios_get_geoinfo(u64 nasid, u64 sz, u64 *geo);
extern s64 uv_bios_get_pci_topology(u64 sz, u64 *buf);

extern int uv_bios_init(void);
extern unsigned long get_uv_systab_phys(bool msg);

extern unsigned long sn_rtc_cycles_per_second;
extern int uv_type;
extern long sn_partition_id;
extern long sn_coherency_id;
extern long sn_region_size;
extern long system_serial_number;
extern ssize_t uv_get_archtype(char *buf, int len);
extern int uv_get_hubless_system(void);

extern struct kobject *sgi_uv_kobj;	/* /sys/firmware/sgi_uv */

/*
 * EFI runtime lock; cf. firmware/efi/runtime-wrappers.c for details
 */
extern struct semaphore __efi_uv_runtime_lock;

#endif /* _ASM_X86_UV_BIOS_H */