From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anatolij Gustschin Date: Thu, 15 Apr 2010 12:24:16 +0200 Subject: [U-Boot] [PATCH v3 3/3] mpc5121: pdm360ng: add coprocessor POST In-Reply-To: <20100414154016.C7A6DE85054@gemini.denx.de> References: <20100321192306.BFE104C022@gemini.denx.de> <1271254909-20398-1-git-send-email-agust@denx.de> <1271254909-20398-2-git-send-email-agust@denx.de> <1271254909-20398-3-git-send-email-agust@denx.de> <1271254909-20398-4-git-send-email-agust@denx.de> <20100414154016.C7A6DE85054@gemini.denx.de> Message-ID: <20100415122416.050f31a8@wker> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Wolfgang, On Wed, 14 Apr 2010 17:40:16 +0200 Wolfgang Denk wrote: > ... > > --- a/post/tests.c > > +++ b/post/tests.c > > @@ -53,6 +53,7 @@ extern int gdc_post_test (int flags); > > extern int fpga_post_test (int flags); > > extern int lwmon5_watchdog_post_test(int flags); > > extern int sysmon1_post_test(int flags); > > +extern int pdm360ng_coprocessor_post_test(int flags); > > > > extern int sysmon_init_f (void); > > > > @@ -286,6 +287,18 @@ struct post_test post_list[] = > > #if CONFIG_POST & CONFIG_SYS_POST_BSPEC5 > > CONFIG_POST_BSPEC5, > > #endif > > +#if CONFIG_POST & CONFIG_SYS_POST_COPROC > > + { > > + "Coprocessors communication test", > > + "coproc_com", > > + "This test checks communication with coprocessors.", > > + POST_RAM | POST_ALWAYS | POST_CRITICAL, > > + &pdm360ng_coprocessor_post_test, > > + NULL, > > + NULL, > > + CONFIG_SYS_POST_COPROC > > + } > > +#endif > > }; > > I don't want to see board specific code (pdm360ng_*) in such a global > file. Please use a more generic approach. What would be a preferred way to realize this? Defining a weak function in post/post.c or post/tests.c which could be over-ridden by board specific one? Like: int __post_coprocessor_post_test(int flags) { return 0; } int coprocessor_post_test(int flags) __attribute__((weak, alias("__post_coprocessor_post_test"))); Then I have to put board specific post code in board/pdm360ng/post.c to the pdm360ng.c file back. Otherwise the board's coprocessor_post_test() function is not linked if there is no other code in this post.c file which is strongly-linked. Anatolij