public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Do we really need CONFIG_ARCH_CPU_INIT ?
@ 2012-03-01 13:23 Fabio Estevam
  2012-03-01 13:48 ` Marek Vasut
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Fabio Estevam @ 2012-03-01 13:23 UTC (permalink / raw)
  To: u-boot

Hi,

Currently CONFIG_ARCH_CPU_INIT is used to select arch_cpu_init() function.

arch_cpu_init() does CPU level initialization, so why do we need to
include CONFIG_ARCH_CPU_INIT in the include/configs/boardXYZ files,
which are board related files ?

For example:

Let's say boards X, Y and Z are based on SoC S:

1. If processor S has a arch_cpu_init() defined, then it means that
X,Y,Z need the code from arch_cpu_init() and then we need to define
CONFIG_ARCH_CPU_INIT for each of these boards (actually all the boards
based on this processor would need CONFIG_ARCH_CPU_INIT)

2. If not all boards need the code inside arch_cpu_init() for
processor S, then it means that this code is not really CPU specific
and then it should be moved to board code.

I was thinking in doing the following:

--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -224,10 +224,15 @@ void __dram_init_banksize(void)
 void dram_init_banksize(void)
        __attribute__((weak, alias("__dram_init_banksize")));

+int __arch_cpu_init(void)
+{
+       return 0;
+}
+int arch_cpu_init(void)
+       __attribute__((weak, alias("__arch_cpu_init")));
+
 init_fnc_t *init_sequence[] = {
-#if defined(CONFIG_ARCH_CPU_INIT)
        arch_cpu_init,          /* basic arch cpu dependent setup */
-#endif
 #if defined(CONFIG_BOARD_EARLY_INIT_F)
        board_early_init_f,
 #endif

,so that CONFIG_ARCH_CPU_INIT is not needed anymore.

Before I go further in this route to remove CONFIG_ARCH_CPU_INIT from
other places, I would like to know if this makes sense.

Thanks,

Fabio Estevam

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-03-02  9:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-01 13:23 [U-Boot] Do we really need CONFIG_ARCH_CPU_INIT ? Fabio Estevam
2012-03-01 13:48 ` Marek Vasut
2012-03-02  7:19   ` Stefan Roese
2012-03-01 20:48 ` Albert ARIBAUD
2012-03-02  8:46   ` Christian Riesch
2012-03-02  9:41     ` Christian Riesch
2012-03-01 21:28 ` Simon Glass
2012-03-01 22:19   ` Graeme Russ

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox