All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Brugger <matthias.bgg@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] board_r: re-order the board_early_init_r()
Date: Thu, 1 Aug 2019 18:40:30 +0200	[thread overview]
Message-ID: <55ddc9bf-b531-5058-ffbd-d0c6e1e031cb@gmail.com> (raw)
In-Reply-To: <86a84127-7247-711e-5cc6-b716824d204c@rock-chips.com>



On 31/07/2019 10:58, Kever Yang wrote:
> 
> On 2019/7/31 下午3:23, Matthias Brugger wrote:
>>
>> On 24/07/2019 14:22, Kever Yang wrote:
>>> On 2019/7/24 下午6:22, Simon Goldschmidt wrote:
>>>> On Wed, Jul 24, 2019 at 12:01 PM Kever Yang <kever.yang@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?
>> I agree. Maybe we should rename it to board_post_init?
> Sorry , do you mean add/rename a board_post_init() for what's done by
> board_early_init_r() now and then add/move ad board api before board_init()?
> There is a board_late_init(), which is after env init, a new board_post_init()
> seems
> not a good idea.
> 

My idea was to rename board_early_init_r to board_post_init as it is done after
board_init but before board_late_init. It's not perfect but at least less
confusing then the naming right now.

Regards,
Matthias

> 
> Here is the Kconfig help for BOARD_EARLY_INIT_R, which also means we it should
> be called before board_init().
> 
> config BOARD_EARLY_INIT_R
>         bool "Call board-specific init after relocation"
> help
>           Some boards need to perform initialisation as directly after
>           relocation. With this option, U-Boot calls board_early_init_r()
>           in the post-relocation init sequence.
> 
> 
> Thanks,
> 
> - Kever
> 
>>
>> Regards,
>> Matthias
>>
> 
> 

  reply	other threads:[~2019-08-01 16:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24 10:01 [U-Boot] [PATCH] board_r: re-order the board_early_init_r() Kever Yang
2019-07-24 10:22 ` Simon Goldschmidt
2019-07-24 12:22   ` Kever Yang
2019-07-31  7:23     ` Matthias Brugger
2019-07-31  8:58       ` Kever Yang
2019-08-01 16:40         ` Matthias Brugger [this message]
2019-08-01 16:47           ` Simon Glass
2019-07-31 16:53 ` Simon Glass

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=55ddc9bf-b531-5058-ffbd-d0c6e1e031cb@gmail.com \
    --to=matthias.bgg@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.