Skip to content

Commit

Permalink
sh: Use ioremap_fixmed to map the SM501 DRAM config register
Browse files Browse the repository at this point in the history
We need to write to the DRAM config register very early and at such an
early stage ioremap() is not available. So use ioremap_fixed() to map
the register.

The reason that we are avoiding using the legacy P2 mapping is that
there will come a day when the legacy P2 mappings no longer exist.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
  • Loading branch information
Matt Fleming committed Jan 16, 2010
1 parent 4d35b93 commit 6f82b6e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions arch/sh/boards/board-sh7785lcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,15 @@ static void __init sh7785lcr_setup(char **cmdline_p)
pm_power_off = sh7785lcr_power_off;

/* sm501 DRAM configuration */
sm501_reg = (void __iomem *)0xb3e00000 + SM501_DRAM_CONTROL;
writel(0x000307c2, sm501_reg);
sm501_reg = ioremap_fixed(SM107_REG_ADDR, SM501_DRAM_CONTROL,
PAGE_KERNEL);
if (!sm501_reg) {
printk(KERN_ERR "%s: ioremap error.\n", __func__);
return;
}

writel(0x000307c2, sm501_reg + SM501_DRAM_CONTROL);
iounmap_fixed(sm501_reg);
}

/* Return the board specific boot mode pin configuration */
Expand Down

0 comments on commit 6f82b6e

Please sign in to comment.