forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/misc/sgi-xp/xp_uv.c
....@@ -3,6 +3,7 @@
33 * License. See the file "COPYING" in the main directory of this archive
44 * for more details.
55 *
6
+ * (C) Copyright 2020 Hewlett Packard Enterprise Development LP
67 * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.
78 */
89
....@@ -17,7 +18,7 @@
1718 #include <asm/uv/uv_hub.h>
1819 #if defined CONFIG_X86_64
1920 #include <asm/uv/bios.h>
20
-#elif defined CONFIG_IA64_GENERIC || defined CONFIG_IA64_SGI_UV
21
+#elif defined CONFIG_IA64_SGI_UV
2122 #include <asm/sn/sn_sal.h>
2223 #endif
2324 #include "../sgi-gru/grukservices.h"
....@@ -99,7 +100,7 @@
99100 return xpBiosError;
100101 }
101102
102
-#elif defined CONFIG_IA64_GENERIC || defined CONFIG_IA64_SGI_UV
103
+#elif defined CONFIG_IA64_SGI_UV
103104 u64 nasid_array;
104105
105106 ret = sn_change_memprotect(phys_addr, size, SN_MEMPROT_ACCESS_CLASS_1,
....@@ -129,7 +130,7 @@
129130 return xpBiosError;
130131 }
131132
132
-#elif defined CONFIG_IA64_GENERIC || defined CONFIG_IA64_SGI_UV
133
+#elif defined CONFIG_IA64_SGI_UV
133134 u64 nasid_array;
134135
135136 ret = sn_change_memprotect(phys_addr, size, SN_MEMPROT_ACCESS_CLASS_0,
....@@ -148,12 +149,15 @@
148149 enum xp_retval
149150 xp_init_uv(void)
150151 {
151
- BUG_ON(!is_uv());
152
+ WARN_ON(!is_uv_system());
153
+ if (!is_uv_system())
154
+ return xpUnsupported;
152155
153156 xp_max_npartitions = XP_MAX_NPARTITIONS_UV;
157
+#ifdef CONFIG_X86
154158 xp_partition_id = sn_partition_id;
155159 xp_region_size = sn_region_size;
156
-
160
+#endif
157161 xp_pa = xp_pa_uv;
158162 xp_socket_pa = xp_socket_pa_uv;
159163 xp_remote_memcpy = xp_remote_memcpy_uv;
....@@ -167,5 +171,5 @@
167171 void
168172 xp_exit_uv(void)
169173 {
170
- BUG_ON(!is_uv());
174
+ WARN_ON(!is_uv_system());
171175 }