From: Scott McNutt <smcnutt@psyent.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] nios2: pass command line and initrd to linux in bootm.c
Date: Tue, 30 Mar 2010 22:51:17 -0400 [thread overview]
Message-ID: <4BB2B8A5.6050005@psyent.com> (raw)
In-Reply-To: <1269402106-32560-1-git-send-email-thomas@wytron.com.tw>
Thomas,
Applied.
Theank you,
--Scott
Thomas Chou wrote:
> This patch adds bootargs passing to nios2 linux.
>
> The args passing is enabled with,
> r4 : 'NIOS' magic
> r5 : pointer to initrd start
> r6 : pointer to initrd end
> r7 : pointer to command line
>
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
> lib_nios2/bootm.c | 19 ++++++++++++-------
> 1 files changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/lib_nios2/bootm.c b/lib_nios2/bootm.c
> index 675bfac..5d25edf 100644
> --- a/lib_nios2/bootm.c
> +++ b/lib_nios2/bootm.c
> @@ -26,21 +26,26 @@
> #include <asm/byteorder.h>
> #include <asm/cache.h>
>
> +#define NIOS_MAGIC 0x534f494e /* enable command line and initrd passing */
> +
> int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
> {
> - void (*kernel)(void) = (void (*)(void))images->ep;
> + void (*kernel)(int, int, int, char *) = (void *)images->ep;
> + char *commandline = getenv("bootargs");
> + ulong initrd_start = images->rd_start;
> + ulong initrd_end = images->rd_end;
>
> if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
> return 1;
>
> /* flushes data and instruction caches before calling the kernel */
> - flush_dcache (0,CONFIG_SYS_DCACHE_SIZE);
> - flush_icache (0,CONFIG_SYS_ICACHE_SIZE);
> + disable_interrupts();
> + flush_dcache((ulong)kernel, CONFIG_SYS_DCACHE_SIZE);
> + flush_icache((ulong)kernel, CONFIG_SYS_ICACHE_SIZE);
>
> - /* For now we assume the Microtronix linux ... which only
> - * needs to be called ;-)
> - */
> - kernel ();
> + debug("bootargs=%s @ 0x%lx\n", commandline, (ulong)&commandline);
> + debug("initrd=0x%lx-0x%lx\n", (ulong)initrd_start, (ulong)initrd_end);
> + kernel(NIOS_MAGIC, initrd_start, initrd_end, commandline);
> /* does not return */
>
> return 1;
prev parent reply other threads:[~2010-03-31 2:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-24 3:41 [U-Boot] [PATCH] nios2: pass command line and initrd to linux in bootm.c Thomas Chou
2010-03-31 2:51 ` Scott McNutt [this message]
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=4BB2B8A5.6050005@psyent.com \
--to=smcnutt@psyent.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.