[U-Boot] (brief?) question on POST, post_test "void (*reloc) (void)" member

Robert P. J. Day rpjday at crashcourse.ca
Mon Mar 28 14:53:02 CEST 2016


  i was about to dig into this until i noticed that, since i'm working
on PPC, i shouldn't(?) care about it.

  as i read it, if one sets that function pointer, as in (from
post/tests.c):

#if CONFIG_POST & CONFIG_SYS_POST_SYSMON
    {
        "SYSMON test",
        "sysmon",
        "This test monitors system hardware.",
        POST_RAM | POST_ALWAYS,
        &sysmon_post_test,
        &sysmon_init_f,
        &sysmon_reloc,                   <----- there
        CONFIG_SYS_POST_SYSMON
    },
#endif

the only place i see that function being invoked is in post/post.c,
and requires the config setting CONFIG_NEEDS_MANUAL_RELOC:

#ifdef CONFIG_NEEDS_MANUAL_RELOC
void post_reloc(void)
{
        unsigned int i;

        /*
         * We have to relocate the test table manually
         */
        for (i = 0; i < post_list_size; i++) {

        ... snip ...

                if (test->reloc) {
                        addr = (ulong)(test->reloc) + gd->reloc_off;
                        test->reloc = (void (*)(void)) addr;

                        test->reloc();        <----- invoke there
                }
        }
}
#endif

  but the only architectures that define that config option don't
appear to include PPC:

$ grep -r "define CONFIG_NEEDS_MANUAL_RELOC" *
arch/sparc/include/asm/config.h:#define CONFIG_NEEDS_MANUAL_RELOC
arch/nds32/include/asm/config.h:#define CONFIG_NEEDS_MANUAL_RELOC
arch/microblaze/include/asm/config.h:#define CONFIG_NEEDS_MANUAL_RELOC
arch/avr32/include/asm/config.h:#define CONFIG_NEEDS_MANUAL_RELOC
arch/m68k/include/asm/config.h:#define CONFIG_NEEDS_MANUAL_RELOC
include/configs/adp-ag101p.h:#define CONFIG_NEEDS_MANUAL_RELOC
$

  so unless there is some weird corner case where one would register a
function pointer there for some specific PPC board, am i safe to
ignore that for PPC? (i do notice that, for the sample board lwmon5,
one is forced to register a no-op routine there simply because you
*must* assign a function there if you select that test.)

  probably a couple more POST-related questions coming, at which point
i'll put together a patch to update doc/README.POST unless someone
else is already on that.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



More information about the U-Boot mailing list