* Patch by Phillippe Robin, 16 Mar 2004:
[platform/kernel/u-boot.git] / lib_arm / armlinux.c
index e96ea81..eca9a05 100644 (file)
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307         USA
  *
  */
 
@@ -166,6 +166,14 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
                        do_reset (cmdtp, flag, argc, argv);
                }
 
+#ifdef CONFIG_B2
+               /*
+                *we need to copy the ramdisk to SRAM to let Linux boot
+                */
+               memmove ((void *) ntohl(hdr->ih_load), (uchar *)data, len);
+               data = ntohl(hdr->ih_load);
+#endif /* CONFIG_B2 */
+
                /*
                 * Now check if we have a multifile image
                 */
@@ -248,6 +256,13 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
        /* we assume that the kernel is in place */
        printf ("\nStarting kernel ...\n\n");
 
+#ifdef CONFIG_USB_DEVICE
+       {
+               extern void udc_disconnect (void);
+               udc_disconnect ();
+       }
+#endif
+
        cleanup_before_linux ();
 
        theKernel (0, bd->bi_arch_number, bd->bi_boot_params);
@@ -297,6 +312,9 @@ static void setup_commandline_tag (bd_t *bd, char *commandline)
 {
        char *p;
 
+       if (!commandline)
+               return;
+
        /* eat leading white space */
        for (p = commandline; *p == ' '; p++);
 
@@ -322,7 +340,7 @@ static void setup_initrd_tag (bd_t *bd, ulong initrd_start, ulong initrd_end)
        /* an ATAG_INITRD node tells the kernel where the compressed
         * ramdisk can be found. ATAG_RDIMG is a better name, actually.
         */
-       params->hdr.tag = ATAG_INITRD2;
+       params->hdr.tag = ATAG_INITRD;
        params->hdr.size = tag_size (tag_initrd);
 
        params->u.initrd.start = initrd_start;