Pass bootargs to the kernel when available.

Snapshot the kernel command line arguments when creating the
(unused by the kernel) ATAGS parameters.

Pass the command line arguments to the kernel along with the
magic number "1" to indicate command line args are present.

Change-Id: Ied58ea538f2eea91318f793ac18f06b410a22609
diff --git a/lib_arc/arclinux.c b/lib_arc/arclinux.c
index 2a3bab4..05e67a5 100644
--- a/lib_arc/arclinux.c
+++ b/lib_arc/arclinux.c
@@ -49,6 +49,9 @@
 static void setup_commandline_tag (bd_t *bd, char *commandline);
 static void setup_hwid_tag(void);
 static void setup_spiflashprotect_tag(u32 qtn_flags);
+#ifdef CONFIG_CMDLINE_TAG
+char *commandline_tag = NULL;
+#endif
 
 #if 0
 static void setup_ramdisk_tag (bd_t *bd);
@@ -109,7 +112,15 @@
 	cleanup_before_linux ();
 
 	int arch = read_new_aux_reg(0x04 /*IDENTITY*/);
+#if defined(GFRG240) && defined(CONFIG_CMDLINE_TAG)
+	if (commandline_tag != NULL) {
+	  theKernel (1, arch, commandline_tag);
+	  /* no return */
+	}
+	/* otherwise FALL THROUGH to no-command line args jump */
+#endif
 	theKernel (0, arch, bd->bi_boot_params);
+	/* no return */
 }
 
 #if defined (CONFIG_SETUP_MEMORY_TAGS) || \
@@ -175,7 +186,9 @@
 	strcpy (params->u.cmdline.cmdline, p);
     printf("Params->u.cmdline.cmdline %s\n", params->u.cmdline.cmdline);
     printf("p %s\n", p);
-
+#ifdef CONFIG_CMDLINE_TAG
+	commandline_tag = params->u.cmdline.cmdline;
+#endif
 
 	params = tag_next (params);
 }