[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] Kernel command line not passed from u-boot



Hi Bill,

william.orfitelli@xxxxxxxxx wrote:

It looks like the ability to pass the command line args from the bootloader is disabled in the MMU kernel I am using. Will there be another automated way to set up flash partitions, or should I set it up with the CONFIG_CMDLINE kernel option.

Can you please try that attached patch? It should enable r5 command line handling as per the noMM Ukernel.

Regards,

John

Index: arch/microblaze/kernel/head.S
===================================================================
--- arch/microblaze/kernel/head.S	(revision 3609)
+++ arch/microblaze/kernel/head.S	(revision 3610)
@@ -33,6 +33,7 @@
 
 #include <linux/linkage.h>
 #include <asm/thread_info.h>
+#include <asm/setup.h> /* COMMAND_LINE_SIZE */
 
 #ifdef CONFIG_MMU
 
@@ -60,7 +61,7 @@
 CSYM(swapper_pg_dir):
 	.space	4096
 
-#endif
+#endif /* CONFIG_MMU */
 
 	.text
 ENTRY(_start)
@@ -68,9 +69,26 @@
 	andi	r1, r1, ~2
 	mts	rmsr, r1
 
-/*	or r5, r0, r0	 for the case we were booted by the osloader*/
+#ifdef CONFIG_MMU
 
-#ifdef CONFIG_MMU
+#ifndef CONFIG_CMDLINE_FORCE
+/* handling command line
+ * copy command line to __init_end. There is space for storing command line.
+ */
+	or	r6, r0, r0		/* incremment */
+	ori	r4, r0, __init_end	/* load address of command line */
+	tophys(r4,r4)			/* convert to phys address */
+	ori	r3, r0, COMMAND_LINE_SIZE - 1 /* number of loops */
+_copy_command_line:
+	lbu	r7, r5, r6		/* r7=r4+r6 */
+	sb	r7, r4, r6		/* addr[r4+r6]= r7*/
+	addik	r6, r6, 1		/* increment counting */
+	bgtid	r3, _copy_command_line	/* loop for all entries       */
+	addik	r3, r3, -1		/* descrement loop */
+	addik	r5, r4, 0		/* add new space for command line */
+	tovirt(r5,r5)
+#endif /* CONFIG_CMDLINE_FORCE */
+
 	/* We have to turn on the MMU right away. */
 
 	/* Set up the initial MMU state so we can do the first level of
@@ -183,9 +201,8 @@
 
 #ifdef CONFIG_MMU
 	/* Call platform dependent initialize function.*/
-	la	r5, r0, 0 /* no command line */
-	la	r6, r0, machine_early_init
-	brald	r15, r6
+	la	r8, r0, machine_early_init
+	brald	r15, r8
 	nop
 	/*
 	 * Initialize the MMU.
@@ -232,9 +249,8 @@
 	/* Call platform dependent initialize function.
 	 * Please see $(ARCH)/mach-$(SUBARCH)/setup.c for
 	 * the function. */
-//	la	r5, r0, 0 /* no command line */
-	la	r6, r0, machine_early_init
-	brald	r15, r6
+	la	r8, r0, machine_early_init
+	brald	r15, r8
 	nop
 
 	la	r15, r0, machine_halt