* [U-Boot] [PATCH 2/3] ARM: mx6: Remove CONFIG_ARCH_CPU_INIT
2012-03-01 14:02 [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency Fabio Estevam
@ 2012-03-01 14:02 ` Fabio Estevam
2012-03-01 18:31 ` Marek Vasut
2012-03-01 14:02 ` [U-Boot] [PATCH 3/3] ARM: mx28: " Fabio Estevam
` (4 subsequent siblings)
5 siblings, 1 reply; 18+ messages in thread
From: Fabio Estevam @ 2012-03-01 14:02 UTC (permalink / raw)
To: u-boot
No need to define CONFIG_ARCH_CPU_INIT.
All mx6 based boards should use arch_cpu_init().
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/cpu/armv7/mx6/soc.c | 2 --
include/configs/mx6qarm2.h | 1 -
include/configs/mx6qsabrelite.h | 1 -
3 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index 2ac74b5..2d07099 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -37,7 +37,6 @@ u32 get_cpu_rev(void)
return system_rev;
}
-#ifdef CONFIG_ARCH_CPU_INIT
void init_aips(void)
{
struct aipstz_regs *aips1, *aips2;
@@ -77,7 +76,6 @@ int arch_cpu_init(void)
return 0;
}
-#endif
#if defined(CONFIG_FEC_MXC)
void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
diff --git a/include/configs/mx6qarm2.h b/include/configs/mx6qarm2.h
index 0962d3c..87ff0a3 100644
--- a/include/configs/mx6qarm2.h
+++ b/include/configs/mx6qarm2.h
@@ -37,7 +37,6 @@
/* Size of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
-#define CONFIG_ARCH_CPU_INIT
#define CONFIG_BOARD_EARLY_INIT_F
#define CONFIG_MXC_GPIO
diff --git a/include/configs/mx6qsabrelite.h b/include/configs/mx6qsabrelite.h
index 93000f0..85e6570 100644
--- a/include/configs/mx6qsabrelite.h
+++ b/include/configs/mx6qsabrelite.h
@@ -37,7 +37,6 @@
/* Size of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
-#define CONFIG_ARCH_CPU_INIT
#define CONFIG_BOARD_EARLY_INIT_F
#define CONFIG_MXC_GPIO
--
1.7.1
^ permalink raw reply related [flat|nested] 18+ messages in thread* [U-Boot] [PATCH 2/3] ARM: mx6: Remove CONFIG_ARCH_CPU_INIT
2012-03-01 14:02 ` [U-Boot] [PATCH 2/3] ARM: mx6: Remove CONFIG_ARCH_CPU_INIT Fabio Estevam
@ 2012-03-01 18:31 ` Marek Vasut
2012-07-07 11:25 ` Albert ARIBAUD
0 siblings, 1 reply; 18+ messages in thread
From: Marek Vasut @ 2012-03-01 18:31 UTC (permalink / raw)
To: u-boot
> No need to define CONFIG_ARCH_CPU_INIT.
>
> All mx6 based boards should use arch_cpu_init().
>
Acked-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> arch/arm/cpu/armv7/mx6/soc.c | 2 --
> include/configs/mx6qarm2.h | 1 -
> include/configs/mx6qsabrelite.h | 1 -
> 3 files changed, 0 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
> index 2ac74b5..2d07099 100644
> --- a/arch/arm/cpu/armv7/mx6/soc.c
> +++ b/arch/arm/cpu/armv7/mx6/soc.c
> @@ -37,7 +37,6 @@ u32 get_cpu_rev(void)
> return system_rev;
> }
>
> -#ifdef CONFIG_ARCH_CPU_INIT
> void init_aips(void)
> {
> struct aipstz_regs *aips1, *aips2;
> @@ -77,7 +76,6 @@ int arch_cpu_init(void)
>
> return 0;
> }
> -#endif
>
> #if defined(CONFIG_FEC_MXC)
> void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
> diff --git a/include/configs/mx6qarm2.h b/include/configs/mx6qarm2.h
> index 0962d3c..87ff0a3 100644
> --- a/include/configs/mx6qarm2.h
> +++ b/include/configs/mx6qarm2.h
> @@ -37,7 +37,6 @@
> /* Size of malloc() pool */
> #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 *
1024)
>
> -#define CONFIG_ARCH_CPU_INIT
> #define CONFIG_BOARD_EARLY_INIT_F
> #define CONFIG_MXC_GPIO
>
> diff --git a/include/configs/mx6qsabrelite.h
> b/include/configs/mx6qsabrelite.h index 93000f0..85e6570 100644
> --- a/include/configs/mx6qsabrelite.h
> +++ b/include/configs/mx6qsabrelite.h
> @@ -37,7 +37,6 @@
> /* Size of malloc() pool */
> #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
>
> -#define CONFIG_ARCH_CPU_INIT
> #define CONFIG_BOARD_EARLY_INIT_F
> #define CONFIG_MXC_GPIO
^ permalink raw reply [flat|nested] 18+ messages in thread* [U-Boot] [PATCH 2/3] ARM: mx6: Remove CONFIG_ARCH_CPU_INIT
2012-03-01 18:31 ` Marek Vasut
@ 2012-07-07 11:25 ` Albert ARIBAUD
0 siblings, 0 replies; 18+ messages in thread
From: Albert ARIBAUD @ 2012-07-07 11:25 UTC (permalink / raw)
To: u-boot
Hi Fabio,
Le Thu, 1 Mar 2012 19:31:45 +0100,
Marek Vasut <marex@denx.de> a ?crit :
> > No need to define CONFIG_ARCH_CPU_INIT.
> >
> > All mx6 based boards should use arch_cpu_init().
> >
>
> Acked-by: Marek Vasut <marex@denx.de>
>
> > Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> > ---
Applied (rebased) to u-boot-arm/master, thanks.
Amicalement,
--
Albert.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 3/3] ARM: mx28: Remove CONFIG_ARCH_CPU_INIT
2012-03-01 14:02 [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency Fabio Estevam
2012-03-01 14:02 ` [U-Boot] [PATCH 2/3] ARM: mx6: Remove CONFIG_ARCH_CPU_INIT Fabio Estevam
@ 2012-03-01 14:02 ` Fabio Estevam
2012-03-01 18:31 ` Marek Vasut
2012-03-01 18:31 ` [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency Marek Vasut
` (3 subsequent siblings)
5 siblings, 1 reply; 18+ messages in thread
From: Fabio Estevam @ 2012-03-01 14:02 UTC (permalink / raw)
To: u-boot
No need to define CONFIG_ARCH_CPU_INIT.
All mx28 based boards should use arch_cpu_init().
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/cpu/arm926ejs/mx28/mx28.c | 2 --
include/configs/m28evk.h | 1 -
include/configs/mx28evk.h | 1 -
3 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/mx28/mx28.c b/arch/arm/cpu/arm926ejs/mx28/mx28.c
index b235091..f98e6a3 100644
--- a/arch/arm/cpu/arm926ejs/mx28/mx28.c
+++ b/arch/arm/cpu/arm926ejs/mx28/mx28.c
@@ -135,7 +135,6 @@ int arch_misc_init(void)
}
#endif
-#ifdef CONFIG_ARCH_CPU_INIT
int arch_cpu_init(void)
{
struct mx28_clkctrl_regs *clkctrl_regs =
@@ -164,7 +163,6 @@ int arch_cpu_init(void)
return 0;
}
-#endif
#if defined(CONFIG_DISPLAY_CPUINFO)
int print_cpuinfo(void)
diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
index 4d59153..31aaf47 100644
--- a/include/configs/m28evk.h
+++ b/include/configs/m28evk.h
@@ -40,7 +40,6 @@
#define CONFIG_SYS_ICACHE_OFF
#define CONFIG_SYS_DCACHE_OFF
#define CONFIG_BOARD_EARLY_INIT_F
-#define CONFIG_ARCH_CPU_INIT
#define CONFIG_ARCH_MISC_INIT
/*
diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 04967d7..92903da 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -34,7 +34,6 @@
#define CONFIG_SYS_ICACHE_OFF
#define CONFIG_SYS_DCACHE_OFF
#define CONFIG_BOARD_EARLY_INIT_F
-#define CONFIG_ARCH_CPU_INIT
#define CONFIG_ARCH_MISC_INIT
/*
--
1.7.1
^ permalink raw reply related [flat|nested] 18+ messages in thread* [U-Boot] [PATCH 3/3] ARM: mx28: Remove CONFIG_ARCH_CPU_INIT
2012-03-01 14:02 ` [U-Boot] [PATCH 3/3] ARM: mx28: " Fabio Estevam
@ 2012-03-01 18:31 ` Marek Vasut
2012-07-07 11:31 ` Albert ARIBAUD
0 siblings, 1 reply; 18+ messages in thread
From: Marek Vasut @ 2012-03-01 18:31 UTC (permalink / raw)
To: u-boot
> No need to define CONFIG_ARCH_CPU_INIT.
>
> All mx28 based boards should use arch_cpu_init().
>
Acked-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> arch/arm/cpu/arm926ejs/mx28/mx28.c | 2 --
> include/configs/m28evk.h | 1 -
> include/configs/mx28evk.h | 1 -
> 3 files changed, 0 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/cpu/arm926ejs/mx28/mx28.c
> b/arch/arm/cpu/arm926ejs/mx28/mx28.c index b235091..f98e6a3 100644
> --- a/arch/arm/cpu/arm926ejs/mx28/mx28.c
> +++ b/arch/arm/cpu/arm926ejs/mx28/mx28.c
> @@ -135,7 +135,6 @@ int arch_misc_init(void)
> }
> #endif
>
> -#ifdef CONFIG_ARCH_CPU_INIT
> int arch_cpu_init(void)
> {
> struct mx28_clkctrl_regs *clkctrl_regs =
> @@ -164,7 +163,6 @@ int arch_cpu_init(void)
>
> return 0;
> }
> -#endif
>
> #if defined(CONFIG_DISPLAY_CPUINFO)
> int print_cpuinfo(void)
> diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
> index 4d59153..31aaf47 100644
> --- a/include/configs/m28evk.h
> +++ b/include/configs/m28evk.h
> @@ -40,7 +40,6 @@
> #define CONFIG_SYS_ICACHE_OFF
> #define CONFIG_SYS_DCACHE_OFF
> #define CONFIG_BOARD_EARLY_INIT_F
> -#define CONFIG_ARCH_CPU_INIT
> #define CONFIG_ARCH_MISC_INIT
>
> /*
> diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
> index 04967d7..92903da 100644
> --- a/include/configs/mx28evk.h
> +++ b/include/configs/mx28evk.h
> @@ -34,7 +34,6 @@
> #define CONFIG_SYS_ICACHE_OFF
> #define CONFIG_SYS_DCACHE_OFF
> #define CONFIG_BOARD_EARLY_INIT_F
> -#define CONFIG_ARCH_CPU_INIT
> #define CONFIG_ARCH_MISC_INIT
>
> /*
^ permalink raw reply [flat|nested] 18+ messages in thread* [U-Boot] [PATCH 3/3] ARM: mx28: Remove CONFIG_ARCH_CPU_INIT
2012-03-01 18:31 ` Marek Vasut
@ 2012-07-07 11:31 ` Albert ARIBAUD
2012-07-19 17:28 ` Marek Vasut
0 siblings, 1 reply; 18+ messages in thread
From: Albert ARIBAUD @ 2012-07-07 11:31 UTC (permalink / raw)
To: u-boot
Hi Fabio,
On Thu, 1 Mar 2012 19:31:54 +0100, Marek Vasut <marex@denx.de> wrote:
> > No need to define CONFIG_ARCH_CPU_INIT.
> >
> > All mx28 based boards should use arch_cpu_init().
> >
>
> Acked-by: Marek Vasut <marex@denx.de>
>
> > Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> > ---
Applied to ub-boot-arm/master, thanks.
Amicalement,
--
Albert.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 3/3] ARM: mx28: Remove CONFIG_ARCH_CPU_INIT
2012-07-07 11:31 ` Albert ARIBAUD
@ 2012-07-19 17:28 ` Marek Vasut
0 siblings, 0 replies; 18+ messages in thread
From: Marek Vasut @ 2012-07-19 17:28 UTC (permalink / raw)
To: u-boot
Dear Albert ARIBAUD,
> Hi Fabio,
>
> On Thu, 1 Mar 2012 19:31:54 +0100, Marek Vasut <marex@denx.de> wrote:
> > > No need to define CONFIG_ARCH_CPU_INIT.
> > >
> > > All mx28 based boards should use arch_cpu_init().
> >
> > Acked-by: Marek Vasut <marex@denx.de>
> >
> > > Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> > > ---
>
> Applied to ub-boot-arm/master, thanks.
Did you also apply 1/3 ? If not, everything will be broken now (at least mx28
doesn't boot without 1/3 applied as well).
> Amicalement,
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency
2012-03-01 14:02 [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency Fabio Estevam
2012-03-01 14:02 ` [U-Boot] [PATCH 2/3] ARM: mx6: Remove CONFIG_ARCH_CPU_INIT Fabio Estevam
2012-03-01 14:02 ` [U-Boot] [PATCH 3/3] ARM: mx28: " Fabio Estevam
@ 2012-03-01 18:31 ` Marek Vasut
2012-03-01 20:51 ` Albert ARIBAUD
` (2 subsequent siblings)
5 siblings, 0 replies; 18+ messages in thread
From: Marek Vasut @ 2012-03-01 18:31 UTC (permalink / raw)
To: u-boot
> Create a weak-aliased arch_cpu_init, so that we can get rid of
> CONFIG_ARCH_CPU_INIT and always call arch_cpu_init.
>
> This way we do not need to define CONFIG_ARCH_CPU_INIT in every board file,
> since arch_cpu_init() is supposed to handle common CPU level code.
Acked-by: Marek Vasut <marex@denx.de>
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> arch/arm/lib/board.c | 10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
> index 500e216..6463db5 100644
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
> @@ -224,10 +224,16 @@ 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
^ permalink raw reply [flat|nested] 18+ messages in thread* [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency
2012-03-01 14:02 [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency Fabio Estevam
` (2 preceding siblings ...)
2012-03-01 18:31 ` [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency Marek Vasut
@ 2012-03-01 20:51 ` Albert ARIBAUD
2012-03-01 20:57 ` Fabio Estevam
2012-03-03 10:01 ` Stefano Babic
2012-03-05 17:52 ` Tom Rini
5 siblings, 1 reply; 18+ messages in thread
From: Albert ARIBAUD @ 2012-03-01 20:51 UTC (permalink / raw)
To: u-boot
Le 01/03/2012 15:02, Fabio Estevam a ?crit :
> Create a weak-aliased arch_cpu_init, so that we can get rid of CONFIG_ARCH_CPU_INIT
> and always call arch_cpu_init.
>
> This way we do not need to define CONFIG_ARCH_CPU_INIT in every board file, since
> arch_cpu_init() is supposed to handle common CPU level code.
This adds (some) (functionally dead) code to all boards that did not
require arch_cpu_init().
Amicalement,
--
Albert.
^ permalink raw reply [flat|nested] 18+ messages in thread* [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency
2012-03-01 20:51 ` Albert ARIBAUD
@ 2012-03-01 20:57 ` Fabio Estevam
2012-03-01 21:44 ` Albert ARIBAUD
0 siblings, 1 reply; 18+ messages in thread
From: Fabio Estevam @ 2012-03-01 20:57 UTC (permalink / raw)
To: u-boot
On Thu, Mar 1, 2012 at 5:51 PM, Albert ARIBAUD
<albert.u.boot@aribaud.net> wrote:
> This adds (some) (functionally dead) code to all boards that did not require
> arch_cpu_init().
Yes, it adds a "return 0" only. Is this terribly bad?
Isn't it better than having to select CONFIG_ARCH_CPU_INIT for every
board to select arch_cpu_init(), which is supposed to be CPU
dependent?
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency
2012-03-01 20:57 ` Fabio Estevam
@ 2012-03-01 21:44 ` Albert ARIBAUD
2012-03-05 17:56 ` Tom Rini
0 siblings, 1 reply; 18+ messages in thread
From: Albert ARIBAUD @ 2012-03-01 21:44 UTC (permalink / raw)
To: u-boot
Le 01/03/2012 21:57, Fabio Estevam a ?crit :
> On Thu, Mar 1, 2012 at 5:51 PM, Albert ARIBAUD
> <albert.u.boot@aribaud.net> wrote:
>
>> This adds (some) (functionally dead) code to all boards that did not require
>> arch_cpu_init().
>
> Yes, it adds a "return 0" only. Is this terribly bad?
Well...
> Isn't it better than having to select CONFIG_ARCH_CPU_INIT for every
> board to select arch_cpu_init(), which is supposed to be CPU
> dependent?
It adds a "#define CONFIG_ARCH_CPU_INTI" only. Is this terribly bad ?
If what bothers you is that some board all repeat something that should
be done only once, then it should bother you just as much that many
boards repeat something that should not be done at all most of the time.
I understand that you see a repetition of CONFIG_ARCH_CPU_INIT that you
suspect is highly redundant. But then, you should cure the repetition,
not the existence of CONFIG_ARCH_CPU_INIT.
How about this approach: since the problem is the presence of CPU- (or
Soc-)level elements in board-level config files, and since there are
probably many other such items in board config files (CPU type in a SoC
and HW IP configurations, for instance) then why not introduce some
cpu-config and soc-config file which would group all those cpu- (resp
soc-)level items, including any "#define CONFIG_ARCH_CPU_INIT", and
replace these items in board config files with a single "#include
"<cpu>-config.h" (or "<soc>-config.h")? This would significantly reduce
board config file size.
One could even choose either of two courses depending on how many or how
few boards require CONFIG_ARCH_CPU_INIT: if many boards require it, let
the cpu- or soc-common config contain the define, and the few boards
which don't will have to explicitly undefine it; if only a few boards
need the define, then it won't be done in the cpu- or soc-common config
but in each board that requires it.
And CPUs, SoCs and boards that don't need ARCH_CPU_INIT at all won't
grow a single useless byte.
Amicalement,
--
Albert.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency
2012-03-01 21:44 ` Albert ARIBAUD
@ 2012-03-05 17:56 ` Tom Rini
2012-03-06 7:26 ` Albert ARIBAUD
0 siblings, 1 reply; 18+ messages in thread
From: Tom Rini @ 2012-03-05 17:56 UTC (permalink / raw)
To: u-boot
On Thu, Mar 01, 2012 at 10:44:09PM +0100, Albert ARIBAUD wrote:
> How about this approach: since the problem is the presence of CPU-
> (or Soc-)level elements in board-level config files, and since there
> are probably many other such items in board config files (CPU type
> in a SoC and HW IP configurations, for instance) then why not
> introduce some cpu-config and soc-config file which would group all
> those cpu- (resp soc-)level items, including any "#define
> CONFIG_ARCH_CPU_INIT", and replace these items in board config files
> with a single "#include "<cpu>-config.h" (or "<soc>-config.h")? This
> would significantly reduce board config file size.
Note that omap4/5 do something like this already and my hope is to do
this for omap3/similar and make some other common files as well. It's
not the top priority for me atm however...
--
Tom
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency
2012-03-05 17:56 ` Tom Rini
@ 2012-03-06 7:26 ` Albert ARIBAUD
0 siblings, 0 replies; 18+ messages in thread
From: Albert ARIBAUD @ 2012-03-06 7:26 UTC (permalink / raw)
To: u-boot
Hi Tom,
Le 05/03/2012 18:56, Tom Rini a ?crit :
> On Thu, Mar 01, 2012 at 10:44:09PM +0100, Albert ARIBAUD wrote:
>
>> How about this approach: since the problem is the presence of CPU-
>> (or Soc-)level elements in board-level config files, and since there
>> are probably many other such items in board config files (CPU type
>> in a SoC and HW IP configurations, for instance) then why not
>> introduce some cpu-config and soc-config file which would group all
>> those cpu- (resp soc-)level items, including any "#define
>> CONFIG_ARCH_CPU_INIT", and replace these items in board config files
>> with a single "#include "<cpu>-config.h" (or "<soc>-config.h")? This
>> would significantly reduce board config file size.
>
> Note that omap4/5 do something like this already and my hope is to do
> this for omap3/similar and make some other common files as well. It's
> not the top priority for me atm however...
Ok, so that's one more reason not to go the "everybody call (a possibly
weak and empty) arch_cpu_init()" route.
Amicalement,
--
Albert.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency
2012-03-01 14:02 [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency Fabio Estevam
` (3 preceding siblings ...)
2012-03-01 20:51 ` Albert ARIBAUD
@ 2012-03-03 10:01 ` Stefano Babic
2012-03-05 17:52 ` Tom Rini
5 siblings, 0 replies; 18+ messages in thread
From: Stefano Babic @ 2012-03-03 10:01 UTC (permalink / raw)
To: u-boot
On 01/03/2012 15:02, Fabio Estevam wrote:
> Create a weak-aliased arch_cpu_init, so that we can get rid of CONFIG_ARCH_CPU_INIT
> and always call arch_cpu_init.
>
> This way we do not need to define CONFIG_ARCH_CPU_INIT in every board file, since
> arch_cpu_init() is supposed to handle common CPU level code.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> arch/arm/lib/board.c | 10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
> index 500e216..6463db5 100644
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
> @@ -224,10 +224,16 @@ 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
Acked-by: Stefano Babic <sbabic@denx.de>
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 18+ messages in thread* [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency
2012-03-01 14:02 [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency Fabio Estevam
` (4 preceding siblings ...)
2012-03-03 10:01 ` Stefano Babic
@ 2012-03-05 17:52 ` Tom Rini
2012-03-05 17:58 ` Fabio Estevam
5 siblings, 1 reply; 18+ messages in thread
From: Tom Rini @ 2012-03-05 17:52 UTC (permalink / raw)
To: u-boot
On Thu, Mar 01, 2012 at 11:02:38AM -0300, Fabio Estevam wrote:
> Create a weak-aliased arch_cpu_init, so that we can get rid of CONFIG_ARCH_CPU_INIT
> and always call arch_cpu_init.
>
> This way we do not need to define CONFIG_ARCH_CPU_INIT in every board file, since
> arch_cpu_init() is supposed to handle common CPU level code.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> arch/arm/lib/board.c | 10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
> index 500e216..6463db5 100644
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
> @@ -224,10 +224,16 @@ 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")));
> +
Please add <linux/compiler.h> and use __weak instead.
--
Tom
^ permalink raw reply [flat|nested] 18+ messages in thread* [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency
2012-03-05 17:52 ` Tom Rini
@ 2012-03-05 17:58 ` Fabio Estevam
2012-03-05 18:12 ` Fabio Estevam
0 siblings, 1 reply; 18+ messages in thread
From: Fabio Estevam @ 2012-03-05 17:58 UTC (permalink / raw)
To: u-boot
On Mon, Mar 5, 2012 at 2:52 PM, Tom Rini <trini@ti.com> wrote:
>> +int __arch_cpu_init(void)
>> +{
>> + ? ? return 0;
>> +}
>> +int arch_cpu_init(void)
>> + ? ? __attribute__((weak, alias("__arch_cpu_init")));
>> +
>
> Please add <linux/compiler.h> and use __weak instead.
Ok, before I rework this patch I would like to confirm with Albert if
I should proceed with this patch series, or if he NACKs this idea.
Regards,
Fabio Estevam
^ permalink raw reply [flat|nested] 18+ messages in thread* [U-Boot] [PATCH 1/3] ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependency
2012-03-05 17:58 ` Fabio Estevam
@ 2012-03-05 18:12 ` Fabio Estevam
0 siblings, 0 replies; 18+ messages in thread
From: Fabio Estevam @ 2012-03-05 18:12 UTC (permalink / raw)
To: u-boot
On Mon, Mar 5, 2012 at 2:58 PM, Fabio Estevam <festevam@gmail.com> wrote:
> On Mon, Mar 5, 2012 at 2:52 PM, Tom Rini <trini@ti.com> wrote:
>
>>> +int __arch_cpu_init(void)
>>> +{
>>> + ? ? return 0;
>>> +}
>>> +int arch_cpu_init(void)
>>> + ? ? __attribute__((weak, alias("__arch_cpu_init")));
>>> +
>>
>> Please add <linux/compiler.h> and use __weak instead.
>
> Ok, before I rework this patch I would like to confirm with Albert if
> I should proceed with this patch series, or if he NACKs this idea.
By "this idea" I mean the removal of CONFIG_ARCH_CPU_INIT.
^ permalink raw reply [flat|nested] 18+ messages in thread