Skip to contentSkip to conversation

Philips PNX8550 command line patch

PATCH In review Vladimir A. Barinov 3 participants 4 messages Dec 6, 2005 – Dec 8, 2005 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Philips PNX8550 command line patch

Hello Ralf,

This patch makes passing command line from bootloader for Philips PNX8550 platform. Does it makes sense to commit this patch?

Vladimir

arch/mips/philips/pnx8550/jbs/init.c +5 -0
@@ -47,6 +47,11 @@ void __init prom_init(void)
 {
 
 	unsigned long memsize;
+	prom_argc = (int) fw_arg0;
+	prom_argv = (char **) fw_arg1;
+	prom_envp = (char **) fw_arg2;
+
+	prom_init_cmdline();
 
 	mips_machgroup = MACH_GROUP_PHILIPS;
 	mips_machtype = MACH_PHILIPS_JBS;
arch/mips/philips/pnx8550/common/prom.c +6 -14
@@ -35,23 +35,15 @@ char * prom_getcmdline(void)
 	return &(arcs_cmdline[0]);
 }
 
-void  prom_init_cmdline(void)
+void __init prom_init_cmdline(void)
 {
-	char *cp;
-	int actr;
-
-	actr = 1; /* Always ignore argv[0] */
+	int i;
 
-	cp = &(arcs_cmdline[0]);
-	while(actr < prom_argc) {
-	        strcpy(cp, prom_argv[actr]);
-		cp += strlen(prom_argv[actr]);
-		*cp++ = ' ';
-		actr++;
+	arcs_cmdline[0] = '\0';
+	for (i = 0; i < prom_argc; i++) {
+		strcat(arcs_cmdline, prom_argv[i]);
+		strcat(arcs_cmdline, " ");
 	}
-	if (cp != &(arcs_cmdline[0])) /* get rid of trailing space */
-		--cp;
-	*cp = '\0';
 }
 
 char *prom_getenv(char *envname)
#1 lore raw
Quoted 3 lines · Vladimir A. Barinov

This patch makes passing command line from bootloader for Philips PNX8550 platform.
Does it makes sense to commit this patch?

Looks ok at a quick glance. I'll wait a bit so Pete has a chance to comment.

Ralf

#2 lore raw
Quoted 10 lines · --- Ralf Baechle
Quoted 1 line · Vladimir A. Barinov

This patch makes passing command line from

bootloader for Philips

Quoted 2 lines

PNX8550 platform.
Does it makes sense to commit this patch?

Looks ok at a quick glance. I'll wait a bit so Pete has a chance to comment.

Looks fine to me.

Pete

#3 lore raw

Hello Pete, Ralf,

Quoted 19 lines · Peter Popov
Quoted 15 lines · --- Ralf Baechle
Quoted 3 lines · Vladimir A. Barinov

This patch makes passing command line from

bootloader for Philips

Quoted 4 lines

PNX8550 platform.
Does it makes sense to commit this patch?

Quoted 8 lines
Quoted 4 lines

Looks ok at a quick glance. I'll wait a bit so Pete has a chance to comment.

Looks fine to me.

Sorry for my misunderstood but I suppose that this patch should be ignored since it used JBS board dependent code and I have STB810 that based on the code of JBS. But JBS board could have firmware that differs from that STB810 uses. So the command line could be parsed incorrectly for JBS, it's needed to check by somebody who has JBS board.

I prepared STB810 board dependent patch that include this fix for command-line parsing for STB810 board only. So Ralf please ignore this patch though it was approved by you and Pete.

Vladimir