public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v3 2/5] fdtdec: Honor #address-cells and #size-cells in fdtdec_add_reserved_memory()
Date: Tue,  9 Jun 2020 22:36:28 -0700	[thread overview]
Message-ID: <1591767391-2669-2-git-send-email-bmeng.cn@gmail.com> (raw)
In-Reply-To: <1591767391-2669-1-git-send-email-bmeng.cn@gmail.com>

From: Bin Meng <bin.meng@windriver.com>

At present fdtdec_add_reserved_memory() calls fdtdec_get_addr_size()
to get address and size for the subnodes of /reserved-memory node.

We should honor #address-cells and #size-cells properties in the
parent node.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 lib/fdtdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 42f7a25..0dd7ff1 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -1297,7 +1297,8 @@ int fdtdec_add_reserved_memory(void *blob, const char *basename,
 		fdt_addr_t addr;
 		fdt_size_t size;
 
-		addr = fdtdec_get_addr_size(blob, node, "reg", &size);
+		addr = fdtdec_get_addr_size_fixed(blob, node, "reg", 0, na, ns,
+						  &size, false);
 		if (addr == FDT_ADDR_T_NONE) {
 			debug("failed to read address/size for %s\n", name);
 			continue;
-- 
2.7.4

  reply	other threads:[~2020-06-10  5:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10  5:36 [PATCH v3 1/5] fdtdec: Fix the types of addr and size in fdtdec_add_reserved_memory() Bin Meng
2020-06-10  5:36 ` Bin Meng [this message]
2020-06-10  5:36 ` [PATCH v3 3/5] test/dm: fdtdec: Add the missing gd declaration Bin Meng
2020-06-17  3:11   ` Simon Glass
2020-06-10  5:36 ` [PATCH v3 4/5] test/dm: fdtdec: Corect a typo in dm_test_fdtdec_set_carveout() Bin Meng
2020-06-17  3:11   ` Simon Glass
2020-06-10  5:36 ` [PATCH v3 5/5] test/dm: fdtdec: Add tests for fdtdec_add_reserved_memory() Bin Meng
2020-06-17  3:11   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1591767391-2669-2-git-send-email-bmeng.cn@gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox