* [PATCH/RFC] Allow CONFIG_OF_FLAT_TREE to boot a non-arch/powerpc kernel
@ 2006-10-26 21:08 Grant Likely
2006-10-26 21:11 ` Grant Likely
0 siblings, 1 reply; 3+ messages in thread
From: Grant Likely @ 2006-10-26 21:08 UTC (permalink / raw)
To: Vitaly Bordug, linuxppc-dev, Kumar Gala, Matthew McClintock, jdl
This patch allows an arch/ppc kernel to be booted by just passing 1 or 2
arguments to bootm. It removes the getenv("disable_of") test that used
to be used for this purpose.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
common/cmd_bootm.c | 52 ++++++++++++++++++++--------------------------------
1 files changed, 20 insertions(+), 32 deletions(-)
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 3091a58..07a9f12 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -833,10 +833,6 @@ #endif
printf ("ERROR: flat device tree size does not agree with image\n");
return;
}
-
- } else if (getenv("disable_of") == NULL) {
- printf ("ERROR: bootm needs flat device tree as third argument\n");
- return;
}
#endif
if (!data) {
@@ -913,23 +909,11 @@ #endif /* CONFIG_HW_WATCHDOG || CONFIG_W
SHOW_BOOT_PROGRESS (15);
-#ifndef CONFIG_OF_FLAT_TREE
-
#if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500)
unlock_ram_in_cache();
#endif
- /*
- * Linux Kernel Parameters:
- * r3: ptr to board info data
- * r4: initrd_start or 0 if no initrd
- * r5: initrd_end - unused if r4 is 0
- * r6: Start of command line string
- * r7: End of command line string
- */
- (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
-
-#else /* CONFIG_OF_FLAT_TREE */
+#ifdef CONFIG_OF_FLAT_TREE
/* move of_flat_tree if needed */
if (of_data) {
ulong of_start, of_len;
@@ -949,29 +933,33 @@ #else /* CONFIG_OF_FLAT_TREE */
memmove ((void *)of_start, (void *)of_data, of_len);
}
- ft_setup(of_flat_tree, kbd, initrd_start, initrd_end);
- /* ft_dump_blob(of_flat_tree); */
-
-#if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500)
- unlock_ram_in_cache();
+ /*
+ * Linux Kernel Parameters (passing board info data):
+ * r3: ptr to board info data
+ * r4: initrd_start or 0 if no initrd
+ * r5: initrd_end - unused if r4 is 0
+ * r6: Start of command line string
+ * r7: End of command line string
+ */
+#ifdef CONFIG_OF_FLAT_TREE
+ if (!of_flat_tree) /* no device tree; boot old style */
#endif
+ (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
+ /* does not return */
+
/*
- * Linux Kernel Parameters:
+ * Linux Kernel Parameters (passing device tree):
* r3: ptr to OF flat tree, followed by the board info data
* r4: physical pointer to the kernel itself
* r5: NULL
* r6: NULL
* r7: NULL
*/
- if (getenv("disable_of") != NULL)
- (*kernel) ((bd_t *)of_flat_tree, initrd_start, initrd_end,
- cmd_start, cmd_end);
- else {
- ft_setup(of_flat_tree, kbd, initrd_start, initrd_end);
- /* ft_dump_blob(of_flat_tree); */
- (*kernel) ((bd_t *)of_flat_tree, (ulong)kernel, 0, 0, 0);
- }
-#endif /* CONFIG_OF_FLAT_TREE */
+ ft_setup(of_flat_tree, kbd, initrd_start, initrd_end);
+ /* ft_dump_blob(of_flat_tree); */
+
+ (*kernel) ((bd_t *)of_flat_tree, (ulong)kernel, 0, 0, 0);
+#endif
}
#endif /* CONFIG_PPC */
--
1.4.3.rc2.g0503
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH/RFC] Allow CONFIG_OF_FLAT_TREE to boot a non-arch/powerpc kernel
2006-10-26 21:08 [PATCH/RFC] Allow CONFIG_OF_FLAT_TREE to boot a non-arch/powerpc kernel Grant Likely
@ 2006-10-26 21:11 ` Grant Likely
2006-10-27 2:37 ` Grant Likely
0 siblings, 1 reply; 3+ messages in thread
From: Grant Likely @ 2006-10-26 21:11 UTC (permalink / raw)
To: Vitaly Bordug, linuxppc-dev, Kumar Gala, Matthew McClintock, jdl
BTW, can someone please actually test this w/ a arch/powerpc kernel?
I've only got a lite5200b to play with, and it isn't ported yet. :)
g.
On 10/26/06, Grant Likely <grant.likely@secretlab.ca> wrote:
> This patch allows an arch/ppc kernel to be booted by just passing 1 or 2
> arguments to bootm. It removes the getenv("disable_of") test that used
> to be used for this purpose.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> common/cmd_bootm.c | 52 ++++++++++++++++++++--------------------------------
> 1 files changed, 20 insertions(+), 32 deletions(-)
>
> diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
> index 3091a58..07a9f12 100644
> --- a/common/cmd_bootm.c
> +++ b/common/cmd_bootm.c
> @@ -833,10 +833,6 @@ #endif
> printf ("ERROR: flat device tree size does not agree with image\n");
> return;
> }
> -
> - } else if (getenv("disable_of") == NULL) {
> - printf ("ERROR: bootm needs flat device tree as third argument\n");
> - return;
> }
> #endif
> if (!data) {
> @@ -913,23 +909,11 @@ #endif /* CONFIG_HW_WATCHDOG || CONFIG_W
>
> SHOW_BOOT_PROGRESS (15);
>
> -#ifndef CONFIG_OF_FLAT_TREE
> -
> #if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500)
> unlock_ram_in_cache();
> #endif
>
> - /*
> - * Linux Kernel Parameters:
> - * r3: ptr to board info data
> - * r4: initrd_start or 0 if no initrd
> - * r5: initrd_end - unused if r4 is 0
> - * r6: Start of command line string
> - * r7: End of command line string
> - */
> - (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
> -
> -#else /* CONFIG_OF_FLAT_TREE */
> +#ifdef CONFIG_OF_FLAT_TREE
> /* move of_flat_tree if needed */
> if (of_data) {
> ulong of_start, of_len;
> @@ -949,29 +933,33 @@ #else /* CONFIG_OF_FLAT_TREE */
> memmove ((void *)of_start, (void *)of_data, of_len);
> }
>
> - ft_setup(of_flat_tree, kbd, initrd_start, initrd_end);
> - /* ft_dump_blob(of_flat_tree); */
> -
> -#if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500)
> - unlock_ram_in_cache();
> + /*
> + * Linux Kernel Parameters (passing board info data):
> + * r3: ptr to board info data
> + * r4: initrd_start or 0 if no initrd
> + * r5: initrd_end - unused if r4 is 0
> + * r6: Start of command line string
> + * r7: End of command line string
> + */
> +#ifdef CONFIG_OF_FLAT_TREE
> + if (!of_flat_tree) /* no device tree; boot old style */
> #endif
> + (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
> + /* does not return */
> +
> /*
> - * Linux Kernel Parameters:
> + * Linux Kernel Parameters (passing device tree):
> * r3: ptr to OF flat tree, followed by the board info data
> * r4: physical pointer to the kernel itself
> * r5: NULL
> * r6: NULL
> * r7: NULL
> */
> - if (getenv("disable_of") != NULL)
> - (*kernel) ((bd_t *)of_flat_tree, initrd_start, initrd_end,
> - cmd_start, cmd_end);
> - else {
> - ft_setup(of_flat_tree, kbd, initrd_start, initrd_end);
> - /* ft_dump_blob(of_flat_tree); */
> - (*kernel) ((bd_t *)of_flat_tree, (ulong)kernel, 0, 0, 0);
> - }
> -#endif /* CONFIG_OF_FLAT_TREE */
> + ft_setup(of_flat_tree, kbd, initrd_start, initrd_end);
> + /* ft_dump_blob(of_flat_tree); */
> +
> + (*kernel) ((bd_t *)of_flat_tree, (ulong)kernel, 0, 0, 0);
> +#endif
> }
> #endif /* CONFIG_PPC */
>
> --
> 1.4.3.rc2.g0503
>
>
--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH/RFC] Allow CONFIG_OF_FLAT_TREE to boot a non-arch/powerpc kernel
2006-10-26 21:11 ` Grant Likely
@ 2006-10-27 2:37 ` Grant Likely
0 siblings, 0 replies; 3+ messages in thread
From: Grant Likely @ 2006-10-27 2:37 UTC (permalink / raw)
To: Vitaly Bordug, linuxppc-dev, Kumar Gala, Matthew McClintock, jdl
BBTW, considering that this is a u-boot patch; sorry for posting this
here linuxppc-dev instead of u-boot-users.
g.
On 10/26/06, Grant Likely <grant.likely@secretlab.ca> wrote:
> BTW, can someone please actually test this w/ a arch/powerpc kernel?
> I've only got a lite5200b to play with, and it isn't ported yet. :)
>
> g.
>
> On 10/26/06, Grant Likely <grant.likely@secretlab.ca> wrote:
> > This patch allows an arch/ppc kernel to be booted by just passing 1 or 2
> > arguments to bootm. It removes the getenv("disable_of") test that used
> > to be used for this purpose.
> >
> > Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> > ---
> > common/cmd_bootm.c | 52 ++++++++++++++++++++--------------------------------
> > 1 files changed, 20 insertions(+), 32 deletions(-)
> >
> > diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
> > index 3091a58..07a9f12 100644
> > --- a/common/cmd_bootm.c
> > +++ b/common/cmd_bootm.c
> > @@ -833,10 +833,6 @@ #endif
> > printf ("ERROR: flat device tree size does not agree with image\n");
> > return;
> > }
> > -
> > - } else if (getenv("disable_of") == NULL) {
> > - printf ("ERROR: bootm needs flat device tree as third argument\n");
> > - return;
> > }
> > #endif
> > if (!data) {
> > @@ -913,23 +909,11 @@ #endif /* CONFIG_HW_WATCHDOG || CONFIG_W
> >
> > SHOW_BOOT_PROGRESS (15);
> >
> > -#ifndef CONFIG_OF_FLAT_TREE
> > -
> > #if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500)
> > unlock_ram_in_cache();
> > #endif
> >
> > - /*
> > - * Linux Kernel Parameters:
> > - * r3: ptr to board info data
> > - * r4: initrd_start or 0 if no initrd
> > - * r5: initrd_end - unused if r4 is 0
> > - * r6: Start of command line string
> > - * r7: End of command line string
> > - */
> > - (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
> > -
> > -#else /* CONFIG_OF_FLAT_TREE */
> > +#ifdef CONFIG_OF_FLAT_TREE
> > /* move of_flat_tree if needed */
> > if (of_data) {
> > ulong of_start, of_len;
> > @@ -949,29 +933,33 @@ #else /* CONFIG_OF_FLAT_TREE */
> > memmove ((void *)of_start, (void *)of_data, of_len);
> > }
> >
> > - ft_setup(of_flat_tree, kbd, initrd_start, initrd_end);
> > - /* ft_dump_blob(of_flat_tree); */
> > -
> > -#if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500)
> > - unlock_ram_in_cache();
> > + /*
> > + * Linux Kernel Parameters (passing board info data):
> > + * r3: ptr to board info data
> > + * r4: initrd_start or 0 if no initrd
> > + * r5: initrd_end - unused if r4 is 0
> > + * r6: Start of command line string
> > + * r7: End of command line string
> > + */
> > +#ifdef CONFIG_OF_FLAT_TREE
> > + if (!of_flat_tree) /* no device tree; boot old style */
> > #endif
> > + (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
> > + /* does not return */
> > +
> > /*
> > - * Linux Kernel Parameters:
> > + * Linux Kernel Parameters (passing device tree):
> > * r3: ptr to OF flat tree, followed by the board info data
> > * r4: physical pointer to the kernel itself
> > * r5: NULL
> > * r6: NULL
> > * r7: NULL
> > */
> > - if (getenv("disable_of") != NULL)
> > - (*kernel) ((bd_t *)of_flat_tree, initrd_start, initrd_end,
> > - cmd_start, cmd_end);
> > - else {
> > - ft_setup(of_flat_tree, kbd, initrd_start, initrd_end);
> > - /* ft_dump_blob(of_flat_tree); */
> > - (*kernel) ((bd_t *)of_flat_tree, (ulong)kernel, 0, 0, 0);
> > - }
> > -#endif /* CONFIG_OF_FLAT_TREE */
> > + ft_setup(of_flat_tree, kbd, initrd_start, initrd_end);
> > + /* ft_dump_blob(of_flat_tree); */
> > +
> > + (*kernel) ((bd_t *)of_flat_tree, (ulong)kernel, 0, 0, 0);
> > +#endif
> > }
> > #endif /* CONFIG_PPC */
> >
> > --
> > 1.4.3.rc2.g0503
> >
> >
>
>
> --
> Grant Likely, B.Sc. P.Eng.
> Secret Lab Technologies Ltd.
> grant.likely@secretlab.ca
> (403) 399-0195
>
--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-10-27 2:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-26 21:08 [PATCH/RFC] Allow CONFIG_OF_FLAT_TREE to boot a non-arch/powerpc kernel Grant Likely
2006-10-26 21:11 ` Grant Likely
2006-10-27 2:37 ` Grant Likely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox