diff options
author | Jack Steiner <steiner@sgi.com> | 2008-05-06 16:18:57 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-05-14 17:22:04 -0400 |
commit | 2224661494278bfc1c35b392cf6ee6f58e1d5e64 (patch) | |
tree | 1a0bd165aedfd28191a017901490c5bf3fd9f328 /arch/ia64 | |
parent | 7868f1ed84696d3cca83558e8dd459f20a36d077 (diff) |
[IA64] machvec support for SGI UV platform
This patch adds the basic IA64 machvec infrastructure to support
the SGI "UV" platform.
Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/Kconfig | 13 | ||||
-rw-r--r-- | arch/ia64/Makefile | 2 | ||||
-rw-r--r-- | arch/ia64/kernel/acpi.c | 7 | ||||
-rw-r--r-- | arch/ia64/uv/Makefile | 12 | ||||
-rw-r--r-- | arch/ia64/uv/kernel/Makefile | 13 | ||||
-rw-r--r-- | arch/ia64/uv/kernel/machvec.c | 11 | ||||
-rw-r--r-- | arch/ia64/uv/kernel/setup.c | 98 |
7 files changed, 154 insertions, 2 deletions
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 0df5f6f75edf..16be41446b5b 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -135,6 +135,7 @@ config IA64_GENERIC | |||
135 | HP-zx1/sx1000 For HP systems | 135 | HP-zx1/sx1000 For HP systems |
136 | HP-zx1/sx1000+swiotlb For HP systems with (broken) DMA-constrained devices. | 136 | HP-zx1/sx1000+swiotlb For HP systems with (broken) DMA-constrained devices. |
137 | SGI-SN2 For SGI Altix systems | 137 | SGI-SN2 For SGI Altix systems |
138 | SGI-UV For SGI UV systems | ||
138 | Ski-simulator For the HP simulator <http://www.hpl.hp.com/research/linux/ski/> | 139 | Ski-simulator For the HP simulator <http://www.hpl.hp.com/research/linux/ski/> |
139 | 140 | ||
140 | If you don't know what to do, choose "generic". | 141 | If you don't know what to do, choose "generic". |
@@ -170,6 +171,18 @@ config IA64_SGI_SN2 | |||
170 | to select this option. If in doubt, select ia64 generic support | 171 | to select this option. If in doubt, select ia64 generic support |
171 | instead. | 172 | instead. |
172 | 173 | ||
174 | config IA64_SGI_UV` | ||
175 | bool "SGI-UV`" | ||
176 | select NUMA | ||
177 | select ACPI_NUMA | ||
178 | select SWIOTLB | ||
179 | help | ||
180 | Selecting this option will optimize the kernel for use on UV based | ||
181 | systems, but the resulting kernel binary will not run on other | ||
182 | types of ia64 systems. If you have an SGI UV system, it's safe | ||
183 | to select this option. If in doubt, select ia64 generic support | ||
184 | instead. | ||
185 | |||
173 | config IA64_HP_SIM | 186 | config IA64_HP_SIM |
174 | bool "Ski-simulator" | 187 | bool "Ski-simulator" |
175 | select SWIOTLB | 188 | select SWIOTLB |
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile index ec4cca477f49..88f1a55c6c94 100644 --- a/arch/ia64/Makefile +++ b/arch/ia64/Makefile | |||
@@ -63,7 +63,7 @@ drivers-$(CONFIG_PCI) += arch/ia64/pci/ | |||
63 | drivers-$(CONFIG_IA64_HP_SIM) += arch/ia64/hp/sim/ | 63 | drivers-$(CONFIG_IA64_HP_SIM) += arch/ia64/hp/sim/ |
64 | drivers-$(CONFIG_IA64_HP_ZX1) += arch/ia64/hp/common/ arch/ia64/hp/zx1/ | 64 | drivers-$(CONFIG_IA64_HP_ZX1) += arch/ia64/hp/common/ arch/ia64/hp/zx1/ |
65 | drivers-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += arch/ia64/hp/common/ arch/ia64/hp/zx1/ | 65 | drivers-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += arch/ia64/hp/common/ arch/ia64/hp/zx1/ |
66 | drivers-$(CONFIG_IA64_GENERIC) += arch/ia64/hp/common/ arch/ia64/hp/zx1/ arch/ia64/hp/sim/ arch/ia64/sn/ | 66 | drivers-$(CONFIG_IA64_GENERIC) += arch/ia64/hp/common/ arch/ia64/hp/zx1/ arch/ia64/hp/sim/ arch/ia64/sn/ arch/ia64/uv/ |
67 | drivers-$(CONFIG_OPROFILE) += arch/ia64/oprofile/ | 67 | drivers-$(CONFIG_OPROFILE) += arch/ia64/oprofile/ |
68 | 68 | ||
69 | boot := arch/ia64/hp/sim/boot | 69 | boot := arch/ia64/hp/sim/boot |
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 19709a079635..6ff6815d34ef 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
@@ -117,7 +117,10 @@ acpi_get_sysname(void) | |||
117 | if (!strcmp(hdr->oem_id, "HP")) { | 117 | if (!strcmp(hdr->oem_id, "HP")) { |
118 | return "hpzx1"; | 118 | return "hpzx1"; |
119 | } else if (!strcmp(hdr->oem_id, "SGI")) { | 119 | } else if (!strcmp(hdr->oem_id, "SGI")) { |
120 | return "sn2"; | 120 | if (!strcmp(hdr->oem_table_id + 4, "UV")) |
121 | return "uv"; | ||
122 | else | ||
123 | return "sn2"; | ||
121 | } | 124 | } |
122 | 125 | ||
123 | return "dig"; | 126 | return "dig"; |
@@ -130,6 +133,8 @@ acpi_get_sysname(void) | |||
130 | return "hpzx1_swiotlb"; | 133 | return "hpzx1_swiotlb"; |
131 | # elif defined (CONFIG_IA64_SGI_SN2) | 134 | # elif defined (CONFIG_IA64_SGI_SN2) |
132 | return "sn2"; | 135 | return "sn2"; |
136 | # elif defined (CONFIG_IA64_SGI_UV) | ||
137 | return "uv"; | ||
133 | # elif defined (CONFIG_IA64_DIG) | 138 | # elif defined (CONFIG_IA64_DIG) |
134 | return "dig"; | 139 | return "dig"; |
135 | # else | 140 | # else |
diff --git a/arch/ia64/uv/Makefile b/arch/ia64/uv/Makefile new file mode 100644 index 000000000000..aa9f91947c49 --- /dev/null +++ b/arch/ia64/uv/Makefile | |||
@@ -0,0 +1,12 @@ | |||
1 | # arch/ia64/uv/Makefile | ||
2 | # | ||
3 | # This file is subject to the terms and conditions of the GNU General Public | ||
4 | # License. See the file "COPYING" in the main directory of this archive | ||
5 | # for more details. | ||
6 | # | ||
7 | # Copyright (C) 2008 Silicon Graphics, Inc. All Rights Reserved. | ||
8 | # | ||
9 | # Makefile for the sn uv subplatform | ||
10 | # | ||
11 | |||
12 | obj-y += kernel/ | ||
diff --git a/arch/ia64/uv/kernel/Makefile b/arch/ia64/uv/kernel/Makefile new file mode 100644 index 000000000000..8d92b4684d8e --- /dev/null +++ b/arch/ia64/uv/kernel/Makefile | |||
@@ -0,0 +1,13 @@ | |||
1 | # arch/ia64/uv/kernel/Makefile | ||
2 | # | ||
3 | # This file is subject to the terms and conditions of the GNU General Public | ||
4 | # License. See the file "COPYING" in the main directory of this archive | ||
5 | # for more details. | ||
6 | # | ||
7 | # Copyright (C) 2008 Silicon Graphics, Inc. All Rights Reserved. | ||
8 | # | ||
9 | |||
10 | EXTRA_CFLAGS += -Iarch/ia64/sn/include | ||
11 | |||
12 | obj-y += setup.o | ||
13 | obj-$(CONFIG_IA64_GENERIC) += machvec.o | ||
diff --git a/arch/ia64/uv/kernel/machvec.c b/arch/ia64/uv/kernel/machvec.c new file mode 100644 index 000000000000..50737a9dca74 --- /dev/null +++ b/arch/ia64/uv/kernel/machvec.c | |||
@@ -0,0 +1,11 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved. | ||
7 | */ | ||
8 | |||
9 | #define MACHVEC_PLATFORM_NAME uv | ||
10 | #define MACHVEC_PLATFORM_HEADER <asm/machvec_uv.h> | ||
11 | #include <asm/machvec_init.h> | ||
diff --git a/arch/ia64/uv/kernel/setup.c b/arch/ia64/uv/kernel/setup.c new file mode 100644 index 000000000000..9aa743203c3c --- /dev/null +++ b/arch/ia64/uv/kernel/setup.c | |||
@@ -0,0 +1,98 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * SGI UV Core Functions | ||
7 | * | ||
8 | * Copyright (C) 2008 Silicon Graphics, Inc. All rights reserved. | ||
9 | */ | ||
10 | |||
11 | #include <linux/module.h> | ||
12 | #include <linux/percpu.h> | ||
13 | #include <asm/sn/simulator.h> | ||
14 | #include <asm/uv/uv_mmrs.h> | ||
15 | #include <asm/uv/uv_hub.h> | ||
16 | |||
17 | DEFINE_PER_CPU(struct uv_hub_info_s, __uv_hub_info); | ||
18 | EXPORT_PER_CPU_SYMBOL_GPL(__uv_hub_info); | ||
19 | |||
20 | |||
21 | struct redir_addr { | ||
22 | unsigned long redirect; | ||
23 | unsigned long alias; | ||
24 | }; | ||
25 | |||
26 | #define DEST_SHIFT UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR_DEST_BASE_SHFT | ||
27 | |||
28 | static __initdata struct redir_addr redir_addrs[] = { | ||
29 | {UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR, UVH_SI_ALIAS0_OVERLAY_CONFIG}, | ||
30 | {UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_1_MMR, UVH_SI_ALIAS1_OVERLAY_CONFIG}, | ||
31 | {UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_2_MMR, UVH_SI_ALIAS2_OVERLAY_CONFIG}, | ||
32 | }; | ||
33 | |||
34 | static __init void get_lowmem_redirect(unsigned long *base, unsigned long *size) | ||
35 | { | ||
36 | union uvh_si_alias0_overlay_config_u alias; | ||
37 | union uvh_rh_gam_alias210_redirect_config_2_mmr_u redirect; | ||
38 | int i; | ||
39 | |||
40 | for (i = 0; i < ARRAY_SIZE(redir_addrs); i++) { | ||
41 | alias.v = uv_read_local_mmr(redir_addrs[i].alias); | ||
42 | if (alias.s.base == 0) { | ||
43 | *size = (1UL << alias.s.m_alias); | ||
44 | redirect.v = uv_read_local_mmr(redir_addrs[i].redirect); | ||
45 | *base = (unsigned long)redirect.s.dest_base << DEST_SHIFT; | ||
46 | return; | ||
47 | } | ||
48 | } | ||
49 | BUG(); | ||
50 | } | ||
51 | |||
52 | void __init uv_setup(char **cmdline_p) | ||
53 | { | ||
54 | union uvh_si_addr_map_config_u m_n_config; | ||
55 | union uvh_node_id_u node_id; | ||
56 | unsigned long gnode_upper; | ||
57 | int nid, cpu, m_val, n_val; | ||
58 | unsigned long mmr_base, lowmem_redir_base, lowmem_redir_size; | ||
59 | |||
60 | if (IS_MEDUSA()) { | ||
61 | lowmem_redir_base = 0; | ||
62 | lowmem_redir_size = 0; | ||
63 | node_id.v = 0; | ||
64 | m_n_config.s.m_skt = 37; | ||
65 | m_n_config.s.n_skt = 0; | ||
66 | mmr_base = 0; | ||
67 | } else { | ||
68 | get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size); | ||
69 | node_id.v = uv_read_local_mmr(UVH_NODE_ID); | ||
70 | m_n_config.v = uv_read_local_mmr(UVH_SI_ADDR_MAP_CONFIG); | ||
71 | mmr_base = | ||
72 | uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR) & | ||
73 | ~UV_MMR_ENABLE; | ||
74 | } | ||
75 | |||
76 | m_val = m_n_config.s.m_skt; | ||
77 | n_val = m_n_config.s.n_skt; | ||
78 | printk(KERN_DEBUG "UV: global MMR base 0x%lx\n", mmr_base); | ||
79 | |||
80 | gnode_upper = (((unsigned long)node_id.s.node_id) & | ||
81 | ~((1 << n_val) - 1)) << m_val; | ||
82 | |||
83 | for_each_present_cpu(cpu) { | ||
84 | nid = cpu_to_node(cpu); | ||
85 | uv_cpu_hub_info(cpu)->lowmem_remap_base = lowmem_redir_base; | ||
86 | uv_cpu_hub_info(cpu)->lowmem_remap_top = | ||
87 | lowmem_redir_base + lowmem_redir_size; | ||
88 | uv_cpu_hub_info(cpu)->m_val = m_val; | ||
89 | uv_cpu_hub_info(cpu)->n_val = m_val; | ||
90 | uv_cpu_hub_info(cpu)->pnode_mask = (1 << n_val) -1; | ||
91 | uv_cpu_hub_info(cpu)->gpa_mask = (1 << (m_val + n_val)) - 1; | ||
92 | uv_cpu_hub_info(cpu)->gnode_upper = gnode_upper; | ||
93 | uv_cpu_hub_info(cpu)->global_mmr_base = mmr_base; | ||
94 | uv_cpu_hub_info(cpu)->coherency_domain_number = 0;/* ZZZ */ | ||
95 | printk(KERN_DEBUG "UV cpu %d, nid %d\n", cpu, nid); | ||
96 | } | ||
97 | } | ||
98 | |||