diff options
author | Matthew McClintock <msm@freescale.com> | 2006-06-28 10:41:37 -0500 |
---|---|---|
committer | Jon Loeliger <jdl@freescale.com> | 2006-08-09 13:50:11 -0500 |
commit | 0267768eddc5ca7bc1865bc40c866829ac5efbfe (patch) | |
tree | 62f10b7bbdd53e9018ebd0f04888dcc893d75ab3 /common/cmd_bootm.c | |
parent | f73e73ba0e422e6f79030d77286dd57becaee16f (diff) | |
download | bootable_bootloader_goldelico_gta04-0267768eddc5ca7bc1865bc40c866829ac5efbfe.zip bootable_bootloader_goldelico_gta04-0267768eddc5ca7bc1865bc40c866829ac5efbfe.tar.gz bootable_bootloader_goldelico_gta04-0267768eddc5ca7bc1865bc40c866829ac5efbfe.tar.bz2 |
* Modify bootm command to support booting with flat device trees Patch by Matthew McClintock 26-June-2006
Diffstat (limited to 'common/cmd_bootm.c')
-rw-r--r-- | common/cmd_bootm.c | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index fdf7180..a472a1d 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -465,6 +465,13 @@ U_BOOT_CMD( "[addr [arg ...]]\n - boot application image stored in memory\n" "\tpassing arguments 'arg ...'; when booting a Linux kernel,\n" "\t'arg' can be the address of an initrd image\n" +#ifdef CONFIG_OF_FLAT_TREE + "\tWhen booting a Linux kernel which requires a flat device-tree\n" + "\ta third argument is required which is the address of the of the\n" + "\tdevice-tree blob. To boot that kernel without an initrd image,\n" + "\tuse a '-' for the second argument. If you do not pass a third\n" + "\ta bd_info struct will be passed instead\n" +#endif ); #ifdef CONFIG_SILENT_CONSOLE @@ -500,11 +507,6 @@ fixup_silent_linux () } #endif /* CONFIG_SILENT_CONSOLE */ -#ifdef CONFIG_OF_FLAT_TREE -extern const unsigned char oftree_dtb[]; -extern const unsigned int oftree_dtb_len; -#endif - #ifdef CONFIG_PPC static void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, @@ -616,7 +618,17 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, /* * Check if there is an initrd image */ + +#ifdef CONFIG_OF_FLAT_TREE + /* Look for a '-' which indicates to ignore the ramdisk argument */ + if (argc >= 3 && strcmp(argv[2], "-") == 0) { + debug ("Skipping initrd\n"); + data = 0; + } + else +#endif if (argc >= 3) { + debug ("Not skipping initrd\n"); SHOW_BOOT_PROGRESS (9); addr = simple_strtoul(argv[2], NULL, 16); @@ -724,6 +736,15 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, len = data = 0; } +#ifdef CONFIG_OF_FLAT_TREE + if (argc >= 3) + { + of_flat_tree = (char *) simple_strtoul(argv[3], NULL, 16); + printf ("Booting using flat device tree at 0x%x\n", + of_flat_tree); + } +#endif + if (!data) { debug ("No initrd\n"); } @@ -793,15 +814,6 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, initrd_end = 0; } -#ifdef CONFIG_OF_FLAT_TREE - if (initrd_start == 0) - of_flat_tree = (char *)(((ulong)kbd - OF_FLAT_TREE_MAX_SIZE - - sizeof(bd_t)) & ~0xF); - else - of_flat_tree = (char *)((initrd_start - OF_FLAT_TREE_MAX_SIZE - - sizeof(bd_t)) & ~0xF); -#endif - debug ("## Transferring control to Linux (at address %08lx) ...\n", (ulong)kernel); |