[U-Boot] [PATCH] board_r: re-order the board_early_init_r()

Kever Yang kever.yang at rock-chips.com
Wed Jul 24 12:22:03 UTC 2019


On 2019/7/24 下午6:22, Simon Goldschmidt wrote:
> On Wed, Jul 24, 2019 at 12:01 PM Kever Yang <kever.yang at rock-chips.com> wrote:
>> The board_early_init_r() suppose to be called before board_init(),
>> then the board callback functions in board_r will be:
>> - board_early_init_r()
>> - board_init()
>> - board_late_init()
> Searching through the code, elixir.bootlin.com gives me 52 definitions
> of board_early_init_r(). Does this patch break any of those boards
> when it changes the order of those calls?

I do have check some of the implement and most of them should be OK, but 
to be honest,

I'm don't have any of those boards, and not sure if this break any of 
them, and I'm not sure

if people using this interface have notice it's after the board_init().

When I try to use this board_early_init_r(), I thought this is before 
board_init(), but it actually

after the board_init(), that make people confusing.

I think the _early_ one should be at the first, isn't it?

Thanks,
- Kever
>
> Regards,
> Simon
>
>> Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
>> ---
>>
>>   common/board_r.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/common/board_r.c b/common/board_r.c
>> index abc31b17b8..c5e33c4654 100644
>> --- a/common/board_r.c
>> +++ b/common/board_r.c
>> @@ -681,6 +681,9 @@ static init_fnc_t init_sequence_r[] = {
>>   #ifdef CONFIG_DM
>>          initr_dm,
>>   #endif
>> +#if defined(CONFIG_BOARD_EARLY_INIT_R)
>> +       board_early_init_r,
>> +#endif
>>   #if defined(CONFIG_ARM) || defined(CONFIG_NDS32) || defined(CONFIG_RISCV) || \
>>          defined(CONFIG_SANDBOX)
>>          board_init,     /* Setup chipselects */
>> @@ -712,9 +715,6 @@ static init_fnc_t init_sequence_r[] = {
>>   #endif
>>   #ifdef CONFIG_ADDR_MAP
>>          initr_addr_map,
>> -#endif
>> -#if defined(CONFIG_BOARD_EARLY_INIT_R)
>> -       board_early_init_r,
>>   #endif
>>          INIT_FUNC_WATCHDOG_RESET
>>   #ifdef CONFIG_POST
>> --
>> 2.17.1
>>




More information about the U-Boot mailing list