From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Do we really need CONFIG_ARCH_CPU_INIT ?
Date: Thu, 1 Mar 2012 14:48:12 +0100 [thread overview]
Message-ID: <201203011448.13128.marek.vasut@gmail.com> (raw)
In-Reply-To: <CAOMZO5BgtV61eA3p0hih363QmR4rXbjH09ht=O7727wWb1ok-Q@mail.gmail.com>
> 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.
I'm all for this.
M
next prev parent reply other threads:[~2012-03-01 13:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-01 13:23 [U-Boot] Do we really need CONFIG_ARCH_CPU_INIT ? Fabio Estevam
2012-03-01 13:48 ` Marek Vasut [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201203011448.13128.marek.vasut@gmail.com \
--to=marek.vasut@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox