All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerry Van Baren <gvb.uboot@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC] bootm: Add sub commands
Date: Wed, 17 Sep 2008 19:57:39 -0400	[thread overview]
Message-ID: <48D19973.7040900@gmail.com> (raw)
In-Reply-To: <1221688841-3197-1-git-send-email-galak@kernel.crashing.org>

Kumar Gala wrote:
> Posting this again for discussion.  The two features I'm interested in
> enabling are:
> 
> * Having the ability to modify the device tree before its passed to
>   the kernel but after 'fdt boardsetup'
> 
> * Ability to do all setup but not actually jumping to the kernel.
>   (This is useful as a way to setup the memory image [kernel, ramdisk,
>    fdt, etc] for a different cpu than the boot one)
> 
> Having bootm sub-commands allows both of these as we can break up
> the sequeunce of steps that are part of the bootm process.
> 
> - k

Hi Kumar,

Looks like a good proposal.  I've been rather distracted the last couple 
of weeks, but I'll put some eyeball time and runtime on your changes.

[snip]

> +#if 0
> +are these really common ??? or is there any harm??
> +	/* bd_t setup */
> +	else if (argv[1][0] == 'p') {
> +	}

If we are using a FDT, there is no reason for a bd_t as part of the boot 
process.  I vote for removal.
   (typo s/p/b/?)

> +	/* cmd setup */
> +	else if (argv[1][0] == 'c') {
> +	}

I don't know what "cmd setup" is/was off-hand, have to look into that. 
Probably also a removal.

[snip]

> @@ -782,6 +883,17 @@ U_BOOT_CMD(
>  	"\tUse iminfo command to get the list of existing component\n"
>  	"\timages and configurations.\n"
>  #endif
> +	"\t\nSub-commands to do part of the bootm sequence:\n"
> +	"\tstart [addr [arg ...]]\n"
> +	"\tloados - load OS image\n"
> +	"\tprepos - OS specific prep before relocation or go\n"
> +#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
> +	"\tinitrd - relocate initrd, set env initrd_start/initrd_end\n"
> +#endif
> +#if defined(CONFIG_OF_LIBFDT)
> +	"\tfdt - relocate initrd\n"

Cut'n'paste? s/initrd/the flattened device tree/

[snip]

> diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c
> index 38266e1..208ed3b 100644
> --- a/lib_ppc/bootm.c
> +++ b/lib_ppc/bootm.c
> @@ -47,6 +47,7 @@
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> +extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
>  extern ulong get_effective_memsize(void);
>  static ulong get_sp (void);
>  static void set_clocks_in_mhz (bd_t *kbd);
> @@ -55,30 +56,78 @@ static void set_clocks_in_mhz (bd_t *kbd);
>  #define CFG_LINUX_LOWMEM_MAX_SIZE	(768*1024*1024)
>  #endif
>  
> -__attribute__((noinline))
> -int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
> +static void boot_jump_linux(bootm_headers_t *images)
>  {
> -	ulong	sp;
> -
> -	ulong	initrd_start, initrd_end;
> -	ulong	rd_len;
> -	ulong	size;
> -	phys_size_t bootm_size;
> -
> -	ulong	cmd_start, cmd_end, bootmap_base;
> -	bd_t	*kbd;
>  	void	(*kernel)(bd_t *, ulong r4, ulong r5, ulong r6,
>  			  ulong r7, ulong r8, ulong r9);
> -	int	ret;
> -	ulong	of_size = images->ft_len;
> -	struct lmb *lmb = &images->lmb;
> +
> +	kernel = (void (*)(bd_t *, ulong, ulong, ulong,
> +			   ulong, ulong, ulong))images->ep;
> +#ifdef CONFIG_OF_LIBFDT
> +	char *of_flat_tree = images->ft_addr;
> +#endif

This should be moved above the "kernel = " line to keep it with the rest 
of the declarations, yes?

[big snip]

Thanks!
gvb

  reply	other threads:[~2008-09-17 23:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-17 22:00 [U-Boot] [RFC] bootm: Add sub commands Kumar Gala
2008-09-17 23:57 ` Jerry Van Baren [this message]
2008-09-18 16:27   ` Kumar Gala
2008-09-18  6:54 ` Wolfgang Denk
2008-09-18 11:25   ` Jerry Van Baren
2008-09-18 16:32   ` Kumar Gala
2008-09-22 21:06     ` Wolfgang Denk
2008-09-18 20:17   ` Kumar Gala
2008-09-22 21:09     ` Wolfgang Denk
2008-09-22 23:32       ` Kumar Gala
2008-09-22 23:49         ` Wolfgang Denk

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=48D19973.7040900@gmail.com \
    --to=gvb.uboot@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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.