summary refs log tree commit diff
diff options
context:
space:
mode:
authorDmitry Baryshkov <dbaryshkov@gmail.com>2010-06-11 01:52:35 +0000
committerGrant Likely <grant.likely@secretlab.ca>2010-06-15 14:47:04 -0600
commitfb73538e10c7fc4823a56e97bba600c2f9294012 (patch)
tree4b3766db5c91161d90ae0a0a33fb6293f52109f7
parenta2c9a603c72be0d9a0780f196bff53ab0d517347 (diff)
downloadlinux-fb73538e10c7fc4823a56e97bba600c2f9294012.tar.gz
powerpc/5200: fix oops during going to standby
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>
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pm.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pm.c b/arch/powerpc/platforms/52xx/mpc52xx_pm.c
index a55b0b6813ed..76722532bd95 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pm.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pm.c
@@ -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");