Commit fcfbb2b5 authored by Mike Travis's avatar Mike Travis Committed by Ingo Molnar

x86: SGI UV: Fix mapping of MMIO registers

This fixes the problem of the initialization code not correctly
mapping the entire MMIO space on a UV system.  A side effect is
the map_high() interface needed to be changed to accommodate
different address and size shifts.
Signed-off-by: default avatarMike Travis <travis@sgi.com>
Reviewed-by: default avatarMike Habeck <habeck@sgi.com>
Cc: <stable@kernel.org>
Cc: Jack Steiner <steiner@sgi.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <4B479202.7080705@sgi.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent df39a2e4
...@@ -374,13 +374,13 @@ static __init void get_lowmem_redirect(unsigned long *base, unsigned long *size) ...@@ -374,13 +374,13 @@ static __init void get_lowmem_redirect(unsigned long *base, unsigned long *size)
enum map_type {map_wb, map_uc}; enum map_type {map_wb, map_uc};
static __init void map_high(char *id, unsigned long base, int shift, static __init void map_high(char *id, unsigned long base, int pshift,
int max_pnode, enum map_type map_type) int bshift, int max_pnode, enum map_type map_type)
{ {
unsigned long bytes, paddr; unsigned long bytes, paddr;
paddr = base << shift; paddr = base << pshift;
bytes = (1UL << shift) * (max_pnode + 1); bytes = (1UL << bshift) * (max_pnode + 1);
printk(KERN_INFO "UV: Map %s_HI 0x%lx - 0x%lx\n", id, paddr, printk(KERN_INFO "UV: Map %s_HI 0x%lx - 0x%lx\n", id, paddr,
paddr + bytes); paddr + bytes);
if (map_type == map_uc) if (map_type == map_uc)
...@@ -396,7 +396,7 @@ static __init void map_gru_high(int max_pnode) ...@@ -396,7 +396,7 @@ static __init void map_gru_high(int max_pnode)
gru.v = uv_read_local_mmr(UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR); gru.v = uv_read_local_mmr(UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR);
if (gru.s.enable) { if (gru.s.enable) {
map_high("GRU", gru.s.base, shift, max_pnode, map_wb); map_high("GRU", gru.s.base, shift, shift, max_pnode, map_wb);
gru_start_paddr = ((u64)gru.s.base << shift); gru_start_paddr = ((u64)gru.s.base << shift);
gru_end_paddr = gru_start_paddr + (1UL << shift) * (max_pnode + 1); gru_end_paddr = gru_start_paddr + (1UL << shift) * (max_pnode + 1);
...@@ -410,7 +410,7 @@ static __init void map_mmr_high(int max_pnode) ...@@ -410,7 +410,7 @@ static __init void map_mmr_high(int max_pnode)
mmr.v = uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR); mmr.v = uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR);
if (mmr.s.enable) if (mmr.s.enable)
map_high("MMR", mmr.s.base, shift, max_pnode, map_uc); map_high("MMR", mmr.s.base, shift, shift, max_pnode, map_uc);
} }
static __init void map_mmioh_high(int max_pnode) static __init void map_mmioh_high(int max_pnode)
...@@ -420,7 +420,8 @@ static __init void map_mmioh_high(int max_pnode) ...@@ -420,7 +420,8 @@ static __init void map_mmioh_high(int max_pnode)
mmioh.v = uv_read_local_mmr(UVH_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR); mmioh.v = uv_read_local_mmr(UVH_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR);
if (mmioh.s.enable) if (mmioh.s.enable)
map_high("MMIOH", mmioh.s.base, shift, max_pnode, map_uc); map_high("MMIOH", mmioh.s.base, shift, mmioh.s.m_io,
max_pnode, map_uc);
} }
static __init void map_low_mmrs(void) static __init void map_low_mmrs(void)
......
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