aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-03 18:48:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-03 18:48:23 -0400
commit3de0ef8d0d3350964720cad2a0a72984f1bb81ba (patch)
tree86af0fe2a66c9975d9740e82a7ae1530280b8b38
parent06b77b97338e906e8af73a9b5f97b9162aac239d (diff)
parentfe455b17de6c881eecf4f9784c3b0483a5e3d19e (diff)
Merge branch 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next
Pull x86/UV changes from Ingo Molnar: "Continued updates for SGI UV 3 hardware support" * 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/UV: Fix conditional in gru_exit() x86/UV: Set n_lshift based on GAM_GR_CONFIG MMR for UV3
-rw-r--r--arch/x86/include/asm/uv/uv_hub.h12
-rw-r--r--arch/x86/include/asm/uv/uv_mmrs.h42
-rw-r--r--arch/x86/kernel/apic/x2apic_uv_x.c26
-rw-r--r--drivers/misc/sgi-gru/grufile.c11
4 files changed, 71 insertions, 20 deletions
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h
index a30836c8ac4d..c63e925fd6b7 100644
--- a/arch/x86/include/asm/uv/uv_hub.h
+++ b/arch/x86/include/asm/uv/uv_hub.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * SGI UV architectural definitions 6 * SGI UV architectural definitions
7 * 7 *
8 * Copyright (C) 2007-2013 Silicon Graphics, Inc. All rights reserved. 8 * Copyright (C) 2007-2014 Silicon Graphics, Inc. All rights reserved.
9 */ 9 */
10 10
11#ifndef _ASM_X86_UV_UV_HUB_H 11#ifndef _ASM_X86_UV_UV_HUB_H
@@ -204,16 +204,6 @@ static inline int is_uvx_hub(void)
204 return uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE; 204 return uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE;
205} 205}
206 206
207static inline int is_uv2_1_hub(void)
208{
209 return uv_hub_info->hub_revision == UV2_HUB_REVISION_BASE;
210}
211
212static inline int is_uv2_2_hub(void)
213{
214 return uv_hub_info->hub_revision == UV2_HUB_REVISION_BASE + 1;
215}
216
217union uvh_apicid { 207union uvh_apicid {
218 unsigned long v; 208 unsigned long v;
219 struct uvh_apicid_s { 209 struct uvh_apicid_s {
diff --git a/arch/x86/include/asm/uv/uv_mmrs.h b/arch/x86/include/asm/uv/uv_mmrs.h
index e42249bcf7e1..ddd8db6b6e70 100644
--- a/arch/x86/include/asm/uv/uv_mmrs.h
+++ b/arch/x86/include/asm/uv/uv_mmrs.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * SGI UV MMR definitions 6 * SGI UV MMR definitions
7 * 7 *
8 * Copyright (C) 2007-2013 Silicon Graphics, Inc. All rights reserved. 8 * Copyright (C) 2007-2014 Silicon Graphics, Inc. All rights reserved.
9 */ 9 */
10 10
11#ifndef _ASM_X86_UV_UV_MMRS_H 11#ifndef _ASM_X86_UV_UV_MMRS_H
@@ -2803,6 +2803,46 @@ union uv1h_lb_target_physical_apic_id_mask_u {
2803}; 2803};
2804 2804
2805/* ========================================================================= */ 2805/* ========================================================================= */
2806/* UV3H_GR0_GAM_GR_CONFIG */
2807/* ========================================================================= */
2808#define UV3H_GR0_GAM_GR_CONFIG 0xc00028UL
2809
2810#define UV3H_GR0_GAM_GR_CONFIG_M_SKT_SHFT 0
2811#define UV3H_GR0_GAM_GR_CONFIG_SUBSPACE_SHFT 10
2812#define UV3H_GR0_GAM_GR_CONFIG_M_SKT_MASK 0x000000000000003fUL
2813#define UV3H_GR0_GAM_GR_CONFIG_SUBSPACE_MASK 0x0000000000000400UL
2814
2815union uv3h_gr0_gam_gr_config_u {
2816 unsigned long v;
2817 struct uv3h_gr0_gam_gr_config_s {
2818 unsigned long m_skt:6; /* RW */
2819 unsigned long undef_6_9:4; /* Undefined */
2820 unsigned long subspace:1; /* RW */
2821 unsigned long reserved:53;
2822 } s3;
2823};
2824
2825/* ========================================================================= */
2826/* UV3H_GR1_GAM_GR_CONFIG */
2827/* ========================================================================= */
2828#define UV3H_GR1_GAM_GR_CONFIG 0x1000028UL
2829
2830#define UV3H_GR1_GAM_GR_CONFIG_M_SKT_SHFT 0
2831#define UV3H_GR1_GAM_GR_CONFIG_SUBSPACE_SHFT 10
2832#define UV3H_GR1_GAM_GR_CONFIG_M_SKT_MASK 0x000000000000003fUL
2833#define UV3H_GR1_GAM_GR_CONFIG_SUBSPACE_MASK 0x0000000000000400UL
2834
2835union uv3h_gr1_gam_gr_config_u {
2836 unsigned long v;
2837 struct uv3h_gr1_gam_gr_config_s {
2838 unsigned long m_skt:6; /* RW */
2839 unsigned long undef_6_9:4; /* Undefined */
2840 unsigned long subspace:1; /* RW */
2841 unsigned long reserved:53;
2842 } s3;
2843};
2844
2845/* ========================================================================= */
2806/* UV3H_RH_GAM_MMIOH_OVERLAY_CONFIG0_MMR */ 2846/* UV3H_RH_GAM_MMIOH_OVERLAY_CONFIG0_MMR */
2807/* ========================================================================= */ 2847/* ========================================================================= */
2808#define UV3H_RH_GAM_MMIOH_OVERLAY_CONFIG0_MMR 0x1603000UL 2848#define UV3H_RH_GAM_MMIOH_OVERLAY_CONFIG0_MMR 0x1603000UL
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 7834389ba5be..293b41df54ef 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * SGI UV APIC functions (note: not an Intel compatible APIC) 6 * SGI UV APIC functions (note: not an Intel compatible APIC)
7 * 7 *
8 * Copyright (C) 2007-2013 Silicon Graphics, Inc. All rights reserved. 8 * Copyright (C) 2007-2014 Silicon Graphics, Inc. All rights reserved.
9 */ 9 */
10#include <linux/cpumask.h> 10#include <linux/cpumask.h>
11#include <linux/hardirq.h> 11#include <linux/hardirq.h>
@@ -440,6 +440,20 @@ static __initdata struct redir_addr redir_addrs[] = {
440 {UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_2_MMR, UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_2_MMR}, 440 {UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_2_MMR, UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_2_MMR},
441}; 441};
442 442
443static unsigned char get_n_lshift(int m_val)
444{
445 union uv3h_gr0_gam_gr_config_u m_gr_config;
446
447 if (is_uv1_hub())
448 return m_val;
449
450 if (is_uv2_hub())
451 return m_val == 40 ? 40 : 39;
452
453 m_gr_config.v = uv_read_local_mmr(UV3H_GR0_GAM_GR_CONFIG);
454 return m_gr_config.s3.m_skt;
455}
456
443static __init void get_lowmem_redirect(unsigned long *base, unsigned long *size) 457static __init void get_lowmem_redirect(unsigned long *base, unsigned long *size)
444{ 458{
445 union uvh_rh_gam_alias210_overlay_config_2_mmr_u alias; 459 union uvh_rh_gam_alias210_overlay_config_2_mmr_u alias;
@@ -849,6 +863,7 @@ void __init uv_system_init(void)
849 int gnode_extra, min_pnode = 999999, max_pnode = -1; 863 int gnode_extra, min_pnode = 999999, max_pnode = -1;
850 unsigned long mmr_base, present, paddr; 864 unsigned long mmr_base, present, paddr;
851 unsigned short pnode_mask; 865 unsigned short pnode_mask;
866 unsigned char n_lshift;
852 char *hub = (is_uv1_hub() ? "UV1" : 867 char *hub = (is_uv1_hub() ? "UV1" :
853 (is_uv2_hub() ? "UV2" : 868 (is_uv2_hub() ? "UV2" :
854 "UV3")); 869 "UV3"));
@@ -860,6 +875,7 @@ void __init uv_system_init(void)
860 m_val = m_n_config.s.m_skt; 875 m_val = m_n_config.s.m_skt;
861 n_val = m_n_config.s.n_skt; 876 n_val = m_n_config.s.n_skt;
862 pnode_mask = (1 << n_val) - 1; 877 pnode_mask = (1 << n_val) - 1;
878 n_lshift = get_n_lshift(m_val);
863 mmr_base = 879 mmr_base =
864 uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR) & 880 uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR) &
865 ~UV_MMR_ENABLE; 881 ~UV_MMR_ENABLE;
@@ -867,8 +883,9 @@ void __init uv_system_init(void)
867 node_id.v = uv_read_local_mmr(UVH_NODE_ID); 883 node_id.v = uv_read_local_mmr(UVH_NODE_ID);
868 gnode_extra = (node_id.s.node_id & ~((1 << n_val) - 1)) >> 1; 884 gnode_extra = (node_id.s.node_id & ~((1 << n_val) - 1)) >> 1;
869 gnode_upper = ((unsigned long)gnode_extra << m_val); 885 gnode_upper = ((unsigned long)gnode_extra << m_val);
870 pr_info("UV: N:%d M:%d pnode_mask:0x%x gnode_upper/extra:0x%lx/0x%x\n", 886 pr_info("UV: N:%d M:%d pnode_mask:0x%x gnode_upper/extra:0x%lx/0x%x n_lshift 0x%x\n",
871 n_val, m_val, pnode_mask, gnode_upper, gnode_extra); 887 n_val, m_val, pnode_mask, gnode_upper, gnode_extra,
888 n_lshift);
872 889
873 pr_info("UV: global MMR base 0x%lx\n", mmr_base); 890 pr_info("UV: global MMR base 0x%lx\n", mmr_base);
874 891
@@ -935,8 +952,7 @@ void __init uv_system_init(void)
935 uv_cpu_hub_info(cpu)->hub_revision = uv_hub_info->hub_revision; 952 uv_cpu_hub_info(cpu)->hub_revision = uv_hub_info->hub_revision;
936 953
937 uv_cpu_hub_info(cpu)->m_shift = 64 - m_val; 954 uv_cpu_hub_info(cpu)->m_shift = 64 - m_val;
938 uv_cpu_hub_info(cpu)->n_lshift = is_uv2_1_hub() ? 955 uv_cpu_hub_info(cpu)->n_lshift = n_lshift;
939 (m_val == 40 ? 40 : 39) : m_val;
940 956
941 pnode = uv_apicid_to_pnode(apicid); 957 pnode = uv_apicid_to_pnode(apicid);
942 blade = boot_pnode_to_blade(pnode); 958 blade = boot_pnode_to_blade(pnode);
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c
index 0535d1e0bc78..104a05f6b738 100644
--- a/drivers/misc/sgi-gru/grufile.c
+++ b/drivers/misc/sgi-gru/grufile.c
@@ -6,7 +6,7 @@
6 * This file supports the user system call for file open, close, mmap, etc. 6 * This file supports the user system call for file open, close, mmap, etc.
7 * This also incudes the driver initialization code. 7 * This also incudes the driver initialization code.
8 * 8 *
9 * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved. 9 * Copyright (c) 2008-2014 Silicon Graphics, Inc. All Rights Reserved.
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by 12 * it under the terms of the GNU General Public License as published by
@@ -58,6 +58,11 @@ static int max_user_cbrs, max_user_dsr_bytes;
58 58
59static struct miscdevice gru_miscdev; 59static struct miscdevice gru_miscdev;
60 60
61static int gru_supported(void)
62{
63 return is_uv_system() &&
64 (uv_hub_info->hub_revision < UV3_HUB_REVISION_BASE);
65}
61 66
62/* 67/*
63 * gru_vma_close 68 * gru_vma_close
@@ -518,7 +523,7 @@ static int __init gru_init(void)
518{ 523{
519 int ret; 524 int ret;
520 525
521 if (!is_uv_system() || (is_uvx_hub() && !is_uv2_hub())) 526 if (!gru_supported())
522 return 0; 527 return 0;
523 528
524#if defined CONFIG_IA64 529#if defined CONFIG_IA64
@@ -573,7 +578,7 @@ exit0:
573 578
574static void __exit gru_exit(void) 579static void __exit gru_exit(void)
575{ 580{
576 if (!is_uv_system()) 581 if (!gru_supported())
577 return; 582 return;
578 583
579 gru_teardown_tlb_irqs(); 584 gru_teardown_tlb_irqs();