[U-Boot] [PATCH v3 2/8] SPL: Port SPL framework to powerpc

Scott Wood
2012-10-02T20:08:56Z

On 10/02/2012 05:20:54 AM, Stefan Roese wrote:
> On 09/29/2012 01:13 AM, Scott Wood wrote:
> > On 09/26/2012 04:01:08 AM, Stefan Roese wrote:
> >> This patch enables the SPL framework to be used on powerpc
> platforms
> >> and not only ARM.
> >>
> >> Signed-off-by: Stefan Roese <sr@denx.de>
> >> ---
> >> Changes in v2:
> >> - Rebased on Tom's SPL framework patches v4
> >> - Add option to skip copying of the mkimage header
> >>
> >> arch/powerpc/lib/Makefile | 1 +
> >> arch/powerpc/lib/spl.c | 42
> >> ++++++++++++++++++++++++++++++++++++++++++
> >> common/spl/spl.c | 10 ++++++++++
> >> 3 files changed, 53 insertions(+)
> >> create mode 100644 arch/powerpc/lib/spl.c
> >>
> >> diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
> >> index 965f9ea..9bcbdde 100644
> >> --- a/arch/powerpc/lib/Makefile
> >> +++ b/arch/powerpc/lib/Makefile
> >> @@ -50,6 +50,7 @@ COBJS-y += cache.o
> >> COBJS-y += extable.o
> >> COBJS-y += interrupts.o
> >> COBJS-$(CONFIG_CMD_KGDB) += kgdb.o
> >> +COBJS-$(CONFIG_SPL_FRAMEWORK) += spl.o
> >> COBJS-y += time.o
> >
> > Won't this build spl.o into the main U-Boot as well?
>
> Yes. I'll fix it in the next patchset version.
>
> >> +/*
> >> + * This function jumps to an image with argument. Normally an FDT
> or
> >> ATAGS
> >> + * image.
> >> + * arg: Pointer to paramter image in RAM
> >> + */
> >> +#ifdef CONFIG_SPL_OS_BOOT
> >> +void __noreturn jump_to_image_linux(void *arg)
> >> +{
> >> + debug("Entering kernel arg pointer: 0x%p\n", arg);
> >> + typedef void (*image_entry_arg_t)(void *, ulong r4, ulong r5,
> >> ulong r6,
> >> + ulong r7, ulong r8, ulong r9)
> >> + __attribute__ ((noreturn));
> >> + image_entry_arg_t image_entry =
> >> + (image_entry_arg_t)spl_image.entry_point;
> >> +
> >> + image_entry(arg, 0, 0, EPAPR_MAGIC, CONFIG_SYS_BOOTMAPSZ, 0, 0);
> >> +}
> >
> > At what point does the image get cache-flushed?
>
> Not at all right now. MPC5200 has dcache disabled, at least in the
> SPL.
> Other PowerPC architectures might add a cache flush here if needed at
> some time. Okay?

Or they might forget to do so and have weird bugs.

Why not just call flush_cache() on the image now? Non-SPL does this in
common code, not even PPC-specific.

-Scott