hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/arch/ia64/uv/kernel/setup.c
....@@ -8,24 +8,19 @@
88 * Copyright (C) 2008 Silicon Graphics, Inc. All rights reserved.
99 */
1010
11
+#include <linux/acpi.h>
12
+#include <linux/efi.h>
1113 #include <linux/module.h>
1214 #include <linux/percpu.h>
13
-#include <asm/sn/simulator.h>
15
+#include <asm/uv/uv.h>
1416 #include <asm/uv/uv_mmrs.h>
1517 #include <asm/uv/uv_hub.h>
1618
19
+bool ia64_is_uv;
20
+EXPORT_SYMBOL_GPL(ia64_is_uv);
21
+
1722 DEFINE_PER_CPU(struct uv_hub_info_s, __uv_hub_info);
1823 EXPORT_PER_CPU_SYMBOL_GPL(__uv_hub_info);
19
-
20
-#ifdef CONFIG_IA64_SGI_UV
21
-int sn_prom_type;
22
-long sn_partition_id;
23
-EXPORT_SYMBOL(sn_partition_id);
24
-long sn_coherency_id;
25
-EXPORT_SYMBOL_GPL(sn_coherency_id);
26
-long sn_region_size;
27
-EXPORT_SYMBOL(sn_region_size);
28
-#endif
2924
3025 struct redir_addr {
3126 unsigned long redirect;
....@@ -58,6 +53,34 @@
5853 BUG();
5954 }
6055
56
+void __init uv_probe_system_type(void)
57
+{
58
+ struct acpi_table_rsdp *rsdp;
59
+ struct acpi_table_xsdt *xsdt;
60
+
61
+ if (efi.acpi20 == EFI_INVALID_TABLE_ADDR) {
62
+ pr_err("ACPI 2.0 RSDP not found.\n");
63
+ return;
64
+ }
65
+
66
+ rsdp = (struct acpi_table_rsdp *)__va(efi.acpi20);
67
+ if (strncmp(rsdp->signature, ACPI_SIG_RSDP, sizeof(ACPI_SIG_RSDP) - 1)) {
68
+ pr_err("ACPI 2.0 RSDP signature incorrect.\n");
69
+ return;
70
+ }
71
+
72
+ xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_physical_address);
73
+ if (strncmp(xsdt->header.signature, ACPI_SIG_XSDT,
74
+ sizeof(ACPI_SIG_XSDT) - 1)) {
75
+ pr_err("ACPI 2.0 XSDT signature incorrect.\n");
76
+ return;
77
+ }
78
+
79
+ if (!strcmp(xsdt->header.oem_id, "SGI") &&
80
+ !strcmp(xsdt->header.oem_table_id + 4, "UV"))
81
+ ia64_is_uv = true;
82
+}
83
+
6184 void __init uv_setup(char **cmdline_p)
6285 {
6386 union uvh_si_addr_map_config_u m_n_config;
....@@ -66,30 +89,11 @@
6689 int nid, cpu, m_val, n_val;
6790 unsigned long mmr_base, lowmem_redir_base, lowmem_redir_size;
6891
69
- if (IS_MEDUSA()) {
70
- lowmem_redir_base = 0;
71
- lowmem_redir_size = 0;
72
- node_id.v = 0;
73
- m_n_config.s.m_skt = 37;
74
- m_n_config.s.n_skt = 0;
75
- mmr_base = 0;
76
-#if 0
77
- /* Need BIOS calls - TDB */
78
- if (!ia64_sn_is_fake_prom())
79
- sn_prom_type = 1;
80
- else
81
-#endif
82
- sn_prom_type = 2;
83
- printk(KERN_INFO "Running on medusa with %s PROM\n",
84
- (sn_prom_type == 1) ? "real" : "fake");
85
- } else {
86
- get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size);
87
- node_id.v = uv_read_local_mmr(UVH_NODE_ID);
88
- m_n_config.v = uv_read_local_mmr(UVH_SI_ADDR_MAP_CONFIG);
89
- mmr_base =
90
- uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR) &
91
- ~UV_MMR_ENABLE;
92
- }
92
+ get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size);
93
+ node_id.v = uv_read_local_mmr(UVH_NODE_ID);
94
+ m_n_config.v = uv_read_local_mmr(UVH_SI_ADDR_MAP_CONFIG);
95
+ mmr_base = uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR) &
96
+ ~UV_MMR_ENABLE;
9397
9498 m_val = m_n_config.s.m_skt;
9599 n_val = m_n_config.s.n_skt;