]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Add support for passing initrd information via flat device tree
authorKumar Gala <galak@kernel.crashing.org>
Wed, 11 Jan 2006 22:41:35 +0000 (16:41 -0600)
committerKumar Gala <galak@kernel.crashing.org>
Wed, 11 Jan 2006 22:41:35 +0000 (16:41 -0600)
Patch by Kumar Gala 11 Jan 2006

CHANGELOG
common/cmd_bootm.c
common/ft_build.c
include/ft_build.h

index 7c201433ce3935a61c75f7bc8bd415b5847c31ee..9b64a02485858c79efcc3a10146ecd4d697dadf6 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,9 @@
 Changes since U-Boot 1.1.4:
 ======================================================================
 
+* Add support for passing initrd information via flat device tree
+  Patch by Kumar Gala 11 Jan 2006
+
 * Added OF_STDOUT_PATH and OF_SOC
 
   OF_STDOUT_PATH specifies the path to the device the kernel can use
index 8599a49d057b954f11d0cb73deb2f8124c2eeb78..9562dbe5a76dbda9f062b28636b21b11466b7ca0 100644 (file)
@@ -819,7 +819,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
        (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
 
 #else
-       ft_setup(of_flat_tree, OF_FLAT_TREE_MAX_SIZE, kbd);
+       ft_setup(of_flat_tree, OF_FLAT_TREE_MAX_SIZE, kbd, initrd_start, initrd_end);
        /* ft_dump_blob(of_flat_tree); */
 
 #if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500)
@@ -828,12 +828,16 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
        /*
         * Linux Kernel Parameters:
         *   r3: ptr to OF flat tree, followed by the board info data
-        *   r4: initrd_start or 0 if no initrd
-        *   r5: initrd_end - unused if r4 is 0
-        *   r6: Start of command line string
-        *   r7: End   of command line string
+        *   r4: physical pointer to the kernel itself
+        *   r5: NULL
+        *   r6: NULL
+        *   r7: NULL
         */
-       (*kernel) ((bd_t *)of_flat_tree, initrd_start, initrd_end, cmd_start, cmd_end);
+       if (getenv("disable_of") != NULL)
+               (*kernel) ((bd_t *)of_flat_tree, initrd_start, initrd_end,
+                       cmd_start, cmd_end);
+       else
+               (*kernel) ((bd_t *)of_flat_tree, (ulong)kernel, 0, 0, 0);
 
 #endif
 }
index 7a9a40a305c113e7dba80834c169dc78ceaa68b0..9e9c906fc1f9cb27c0d6078d1967fa1a6e6e1b03 100644 (file)
@@ -163,7 +163,7 @@ void ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size)
        ((u64 *) cxt->pres)[0] = cpu_to_be64(physaddr); /* phys = 0, size = 0, terminate */
        ((u64 *) cxt->pres)[1] = cpu_to_be64(size);
 
-       cxt->pres += 18;        /* advance */
+       cxt->pres += 16;        /* advance */
 
        ((u64 *) cxt->pres)[0] = 0;     /* phys = 0, size = 0, terminate */
        ((u64 *) cxt->pres)[1] = 0;
@@ -577,7 +577,7 @@ static const struct {
 };
 #endif
 
-void ft_setup(void *blob, int size, bd_t * bd)
+void ft_setup(void *blob, int size, bd_t * bd, ulong initrd_start, ulong initrd_end)
 {
        u32 *p;
        int len;
@@ -602,7 +602,8 @@ void ft_setup(void *blob, int size, bd_t * bd)
 
        ft_begin(&cxt, blob, size);
 
-       /* fs_add_rsvmap not used */
+       if (initrd_start && initrd_end)
+               ft_add_rsvmap(&cxt, initrd_start, initrd_end - initrd_start + 1);
 
        ft_begin_tree(&cxt);
 
@@ -645,6 +646,10 @@ void ft_setup(void *blob, int size, bd_t * bd)
        ft_prop_str(&cxt, "name", "chosen");
        ft_prop_str(&cxt, "bootargs", getenv("bootargs"));
        ft_prop_int(&cxt, "linux,platform", 0x600);     /* what is this? */
+       if (initrd_start && initrd_end) {
+               ft_prop_int(&cxt, "linux,initrd-start", initrd_start);
+               ft_prop_int(&cxt, "linux,initrd-end", initrd_end);
+       }
 #ifdef OF_STDOUT_PATH
        ft_prop_str(&cxt, "linux,stdout-path", OF_STDOUT_PATH);
 #endif
index a276867c5d4fa45bfea30b190a2db8d61e2f1c5c..47ca575d9fe295153644ecad54ba523573a24fb9 100644 (file)
@@ -57,7 +57,7 @@ void ft_prop_int(struct ft_cxt *cxt, const char *name, int val);
 void ft_begin(struct ft_cxt *cxt, void *blob, int max_size);
 void ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size);
 
-void ft_setup(void *blob, int size, bd_t * bd);
+void ft_setup(void *blob, int size, bd_t * bd, ulong initrd_start, ulong initrd_end);
 
 void ft_dump_blob(const void *bphp);
 void ft_merge_blob(struct ft_cxt *cxt, void *blob);