From: Kumar Gala Date: Fri, 15 Aug 2008 08:24:34 -0500 Subject: [U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command In-Reply-To: <1218806685-3615-3-git-send-email-galak@kernel.crashing.org> References: <1218806685-3615-1-git-send-email-galak@kernel.crashing.org> <1218806685-3615-2-git-send-email-galak@kernel.crashing.org> <1218806685-3615-3-git-send-email-galak@kernel.crashing.org> Message-ID: <1218806685-3615-4-git-send-email-galak@kernel.crashing.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Signed-off-by: Kumar Gala --- common/cmd_fdt.c | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-) diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index d3b19dd..436fec9 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -417,9 +417,21 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) ft_board_setup(working_fdt, gd->bd); #endif /* Create a chosen node */ - else if (argv[1][0] == 'c') - fdt_chosen(working_fdt, 0, 0, 1); - else { + else if (argv[1][0] == 'c') { + unsigned long initrd_start = 0, initrd_end = 0; + + if ((argc != 2) && (argc != 4)) { + printf ("Usage:\n%s\n", cmdtp->usage); + return 1; + } + + if (argc == 4) { + initrd_start = simple_strtoul(argv[2], NULL, 16); + initrd_end = simple_strtoul(argv[3], NULL, 16); + } + + fdt_chosen(working_fdt, initrd_start, initrd_end, 1); + } else { /* Unrecognized command */ printf ("Usage:\n%s\n", cmdtp->usage); return 1; @@ -798,7 +810,8 @@ U_BOOT_CMD( "fdt rsvmem print - Show current mem reserves\n" "fdt rsvmem add - Add a mem reserve\n" "fdt rsvmem delete - Delete a mem reserves\n" - "fdt chosen - Add/update the /chosen branch in the tree\n" + "fdt chosen [ ] - Add/update the /chosen branch in the tree\n" + " / - initrd start/end addr\n" "NOTE: If the path or property you are setting/printing has a '#' character\n" " or spaces, you MUST escape it with a \\ character or quote it with \".\n" ); -- 1.5.5.1