diff options
Diffstat (limited to 'arch/x86/include/asm/uv/bios.h')
-rw-r--r-- | arch/x86/include/asm/uv/bios.h | 59 |
1 files changed, 57 insertions, 2 deletions
diff --git a/arch/x86/include/asm/uv/bios.h b/arch/x86/include/asm/uv/bios.h index 71605c7d5c5c..c852590254d5 100644 --- a/arch/x86/include/asm/uv/bios.h +++ b/arch/x86/include/asm/uv/bios.h | |||
@@ -51,15 +51,66 @@ enum { | |||
51 | BIOS_STATUS_UNAVAIL = -EBUSY | 51 | BIOS_STATUS_UNAVAIL = -EBUSY |
52 | }; | 52 | }; |
53 | 53 | ||
54 | /* Address map parameters */ | ||
55 | struct uv_gam_parameters { | ||
56 | u64 mmr_base; | ||
57 | u64 gru_base; | ||
58 | u8 mmr_shift; /* Convert PNode to MMR space offset */ | ||
59 | u8 gru_shift; /* Convert PNode to GRU space offset */ | ||
60 | u8 gpa_shift; /* Size of offset field in GRU phys addr */ | ||
61 | u8 unused1; | ||
62 | }; | ||
63 | |||
64 | /* UV_TABLE_GAM_RANGE_ENTRY values */ | ||
65 | #define UV_GAM_RANGE_TYPE_UNUSED 0 /* End of table */ | ||
66 | #define UV_GAM_RANGE_TYPE_RAM 1 /* Normal RAM */ | ||
67 | #define UV_GAM_RANGE_TYPE_NVRAM 2 /* Non-volatile memory */ | ||
68 | #define UV_GAM_RANGE_TYPE_NV_WINDOW 3 /* NVMDIMM block window */ | ||
69 | #define UV_GAM_RANGE_TYPE_NV_MAILBOX 4 /* NVMDIMM mailbox */ | ||
70 | #define UV_GAM_RANGE_TYPE_HOLE 5 /* Unused address range */ | ||
71 | #define UV_GAM_RANGE_TYPE_MAX 6 | ||
72 | |||
73 | /* The structure stores PA bits 56:26, for 64MB granularity */ | ||
74 | #define UV_GAM_RANGE_SHFT 26 /* 64MB */ | ||
75 | |||
76 | struct uv_gam_range_entry { | ||
77 | char type; /* Entry type: GAM_RANGE_TYPE_UNUSED, etc. */ | ||
78 | char unused1; | ||
79 | u16 nasid; /* HNasid */ | ||
80 | u16 sockid; /* Socket ID, high bits of APIC ID */ | ||
81 | u16 pnode; /* Index to MMR and GRU spaces */ | ||
82 | u32 pxm; /* ACPI proximity domain number */ | ||
83 | u32 limit; /* PA bits 56:26 (UV_GAM_RANGE_SHFT) */ | ||
84 | }; | ||
85 | |||
86 | #define UV_SYSTAB_SIG "UVST" | ||
87 | #define UV_SYSTAB_VERSION_1 1 /* UV1/2/3 BIOS version */ | ||
88 | #define UV_SYSTAB_VERSION_UV4 0x400 /* UV4 BIOS base version */ | ||
89 | #define UV_SYSTAB_VERSION_UV4_1 0x401 /* + gpa_shift */ | ||
90 | #define UV_SYSTAB_VERSION_UV4_2 0x402 /* + TYPE_NVRAM/WINDOW/MBOX */ | ||
91 | #define UV_SYSTAB_VERSION_UV4_LATEST UV_SYSTAB_VERSION_UV4_2 | ||
92 | |||
93 | #define UV_SYSTAB_TYPE_UNUSED 0 /* End of table (offset == 0) */ | ||
94 | #define UV_SYSTAB_TYPE_GAM_PARAMS 1 /* GAM PARAM conversions */ | ||
95 | #define UV_SYSTAB_TYPE_GAM_RNG_TBL 2 /* GAM entry table */ | ||
96 | #define UV_SYSTAB_TYPE_MAX 3 | ||
97 | |||
54 | /* | 98 | /* |
55 | * The UV system table describes specific firmware | 99 | * The UV system table describes specific firmware |
56 | * capabilities available to the Linux kernel at runtime. | 100 | * capabilities available to the Linux kernel at runtime. |
57 | */ | 101 | */ |
58 | struct uv_systab { | 102 | struct uv_systab { |
59 | char signature[4]; /* must be "UVST" */ | 103 | char signature[4]; /* must be UV_SYSTAB_SIG */ |
60 | u32 revision; /* distinguish different firmware revs */ | 104 | u32 revision; /* distinguish different firmware revs */ |
61 | u64 function; /* BIOS runtime callback function ptr */ | 105 | u64 function; /* BIOS runtime callback function ptr */ |
106 | u32 size; /* systab size (starting with _VERSION_UV4) */ | ||
107 | struct { | ||
108 | u32 type:8; /* type of entry */ | ||
109 | u32 offset:24; /* byte offset from struct start to entry */ | ||
110 | } entry[1]; /* additional entries follow */ | ||
62 | }; | 111 | }; |
112 | extern struct uv_systab *uv_systab; | ||
113 | /* (... end of definitions from UV BIOS ...) */ | ||
63 | 114 | ||
64 | enum { | 115 | enum { |
65 | BIOS_FREQ_BASE_PLATFORM = 0, | 116 | BIOS_FREQ_BASE_PLATFORM = 0, |
@@ -99,7 +150,11 @@ extern s64 uv_bios_change_memprotect(u64, u64, enum uv_memprotect); | |||
99 | extern s64 uv_bios_reserved_page_pa(u64, u64 *, u64 *, u64 *); | 150 | extern s64 uv_bios_reserved_page_pa(u64, u64 *, u64 *, u64 *); |
100 | extern int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus); | 151 | extern int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus); |
101 | 152 | ||
153 | #ifdef CONFIG_EFI | ||
102 | extern void uv_bios_init(void); | 154 | extern void uv_bios_init(void); |
155 | #else | ||
156 | void uv_bios_init(void) { } | ||
157 | #endif | ||
103 | 158 | ||
104 | extern unsigned long sn_rtc_cycles_per_second; | 159 | extern unsigned long sn_rtc_cycles_per_second; |
105 | extern int uv_type; | 160 | extern int uv_type; |
@@ -107,7 +162,7 @@ extern long sn_partition_id; | |||
107 | extern long sn_coherency_id; | 162 | extern long sn_coherency_id; |
108 | extern long sn_region_size; | 163 | extern long sn_region_size; |
109 | extern long system_serial_number; | 164 | extern long system_serial_number; |
110 | #define partition_coherence_id() (sn_coherency_id) | 165 | #define uv_partition_coherence_id() (sn_coherency_id) |
111 | 166 | ||
112 | extern struct kobject *sgi_uv_kobj; /* /sys/firmware/sgi_uv */ | 167 | extern struct kobject *sgi_uv_kobj; /* /sys/firmware/sgi_uv */ |
113 | 168 | ||