public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [RFC] cmd: fdt: memory fixup
@ 2017-01-31  2:35 Ladislav Michl
  2017-01-31 23:12 ` Ladislav Michl
  2017-02-05 16:36 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Ladislav Michl @ 2017-01-31  2:35 UTC (permalink / raw)
  To: u-boot

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;
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [RFC] cmd: fdt: memory fixup
  2017-01-31  2:35 [U-Boot] [RFC] cmd: fdt: memory fixup Ladislav Michl
@ 2017-01-31 23:12 ` Ladislav Michl
  2017-02-05 16:36 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Ladislav Michl @ 2017-01-31 23:12 UTC (permalink / raw)
  To: u-boot

On Tue, Jan 31, 2017 at 03:35:51AM +0100, Ladislav Michl wrote:
> 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?

Looked at other (!arm) platforms implementation... Does not seem like good
idea anymore. What about adding posibility to call ft_arch_fixup? Other
ideas?

Thank you,
	ladis

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [RFC] cmd: fdt: memory fixup
  2017-01-31  2:35 [U-Boot] [RFC] cmd: fdt: memory fixup Ladislav Michl
  2017-01-31 23:12 ` Ladislav Michl
@ 2017-02-05 16:36 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2017-02-05 16:36 UTC (permalink / raw)
  To: u-boot

On Tue, Jan 31, 2017 at 03:35:51AM +0100, Ladislav Michl wrote:

> 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?

I'm not quite sure I follow this, sorry.  The 'spl' command should be
extended cover 'zImage and 'Images', which I think shouldn't be too hard
at this point given how the abstractions work today, and then the normal
mechanism to prepare the 'args' portion should work.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170205/b617aa08/attachment.sig>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-05 16:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-31  2:35 [U-Boot] [RFC] cmd: fdt: memory fixup Ladislav Michl
2017-01-31 23:12 ` Ladislav Michl
2017-02-05 16:36 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox