Commit 524c4e1f authored by Thomas Bogendoerfer's avatar Thomas Bogendoerfer Committed by Paul Burton

MIPS: SGI-IP27: Use specific get_region_shift

IP35 has a different way to find out regions, so we move the IP27
implementation to IP27 specific file.
Signed-off-by: default avatarThomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: default avatarPaul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
parent 2c616e9f
...@@ -250,6 +250,14 @@ typedef union hubni_port_error_u { ...@@ -250,6 +250,14 @@ typedef union hubni_port_error_u {
#define NI_LLP_CB_MAX 0xff #define NI_LLP_CB_MAX 0xff
#define NI_LLP_SN_MAX 0xff #define NI_LLP_SN_MAX 0xff
static inline int get_region_shift(void)
{
if (LOCAL_HUB_L(NI_STATUS_REV_ID) & NSRI_REGIONSIZE_MASK)
return NASID_TO_FINEREG_SHFT;
return NASID_TO_COARSEREG_SHFT;
}
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#endif /* _ASM_SGI_SN0_HUBNI_H */ #endif /* _ASM_SGI_SN0_HUBNI_H */
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/sn/arch.h> #include <asm/sn/arch.h>
#include <asm/sn/agent.h>
#include <asm/sn/klconfig.h> #include <asm/sn/klconfig.h>
#include <asm/sn/sn_private.h> #include <asm/sn/sn_private.h>
...@@ -36,31 +37,18 @@ struct node_data *__node_data[MAX_NUMNODES]; ...@@ -36,31 +37,18 @@ struct node_data *__node_data[MAX_NUMNODES];
EXPORT_SYMBOL(__node_data); EXPORT_SYMBOL(__node_data);
static int fine_mode; static u64 gen_region_mask(void)
static int is_fine_dirmode(void)
{
return ((LOCAL_HUB_L(NI_STATUS_REV_ID) & NSRI_REGIONSIZE_MASK) >> NSRI_REGIONSIZE_SHFT) & REGIONSIZE_FINE;
}
static u64 get_region(nasid_t nasid)
{
if (fine_mode)
return nasid >> NASID_TO_FINEREG_SHFT;
else
return nasid >> NASID_TO_COARSEREG_SHFT;
}
static u64 region_mask;
static void gen_region_mask(u64 *region_mask)
{ {
int region_shift;
u64 region_mask;
nasid_t nasid; nasid_t nasid;
(*region_mask) = 0; region_shift = get_region_shift();
for_each_online_node(nasid) { region_mask = 0;
(*region_mask) |= 1ULL << get_region(nasid); for_each_online_node(nasid)
} region_mask |= BIT_ULL(nasid >> region_shift);
return region_mask;
} }
#define rou_rflag rou_flags #define rou_rflag rou_flags
...@@ -280,10 +268,10 @@ static unsigned long __init slot_psize_compute(nasid_t nasid, int slot) ...@@ -280,10 +268,10 @@ static unsigned long __init slot_psize_compute(nasid_t nasid, int slot)
static void __init mlreset(void) static void __init mlreset(void)
{ {
u64 region_mask;
nasid_t nasid; nasid_t nasid;
master_nasid = get_nasid(); master_nasid = get_nasid();
fine_mode = is_fine_dirmode();
/* /*
* Probe for all CPUs - this creates the cpumask and sets up the * Probe for all CPUs - this creates the cpumask and sets up the
...@@ -296,7 +284,7 @@ static void __init mlreset(void) ...@@ -296,7 +284,7 @@ static void __init mlreset(void)
init_topology_matrix(); init_topology_matrix();
dump_topology(); dump_topology();
gen_region_mask(&region_mask); region_mask = gen_region_mask();
setup_replication_mask(); setup_replication_mask();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment