diff options
author | Jack Steiner <steiner@sgi.com> | 2011-05-11 13:50:28 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-05-25 08:20:13 -0400 |
commit | 2a919596c16b4333af851ff473ebf96e289ab90c (patch) | |
tree | c42043cf772205fe4dfb0ea8d208886ea055a013 /arch/x86/kernel/apic | |
parent | 7ccafc5f75c87853f3c49845d5a884f2376e03ce (diff) |
x86, UV: Add support for SGI UV2 hub chip
This patch adds support for a new version of the SGI UV hub
chip. The hub chip is the node controller that connects multiple
blades into a larger coherent SSI.
For the most part, UV2 is compatible with UV1. The majority of
the changes are in the addresses of MMRs and in a few cases, the
contents of MMRs. These changes are the result in changes in the
system topology such as node configuration, processor types,
maximum nodes, physical address sizes, etc.
Signed-off-by: Jack Steiner <steiner@sgi.com>
Link: http://lkml.kernel.org/r/20110511175028.GA18006@sgi.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/apic')
-rw-r--r-- | arch/x86/kernel/apic/x2apic_uv_x.c | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index f450b683dfcf..b511a011b7d0 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -91,6 +91,10 @@ static int __init early_get_pnodeid(void) | |||
91 | m_n_config.v = uv_early_read_mmr(UVH_RH_GAM_CONFIG_MMR); | 91 | m_n_config.v = uv_early_read_mmr(UVH_RH_GAM_CONFIG_MMR); |
92 | uv_min_hub_revision_id = node_id.s.revision; | 92 | uv_min_hub_revision_id = node_id.s.revision; |
93 | 93 | ||
94 | if (node_id.s.part_number == UV2_HUB_PART_NUMBER) | ||
95 | uv_min_hub_revision_id += UV2_HUB_REVISION_BASE - 1; | ||
96 | |||
97 | uv_hub_info->hub_revision = uv_min_hub_revision_id; | ||
94 | pnode = (node_id.s.node_id >> 1) & ((1 << m_n_config.s.n_skt) - 1); | 98 | pnode = (node_id.s.node_id >> 1) & ((1 << m_n_config.s.n_skt) - 1); |
95 | return pnode; | 99 | return pnode; |
96 | } | 100 | } |
@@ -112,17 +116,25 @@ static void __init early_get_apic_pnode_shift(void) | |||
112 | */ | 116 | */ |
113 | static void __init uv_set_apicid_hibit(void) | 117 | static void __init uv_set_apicid_hibit(void) |
114 | { | 118 | { |
115 | union uvh_lb_target_physical_apic_id_mask_u apicid_mask; | 119 | union uv1h_lb_target_physical_apic_id_mask_u apicid_mask; |
116 | 120 | ||
117 | apicid_mask.v = uv_early_read_mmr(UVH_LB_TARGET_PHYSICAL_APIC_ID_MASK); | 121 | if (is_uv1_hub()) { |
118 | uv_apicid_hibits = apicid_mask.s.bit_enables & UV_APICID_HIBIT_MASK; | 122 | apicid_mask.v = |
123 | uv_early_read_mmr(UV1H_LB_TARGET_PHYSICAL_APIC_ID_MASK); | ||
124 | uv_apicid_hibits = | ||
125 | apicid_mask.s1.bit_enables & UV_APICID_HIBIT_MASK; | ||
126 | } | ||
119 | } | 127 | } |
120 | 128 | ||
121 | static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 129 | static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
122 | { | 130 | { |
123 | int pnodeid; | 131 | int pnodeid, is_uv1, is_uv2; |
124 | 132 | ||
125 | if (!strcmp(oem_id, "SGI")) { | 133 | is_uv1 = !strcmp(oem_id, "SGI"); |
134 | is_uv2 = !strcmp(oem_id, "SGI2"); | ||
135 | if (is_uv1 || is_uv2) { | ||
136 | uv_hub_info->hub_revision = | ||
137 | is_uv1 ? UV1_HUB_REVISION_BASE : UV2_HUB_REVISION_BASE; | ||
126 | pnodeid = early_get_pnodeid(); | 138 | pnodeid = early_get_pnodeid(); |
127 | early_get_apic_pnode_shift(); | 139 | early_get_apic_pnode_shift(); |
128 | x86_platform.is_untracked_pat_range = uv_is_untracked_pat_range; | 140 | x86_platform.is_untracked_pat_range = uv_is_untracked_pat_range; |
@@ -484,12 +496,19 @@ static __init void map_mmr_high(int max_pnode) | |||
484 | static __init void map_mmioh_high(int max_pnode) | 496 | static __init void map_mmioh_high(int max_pnode) |
485 | { | 497 | { |
486 | union uvh_rh_gam_mmioh_overlay_config_mmr_u mmioh; | 498 | union uvh_rh_gam_mmioh_overlay_config_mmr_u mmioh; |
487 | int shift = UVH_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR_BASE_SHFT; | 499 | int shift; |
488 | 500 | ||
489 | mmioh.v = uv_read_local_mmr(UVH_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR); | 501 | mmioh.v = uv_read_local_mmr(UVH_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR); |
490 | if (mmioh.s.enable) | 502 | if (is_uv1_hub() && mmioh.s1.enable) { |
491 | map_high("MMIOH", mmioh.s.base, shift, mmioh.s.m_io, | 503 | shift = UV1H_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR_BASE_SHFT; |
504 | map_high("MMIOH", mmioh.s1.base, shift, mmioh.s1.m_io, | ||
505 | max_pnode, map_uc); | ||
506 | } | ||
507 | if (is_uv2_hub() && mmioh.s2.enable) { | ||
508 | shift = UV2H_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR_BASE_SHFT; | ||
509 | map_high("MMIOH", mmioh.s2.base, shift, mmioh.s2.m_io, | ||
492 | max_pnode, map_uc); | 510 | max_pnode, map_uc); |
511 | } | ||
493 | } | 512 | } |
494 | 513 | ||
495 | static __init void map_low_mmrs(void) | 514 | static __init void map_low_mmrs(void) |
@@ -736,13 +755,14 @@ void __init uv_system_init(void) | |||
736 | unsigned long mmr_base, present, paddr; | 755 | unsigned long mmr_base, present, paddr; |
737 | unsigned short pnode_mask, pnode_io_mask; | 756 | unsigned short pnode_mask, pnode_io_mask; |
738 | 757 | ||
758 | printk(KERN_INFO "UV: Found %s hub\n", is_uv1_hub() ? "UV1" : "UV2"); | ||
739 | map_low_mmrs(); | 759 | map_low_mmrs(); |
740 | 760 | ||
741 | m_n_config.v = uv_read_local_mmr(UVH_RH_GAM_CONFIG_MMR ); | 761 | m_n_config.v = uv_read_local_mmr(UVH_RH_GAM_CONFIG_MMR ); |
742 | m_val = m_n_config.s.m_skt; | 762 | m_val = m_n_config.s.m_skt; |
743 | n_val = m_n_config.s.n_skt; | 763 | n_val = m_n_config.s.n_skt; |
744 | mmioh.v = uv_read_local_mmr(UVH_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR); | 764 | mmioh.v = uv_read_local_mmr(UVH_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR); |
745 | n_io = mmioh.s.n_io; | 765 | n_io = is_uv1_hub() ? mmioh.s1.n_io : mmioh.s2.n_io; |
746 | mmr_base = | 766 | mmr_base = |
747 | uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR) & | 767 | uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR) & |
748 | ~UV_MMR_ENABLE; | 768 | ~UV_MMR_ENABLE; |
@@ -811,6 +831,8 @@ void __init uv_system_init(void) | |||
811 | */ | 831 | */ |
812 | uv_cpu_hub_info(cpu)->pnode_mask = pnode_mask; | 832 | uv_cpu_hub_info(cpu)->pnode_mask = pnode_mask; |
813 | uv_cpu_hub_info(cpu)->apic_pnode_shift = uvh_apicid.s.pnode_shift; | 833 | uv_cpu_hub_info(cpu)->apic_pnode_shift = uvh_apicid.s.pnode_shift; |
834 | uv_cpu_hub_info(cpu)->hub_revision = uv_hub_info->hub_revision; | ||
835 | |||
814 | pnode = uv_apicid_to_pnode(apicid); | 836 | pnode = uv_apicid_to_pnode(apicid); |
815 | blade = boot_pnode_to_blade(pnode); | 837 | blade = boot_pnode_to_blade(pnode); |
816 | lcpu = uv_blade_info[blade].nr_possible_cpus; | 838 | lcpu = uv_blade_info[blade].nr_possible_cpus; |