From: Andrew Bradford Date: Thu, 4 Jun 2015 15:18:14 -0400 Subject: [U-Boot] [PATCH v2 3/3] x86: fsp: Move FspInitEntry call to board_init_f() In-Reply-To: References: <1433413739-20230-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <20150604191814.GD16990@rhino.kp.kodak.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 06/04 18:28, Bin Meng wrote: > The call to FspInitEntry is done in arch/x86/lib/fsp/fsp_car.S so far. > It worked pretty well but looks not that good. Apart from doing too > much work than just enabling CAR, it cannot read the configuration > data from device tree at that time. Now we want to move it a little > bit later as part of init_sequence_f[] being called by board_init_f(). > This way it looks and works better in the U-Boot initialization path. > > Due to FSP's design, after calling FspInitEntry it will not return to > its caller, instead it jumps to a continuation function which is given > by bootloader with a new stack in system memory. The original stack in > the CAR is gone, but its content is perserved by FSP and described by > a bootloader temporary memory HOB. Technically we can recover anything > we had before in the previous stack, but that is way too complicated. > To make life much easier, in the FSP continuation routine we just > simply call fsp_init_done() and jump back to car_init_ret() to redo > the whole board_init_f() initialization, but this time with a non-zero > HOB list pointer saved in U-Boot's global data so that we can bypass > the FspInitEntry for the second time. > > Signed-off-by: Bin Meng > Acked-by: Simon Glass > Tested-by: Andrew Bradford > > --- > > Changes in v2: None > > arch/x86/cpu/start.S | 6 +++++- > arch/x86/include/asm/u-boot-x86.h | 4 ++++ > arch/x86/lib/fsp/fsp_car.S | 26 +++++--------------------- > arch/x86/lib/fsp/fsp_common.c | 8 ++++++++ > common/board_f.c | 3 +++ > 5 files changed, 25 insertions(+), 22 deletions(-) Tested-by: Andrew Bradford