diff mbox

[U-Boot,14/39] x86: Use the standard arch_cpu_init() function

Message ID 1415305231-30180-15-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Nov. 6, 2014, 8:20 p.m. UTC
Instead of an x86-specific cpu_init_f() function, use the normal U-Boot one
for this purpose. Also remove a useless/misleading comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/x86/cpu/coreboot/coreboot.c  | 5 +----
 arch/x86/cpu/cpu.c                | 1 -
 arch/x86/include/asm/u-boot-x86.h | 1 +
 common/board_f.c                  | 1 -
 4 files changed, 2 insertions(+), 6 deletions(-)

Comments

Bin Meng Nov. 7, 2014, 9:49 a.m. UTC | #1
On Fri, Nov 7, 2014 at 4:20 AM, Simon Glass <sjg@chromium.org> wrote:
> Instead of an x86-specific cpu_init_f() function, use the normal U-Boot one
> for this purpose. Also remove a useless/misleading comment.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  arch/x86/cpu/coreboot/coreboot.c  | 5 +----
>  arch/x86/cpu/cpu.c                | 1 -
>  arch/x86/include/asm/u-boot-x86.h | 1 +
>  common/board_f.c                  | 1 -
>  4 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c
> index e24f13a..b640f35 100644
> --- a/arch/x86/cpu/coreboot/coreboot.c
> +++ b/arch/x86/cpu/coreboot/coreboot.c
> @@ -20,10 +20,7 @@
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> -/*
> - * Miscellaneous platform dependent initializations
> - */
> -int cpu_init_f(void)
> +int arch_cpu_init(void)
>  {
>         int ret = get_coreboot_info(&lib_sysinfo);
>         if (ret != 0)
> diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
> index 2e25253..d6ba246 100644
> --- a/arch/x86/cpu/cpu.c
> +++ b/arch/x86/cpu/cpu.c
> @@ -130,7 +130,6 @@ int x86_cpu_init_f(void)
>
>         return 0;
>  }
> -int cpu_init_f(void) __attribute__((weak, alias("x86_cpu_init_f")));
>
>  int x86_cpu_init_r(void)
>  {
> diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h
> index 89618c7..fdb8a6c 100644
> --- a/arch/x86/include/asm/u-boot-x86.h
> +++ b/arch/x86/include/asm/u-boot-x86.h
> @@ -9,6 +9,7 @@
>  #define _U_BOOT_I386_H_        1
>
>  /* cpu/.../cpu.c */
> +int arch_cpu_init(void);
>  int x86_cpu_init_r(void);
>  int cpu_init_r(void);
>  int x86_cpu_init_f(void);
> diff --git a/common/board_f.c b/common/board_f.c
> index df02ca5..f81f70d 100644
> --- a/common/board_f.c
> +++ b/common/board_f.c
> @@ -819,7 +819,6 @@ static init_fnc_t init_sequence_f[] = {
>  #endif
>         arch_cpu_init,          /* basic arch cpu dependent setup */
>  #ifdef CONFIG_X86
> -       cpu_init_f,             /* TODO(sjg@chromium.org): remove */
>  # ifdef CONFIG_OF_CONTROL
>         find_fdt,               /* TODO(sjg@chromium.org): remove */
>  # endif
> --

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass Nov. 8, 2014, 7:40 p.m. UTC | #2
On 7 November 2014 02:49, Bin Meng <bmeng.cn@gmail.com> wrote:
> On Fri, Nov 7, 2014 at 4:20 AM, Simon Glass <sjg@chromium.org> wrote:
>> Instead of an x86-specific cpu_init_f() function, use the normal U-Boot one
>> for this purpose. Also remove a useless/misleading comment.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>>
>>  arch/x86/cpu/coreboot/coreboot.c  | 5 +----
>>  arch/x86/cpu/cpu.c                | 1 -
>>  arch/x86/include/asm/u-boot-x86.h | 1 +
>>  common/board_f.c                  | 1 -
>>  4 files changed, 2 insertions(+), 6 deletions(-)
>>
>> diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c
>> index e24f13a..b640f35 100644
>> --- a/arch/x86/cpu/coreboot/coreboot.c
>> +++ b/arch/x86/cpu/coreboot/coreboot.c
>> @@ -20,10 +20,7 @@
>>
>>  DECLARE_GLOBAL_DATA_PTR;
>>
>> -/*
>> - * Miscellaneous platform dependent initializations
>> - */
>> -int cpu_init_f(void)
>> +int arch_cpu_init(void)
>>  {
>>         int ret = get_coreboot_info(&lib_sysinfo);
>>         if (ret != 0)
>> diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
>> index 2e25253..d6ba246 100644
>> --- a/arch/x86/cpu/cpu.c
>> +++ b/arch/x86/cpu/cpu.c
>> @@ -130,7 +130,6 @@ int x86_cpu_init_f(void)
>>
>>         return 0;
>>  }
>> -int cpu_init_f(void) __attribute__((weak, alias("x86_cpu_init_f")));
>>
>>  int x86_cpu_init_r(void)
>>  {
>> diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h
>> index 89618c7..fdb8a6c 100644
>> --- a/arch/x86/include/asm/u-boot-x86.h
>> +++ b/arch/x86/include/asm/u-boot-x86.h
>> @@ -9,6 +9,7 @@
>>  #define _U_BOOT_I386_H_        1
>>
>>  /* cpu/.../cpu.c */
>> +int arch_cpu_init(void);
>>  int x86_cpu_init_r(void);
>>  int cpu_init_r(void);
>>  int x86_cpu_init_f(void);
>> diff --git a/common/board_f.c b/common/board_f.c
>> index df02ca5..f81f70d 100644
>> --- a/common/board_f.c
>> +++ b/common/board_f.c
>> @@ -819,7 +819,6 @@ static init_fnc_t init_sequence_f[] = {
>>  #endif
>>         arch_cpu_init,          /* basic arch cpu dependent setup */
>>  #ifdef CONFIG_X86
>> -       cpu_init_f,             /* TODO(sjg@chromium.org): remove */
>>  # ifdef CONFIG_OF_CONTROL
>>         find_fdt,               /* TODO(sjg@chromium.org): remove */
>>  # endif
>> --
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Applied to u-boot-x86.
Simon Glass Nov. 10, 2014, 6:56 p.m. UTC | #3
Hi,

On 8 November 2014 12:40, Simon Glass <sjg@chromium.org> wrote:
> On 7 November 2014 02:49, Bin Meng <bmeng.cn@gmail.com> wrote:
>> On Fri, Nov 7, 2014 at 4:20 AM, Simon Glass <sjg@chromium.org> wrote:
>>> Instead of an x86-specific cpu_init_f() function, use the normal U-Boot one
>>> for this purpose. Also remove a useless/misleading comment.
>>>
>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>> ---
>>>
>>>  arch/x86/cpu/coreboot/coreboot.c  | 5 +----
>>>  arch/x86/cpu/cpu.c                | 1 -
>>>  arch/x86/include/asm/u-boot-x86.h | 1 +
>>>  common/board_f.c                  | 1 -
>>>  4 files changed, 2 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c
>>> index e24f13a..b640f35 100644
>>> --- a/arch/x86/cpu/coreboot/coreboot.c
>>> +++ b/arch/x86/cpu/coreboot/coreboot.c
>>> @@ -20,10 +20,7 @@
>>>
>>>  DECLARE_GLOBAL_DATA_PTR;
>>>
>>> -/*
>>> - * Miscellaneous platform dependent initializations
>>> - */
>>> -int cpu_init_f(void)
>>> +int arch_cpu_init(void)
>>>  {
>>>         int ret = get_coreboot_info(&lib_sysinfo);
>>>         if (ret != 0)
>>> diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
>>> index 2e25253..d6ba246 100644
>>> --- a/arch/x86/cpu/cpu.c
>>> +++ b/arch/x86/cpu/cpu.c
>>> @@ -130,7 +130,6 @@ int x86_cpu_init_f(void)
>>>
>>>         return 0;
>>>  }
>>> -int cpu_init_f(void) __attribute__((weak, alias("x86_cpu_init_f")));
>>>
>>>  int x86_cpu_init_r(void)
>>>  {
>>> diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h
>>> index 89618c7..fdb8a6c 100644
>>> --- a/arch/x86/include/asm/u-boot-x86.h
>>> +++ b/arch/x86/include/asm/u-boot-x86.h
>>> @@ -9,6 +9,7 @@
>>>  #define _U_BOOT_I386_H_        1
>>>
>>>  /* cpu/.../cpu.c */
>>> +int arch_cpu_init(void);
>>>  int x86_cpu_init_r(void);
>>>  int cpu_init_r(void);
>>>  int x86_cpu_init_f(void);
>>> diff --git a/common/board_f.c b/common/board_f.c
>>> index df02ca5..f81f70d 100644
>>> --- a/common/board_f.c
>>> +++ b/common/board_f.c
>>> @@ -819,7 +819,6 @@ static init_fnc_t init_sequence_f[] = {
>>>  #endif
>>>         arch_cpu_init,          /* basic arch cpu dependent setup */
>>>  #ifdef CONFIG_X86
>>> -       cpu_init_f,             /* TODO(sjg@chromium.org): remove */
>>>  # ifdef CONFIG_OF_CONTROL
>>>         find_fdt,               /* TODO(sjg@chromium.org): remove */
>>>  # endif
>>> --
>>
>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>
> Applied to u-boot-x86.

Unfortunately this conflicts with your patch Bin, in that cpu_init_f()
is actually still needed. I tweaked this to call cpu_init_f() from
arch_cpu_init() and that seems to work. We'll have to deal with any
problems with an additional patch.

Regards,
Simon
diff mbox

Patch

diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c
index e24f13a..b640f35 100644
--- a/arch/x86/cpu/coreboot/coreboot.c
+++ b/arch/x86/cpu/coreboot/coreboot.c
@@ -20,10 +20,7 @@ 
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/*
- * Miscellaneous platform dependent initializations
- */
-int cpu_init_f(void)
+int arch_cpu_init(void)
 {
 	int ret = get_coreboot_info(&lib_sysinfo);
 	if (ret != 0)
diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index 2e25253..d6ba246 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -130,7 +130,6 @@  int x86_cpu_init_f(void)
 
 	return 0;
 }
-int cpu_init_f(void) __attribute__((weak, alias("x86_cpu_init_f")));
 
 int x86_cpu_init_r(void)
 {
diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h
index 89618c7..fdb8a6c 100644
--- a/arch/x86/include/asm/u-boot-x86.h
+++ b/arch/x86/include/asm/u-boot-x86.h
@@ -9,6 +9,7 @@ 
 #define _U_BOOT_I386_H_	1
 
 /* cpu/.../cpu.c */
+int arch_cpu_init(void);
 int x86_cpu_init_r(void);
 int cpu_init_r(void);
 int x86_cpu_init_f(void);
diff --git a/common/board_f.c b/common/board_f.c
index df02ca5..f81f70d 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -819,7 +819,6 @@  static init_fnc_t init_sequence_f[] = {
 #endif
 	arch_cpu_init,		/* basic arch cpu dependent setup */
 #ifdef CONFIG_X86
-	cpu_init_f,		/* TODO(sjg@chromium.org): remove */
 # ifdef CONFIG_OF_CONTROL
 	find_fdt,		/* TODO(sjg@chromium.org): remove */
 # endif