Skip to content

Commit

Permalink
powerpc/5200: fix oops during going to standby
Browse files Browse the repository at this point in the history
When going to standby mode mpc code maps the whole soc5200 node
to access warious MBAR registers. However as of_iomap uses 'reg'
property of device node, only small part of MBAR is getting mapped.
Thus pm code gets oops when trying to access high parts of MBAR.
As a way to overcome this, make mpc52xx_pm_prepare() explicitly
map whole MBAR (0xc0000).

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Dmitry Baryshkov authored and Grant Likely committed Jun 15, 2010
1 parent a2c9a60 commit fb73538
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion arch/powerpc/platforms/52xx/mpc52xx_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,19 @@ int mpc52xx_pm_prepare(void)
{ .type = "builtin", .compatible = "mpc5200", }, /* efika */
{}
};
struct resource res;

/* map the whole register space */
np = of_find_matching_node(NULL, immr_ids);
mbar = of_iomap(np, 0);

if (of_address_to_resource(np, 0, &res)) {
pr_err("mpc52xx_pm_prepare(): could not get IMMR address\n");
of_node_put(np);
return -ENOSYS;
}

mbar = ioremap(res.start, 0xc000); /* we should map whole region including SRAM */

of_node_put(np);
if (!mbar) {
pr_err("mpc52xx_pm_prepare(): could not map registers\n");
Expand Down

0 comments on commit fb73538

Please sign in to comment.