All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@mips.com>
To: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
Cc: <linux-mips@linux-mips.org>, Rob Herring <robh+dt@kernel.org>,
	"Frank Rowand" <frowand.list@gmail.com>,
	<devicetree@vger.kernel.org>
Subject: Re: [PATCH] MIPS: implement a "bootargs-append" DT property
Date: Mon, 13 Nov 2017 11:23:12 +0000	[thread overview]
Message-ID: <20171113112312.GZ15260@jhogan-linux> (raw)
In-Reply-To: <1510420788-25184-1-git-send-email-daniel@gimpelevich.san-francisco.ca.us>

[-- Attachment #1: Type: text/plain, Size: 2219 bytes --]

On Sat, Nov 11, 2017 at 09:19:48AM -0800, Daniel Gimpelevich wrote:
> There are two uses for this:
> 
> 1) It may be useful to split a device-specific kernel command line between
> a .dts file and a .dtsi file, with "bootargs" in one and "bootargs-append"
> in the other, such as for variations of a reference board.
> 
> 2) There are kernel configuration options for prepending "bootargs" to the
> kernel command line that the bootloader has passed, but not for appending.
> A new option for this would be a less future-proof solution, since things
> like this should be in the dtb.
> 
> This is tested on MIPS, but it can be useful on other architectures also.
> 
> Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>

The device tree maintainers should be on Cc. Adding them now.

Cheers
James

