mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v4] bootm: add global bootm.{image/initrd}.loadaddr support
Date: Tue, 16 Oct 2012 22:41:23 +0200	[thread overview]
Message-ID: <20121016204123.GP24458@pengutronix.de> (raw)
In-Reply-To: <1347464902-2127-1-git-send-email-plagnioj@jcrosoft.com>

On Wed, Sep 12, 2012 at 05:48:22PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> To be able to pass the loadaddr of the image and the initrd.
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  commands/bootm.c |   25 +++++++++++++++++++++++--
>  1 file changed, 23 insertions(+), 2 deletions(-)
> 
> diff --git a/commands/bootm.c b/commands/bootm.c
> index 2d9f7f2..dfd9ac9 100644
> --- a/commands/bootm.c
> +++ b/commands/bootm.c
> @@ -254,6 +254,19 @@ static char *bootm_image_name_and_no(const char *name, int *no)
>  #define BOOTM_OPTS BOOTM_OPTS_COMMON
>  #endif
>  
> +static unsigned long long getenv_loadaddr(const char *name)
> +{
> +	const char *valstr = getenv(name);
> +
> +	if (!valstr)
> +		return UIMAGE_SOME_ADDRESS;
> +
> +	if (valstr[0] == '\0')
> +		return UIMAGE_SOME_ADDRESS;
> +
> +	return simple_strtoull(valstr, NULL, 0);
> +}
> +
>  static int do_bootm(int argc, char *argv[])
>  {
>  	int opt;
> @@ -273,8 +286,11 @@ static int do_bootm(int argc, char *argv[])
>  
>  	oftree = getenv("global.bootm.oftree");
>  	os_file = getenv("global.bootm.image");
> -	if (IS_ENABLED(CONFIG_CMD_BOOTM_INITRD))
> +	data.os_address = getenv_loadaddr("global.bootm.image.loadaddr");
> +	data.initrd_address = getenv_loadaddr("global.bootm.initrd.loadaddr");

This needs to be in the 'if' below.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-10-16 20:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12 15:48 Jean-Christophe PLAGNIOL-VILLARD
2012-10-16 14:54 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-17  9:38   ` Renaud Barbier
2012-10-16 20:41 ` Sascha Hauer [this message]
2012-10-17  6:54   ` Jean-Christophe PLAGNIOL-VILLARD

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=20121016204123.GP24458@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=plagnioj@jcrosoft.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox