summaryrefslogtreecommitdiff
path: root/common/cmd_fdt.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-08-15 08:24:34 -0500
committerWolfgang Denk <wd@denx.de>2008-08-21 00:54:52 +0200
commitf953d99fd528a496b400a706b511eaf8e3ea66af (patch)
tree0a79f12391d09adb75758ff23206f9d05eca136f /common/cmd_fdt.c
parentffa4bafacaef67058463b3d7d0099ced57569dd2 (diff)
downloadu-boot-f953d99fd528a496b400a706b511eaf8e3ea66af.tar.gz
u-boot-f953d99fd528a496b400a706b511eaf8e3ea66af.tar.bz2
u-boot-f953d99fd528a496b400a706b511eaf8e3ea66af.zip
fdt: added the ability to set initrd start/end via chosen command
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'common/cmd_fdt.c')
-rw-r--r--common/cmd_fdt.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index d3b19ddc1f..436fec9928 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 <addr> <size> - Add a mem reserve\n"
"fdt rsvmem delete <index> - Delete a mem reserves\n"
- "fdt chosen - Add/update the /chosen branch in the tree\n"
+ "fdt chosen [<start> <end>] - Add/update the /chosen branch in the tree\n"
+ " <start>/<end> - 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"
);