summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-10-05 14:37:25 +0200
committerWolfgang Denk <wd@denx.de>2010-10-05 14:37:25 +0200
commitdb682a0b59b2e97b24275214f1837197a73fdb03 (patch)
tree6e5f5c445023a71f78c8f166358339c3b72085f4 /common
parentbbf2abc0f5a5be0b8081ae8587fa90b376160444 (diff)
parent709d9481e99f9f42625a48d0517a8877382995a3 (diff)
downloadu-boot-imx-db682a0b59b2e97b24275214f1837197a73fdb03.zip
u-boot-imx-db682a0b59b2e97b24275214f1837197a73fdb03.tar.gz
u-boot-imx-db682a0b59b2e97b24275214f1837197a73fdb03.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-ppc4xx
Diffstat (limited to 'common')
-rw-r--r--common/fdt_support.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 6f32e3f..0ed6e77 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -620,7 +620,7 @@ int fdt_fixup_nor_flash_size(void *blob)
int off;
int len;
struct fdt_property *prop;
- u32 *reg;
+ u32 *reg, *reg2;
int i;
for (i = 0; i < 2; i++) {
@@ -640,18 +640,21 @@ int fdt_fixup_nor_flash_size(void *blob)
* There might be multiple reg-tuples,
* so loop through them all
*/
- len /= tuple_size;
- reg = (u32 *)&prop->data[0];
- for (idx = 0; idx < len; idx++) {
+ reg = reg2 = (u32 *)&prop->data[0];
+ for (idx = 0; idx < (len / tuple_size); idx++) {
/*
* Update size in reg property
*/
reg[2] = flash_get_bank_size(reg[0],
idx);
- fdt_setprop(blob, off, "reg", reg,
- tuple_size);
- reg += tuple_size;
+
+ /*
+ * Point to next reg tuple
+ */
+ reg += 3;
}
+
+ fdt_setprop(blob, off, "reg", reg2, len);
}
/* Move to next compatible node */