From: Ladislav Michl <ladis@linux-mips.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC] cmd: fdt: memory fixup
Date: Tue, 31 Jan 2017 03:35:51 +0100 [thread overview]
Message-ID: <20170131023551.mtas7csvuk4hkxtw@lenoch> (raw)
To get Falcon mode working with zImage is currently non trivial as zImages
do not fit into U-Boot's image concept too well. Fortunately at least for
ARM boards it seems getting memory node right is quite sufficient.
What about changing 'fdt memory' command to update memory node according to
detected memory layout when called without parameters?
ladis
diff --git a/cmd/fdt.c b/cmd/fdt.c
index 95dd673b95..e08296d51c 100644
--- a/cmd/fdt.c
+++ b/cmd/fdt.c
@@ -517,11 +517,23 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
* memory command
*/
} else if (strncmp(argv[1], "me", 2) == 0) {
- uint64_t addr, size;
int err;
- addr = simple_strtoull(argv[2], NULL, 16);
- size = simple_strtoull(argv[3], NULL, 16);
- err = fdt_fixup_memory(working_fdt, addr, size);
+ if (argc < 4) {
+ int i;
+ uint64_t start[CONFIG_NR_DRAM_BANKS];
+ uint64_t size[CONFIG_NR_DRAM_BANKS];
+ bd_t *bd = gd->bd;
+ for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
+ start[i] = bd->bi_dram[i].start;
+ size[i] = bd->bi_dram[i].size;
+ }
+ err = fdt_fixup_memory_banks(working_fdt, start, size,
+ CONFIG_NR_DRAM_BANKS);
+ } else {
+ uint64_t addr = simple_strtoull(argv[2], NULL, 16);
+ uint64_t size = simple_strtoull(argv[3], NULL, 16);
+ err = fdt_fixup_memory(working_fdt, addr, size);
+ }
if (err < 0)
return err;
next reply other threads:[~2017-01-31 2:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-31 2:35 Ladislav Michl [this message]
2017-01-31 23:12 ` [U-Boot] [RFC] cmd: fdt: memory fixup Ladislav Michl
2017-02-05 16:36 ` Tom Rini
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=20170131023551.mtas7csvuk4hkxtw@lenoch \
--to=ladis@linux-mips.org \
--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