> ---
>  arch/mips/kernel/setup.c | 3 +++
>  drivers/of/fdt.c         | 4 ++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
> index fe39397..95e9bf2 100644
> --- a/arch/mips/kernel/setup.c
> +++ b/arch/mips/kernel/setup.c
> @@ -826,7 +826,10 @@ static void __init arch_mem_init(char **cmdline_p)
>  	extern void plat_mem_setup(void);
>  
>  	/* call board setup routine */
> +	strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
>  	plat_mem_setup();
> +	if (strncmp(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE) == 0)
> +		boot_command_line[0] = '\0';
>  
>  	/*
>  	 * Make sure all kernel memory is in the maps.  The "UP" and
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index ce30c9a..65dbda6 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -1127,6 +1127,10 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
>  	p = of_get_flat_dt_prop(node, "bootargs", &l);
>  	if (p != NULL && l > 0)
>  		strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE));
> +	p = of_get_flat_dt_prop(node, "bootargs-append", &l);
> +	if (p != NULL && l > 0)
> +		strlcat(data, p, min_t(int, strlen(data) + l,
> +					COMMAND_LINE_SIZE));
>  
>  	/*
>  	 * CONFIG_CMDLINE is meant to be a default in case nothing else
> -- 
> 1.9.1
> 
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: James Hogan <james.hogan@mips.com>
To: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
Cc: linux-mips@linux-mips.org, Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH] MIPS: implement a "bootargs-append" DT property
Date: Mon, 13 Nov 2017 11:23:12 +0000	[thread overview]
Message-ID: <20171113112312.GZ15260@jhogan-linux> (raw)
Message-ID: <20171113112312.B8yDizeERYImbpgYg5P2gJhOuqF1KPfTMDlxI3FE32c@z> (raw)
In-Reply-To: <1510420788-25184-1-git-send-email-daniel@gimpelevich.san-francisco.ca.us>

[-- Attachment #1: Type: text/plain, Size: 2219 bytes --]

On Sat, Nov 11, 2017 at 09:19:48AM -0800, Daniel Gimpelevich wrote:
> There are two uses for this:
> 
> 1) It may be useful to split a device-specific kernel command line between
> a .dts file and a .dtsi file, with "bootargs" in one and "bootargs-append"
> in the other, such as for variations of a reference board.
> 
> 2) There are kernel configuration options for prepending "bootargs" to the
> kernel command line that the bootloader has passed, but not for appending.
> A new option for this would be a less future-proof solution, since things
> like this should be in the dtb.
> 
> This is tested on MIPS, but it can be useful on other architectures also.
> 
> Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>

The device tree maintainers should be on Cc. Adding them now.

Cheers
James

> ---
>  arch/mips/kernel/setup.c | 3 +++
>  drivers/of/fdt.c         | 4 ++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
> index fe39397..95e9bf2 100644
> --- a/arch/mips/kernel/setup.c
> +++ b/arch/mips/kernel/setup.c
> @@ -826,7 +826,10 @@ static void __init arch_mem_init(char **cmdline_p)
>  	extern void plat_mem_setup(void);
>  
>  	/* call board setup routine */
> +	strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
>  	plat_mem_setup();
> +	if (strncmp(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE) == 0)
> +		boot_command_line[0] = '\0';
>  
>  	/*
>  	 * Make sure all kernel memory is in the maps.  The "UP" and
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index ce30c9a..65dbda6 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -1127,6 +1127,10 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
>  	p = of_get_flat_dt_prop(node, "bootargs", &l);
>  	if (p != NULL && l > 0)
>  		strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE));
> +	p = of_get_flat_dt_prop(node, "bootargs-append", &l);
> +	if (p != NULL && l > 0)
> +		strlcat(data, p, min_t(int, strlen(data) + l,
> +					COMMAND_LINE_SIZE));
>  
>  	/*
>  	 * CONFIG_CMDLINE is meant to be a default in case nothing else
> -- 
> 1.9.1
> 
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: James Hogan <james.hogan-8NJIiSa5LzA@public.gmane.org>
To: Daniel Gimpelevich
	<daniel-R/FLGEdV95bo9U+Z1CfBt0SU0eOFXohjCypLqA8HKkk@public.gmane.org>
Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Frank Rowand
	<frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] MIPS: implement a "bootargs-append" DT property
Date: Mon, 13 Nov 2017 11:23:12 +0000	[thread overview]
Message-ID: <20171113112312.GZ15260@jhogan-linux> (raw)
In-Reply-To: <1510420788-25184-1-git-send-email-daniel-R/FLGEdV95bo9U+Z1CfBt0SU0eOFXohjCypLqA8HKkk@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2248 bytes --]

On Sat, Nov 11, 2017 at 09:19:48AM -0800, Daniel Gimpelevich wrote:
> There are two uses for this:
> 
> 1) It may be useful to split a device-specific kernel command line between
> a .dts file and a .dtsi file, with "bootargs" in one and "bootargs-append"
> in the other, such as for variations of a reference board.
> 
> 2) There are kernel configuration options for prepending "bootargs" to the
> kernel command line that the bootloader has passed, but not for appending.
> A new option for this would be a less future-proof solution, since things
> like this should be in the dtb.
> 
> This is tested on MIPS, but it can be useful on other architectures also.
> 
> Signed-off-by: Daniel Gimpelevich <daniel-R/FLGEdV95bo9U+Z1CfBt0SU0eOFXohjCypLqA8HKkk@public.gmane.org>

The device tree maintainers should be on Cc. Adding them now.

Cheers
James

> ---
>  arch/mips/kernel/setup.c | 3 +++
>  drivers/of/fdt.c         | 4 ++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
> index fe39397..95e9bf2 100644
> --- a/arch/mips/kernel/setup.c
> +++ b/arch/mips/kernel/setup.c
> @@ -826,7 +826,10 @@ static void __init arch_mem_init(char **cmdline_p)
>  	extern void plat_mem_setup(void);
>  
>  	/* call board setup routine */
> +	strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
>  	plat_mem_setup();
> +	if (strncmp(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE) == 0)
> +		boot_command_line[0] = '\0';
>  
>  	/*
>  	 * Make sure all kernel memory is in the maps.  The "UP" and
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index ce30c9a..65dbda6 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -1127,6 +1127,10 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
>  	p = of_get_flat_dt_prop(node, "bootargs", &l);
>  	if (p != NULL && l > 0)
>  		strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE));
> +	p = of_get_flat_dt_prop(node, "bootargs-append", &l);
> +	if (p != NULL && l > 0)
> +		strlcat(data, p, min_t(int, strlen(data) + l,
> +					COMMAND_LINE_SIZE));
>  
>  	/*
>  	 * CONFIG_CMDLINE is meant to be a default in case nothing else
> -- 
> 1.9.1
> 
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-11-13 11:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-11 17:19 [PATCH] MIPS: implement a "bootargs-append" DT property Daniel Gimpelevich
2017-11-13 11:23 ` James Hogan [this message]
2017-11-13 11:23   ` James Hogan
2017-11-13 11:23   ` James Hogan
2017-11-13 12:31   ` Geert Uytterhoeven
2017-11-13 12:42     ` Daniel Gimpelevich
2017-11-13 13:18       ` Geert Uytterhoeven
2017-11-13 13:18         ` Geert Uytterhoeven
2017-11-13 16:34   ` Rob Herring
2017-11-13 16:34     ` Rob Herring
2017-11-14  3:05     ` Daniel Gimpelevich
2017-11-14  3:05       ` Daniel Gimpelevich
2017-11-14 17:18       ` Rob Herring
2017-11-14 17:18         ` Rob Herring
2017-11-16  1:46         ` Daniel Gimpelevich
2017-11-16  1:46           ` Daniel Gimpelevich
2017-11-16  5:26           ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171113112312.GZ15260@jhogan-linux \
    --to=james.hogan@mips.com \
    --cc=daniel@gimpelevich.san-francisco.ca.us \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.