summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2009-04-04 10:21:02 -0500
committerKumar Gala <galak@kernel.crashing.org>2009-04-04 10:21:40 -0500
commite6a6789f41f0560ce280089fbd3f1bd0f0f64306 (patch)
tree9bc1b9ed8faad0eaf517a1b517bf3407aaed2fd5 /drivers/misc
parent32049b4048ff8e59bd5ba6160d6d5206d283b2a2 (diff)
downloadu-boot-imx-e6a6789f41f0560ce280089fbd3f1bd0f0f64306.zip
u-boot-imx-e6a6789f41f0560ce280089fbd3f1bd0f0f64306.tar.gz
u-boot-imx-e6a6789f41f0560ce280089fbd3f1bd0f0f64306.tar.bz2
fsl_law: Fix bug in calculation of LAW sizing
In set_ddr_laws() when we determined how much of the size requested to be mapped was covered by the the first LAW we needed to recalculate the size based on what was actually mapped. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/fsl_law.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/misc/fsl_law.c b/drivers/misc/fsl_law.c
index be43a3e..f7d454d 100644
--- a/drivers/misc/fsl_law.c
+++ b/drivers/misc/fsl_law.c
@@ -139,6 +139,9 @@ int set_ddr_laws(u64 start, u64 sz, enum law_trgt_if id)
if (set_last_law(start, law_sz_enc, id) < 0)
return -1;
+ /* recalculate size based on what was actually covered by the law */
+ law_sz = 1ull << __ilog2_u64(law_sz);
+
/* do we still have anything to map */
sz = sz - law_sz;
if (sz) {