Message ID | 1453072320-24298-26-git-send-email-sjg@chromium.org |
---|---|
State | Accepted |
Commit | ac643e0363b4fe32e2742ede8084fc9999bd0bfb |
Delegated to: | Bin Meng |
Headers | show |
On Mon, Jan 18, 2016 at 7:11 AM, Simon Glass <sjg@chromium.org> wrote: > These devices currently need to be inited early in boot. Once we have the > init in the right places (with each device doing its own init and no > problems with ordering) we should be able to remove this. For now it is > needed to keep things working. > > Signed-off-by: Simon Glass <sjg@chromium.org> > --- > > Changes in v2: > - Add a comment as to why we are initing the devices again > > arch/x86/cpu/cpu.c | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
On Thu, Jan 21, 2016 at 2:48 PM, Bin Meng <bmeng.cn@gmail.com> wrote: > On Mon, Jan 18, 2016 at 7:11 AM, Simon Glass <sjg@chromium.org> wrote: >> These devices currently need to be inited early in boot. Once we have the >> init in the right places (with each device doing its own init and no >> problems with ordering) we should be able to remove this. For now it is >> needed to keep things working. >> >> Signed-off-by: Simon Glass <sjg@chromium.org> >> --- >> >> Changes in v2: >> - Add a comment as to why we are initing the devices again >> >> arch/x86/cpu/cpu.c | 20 ++++++++++++++++++-- >> 1 file changed, 18 insertions(+), 2 deletions(-) >> > > Reviewed-by: Bin Meng <bmeng.cn@gmail.com> applied to u-boot-x86/master, thanks!
diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index 3c812e9..6c3a748 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -709,8 +709,24 @@ static int x86_init_cpus(void) int cpu_init_r(void) { - if (ll_boot_init()) - return x86_init_cpus(); + struct udevice *dev; + int ret; + + if (!ll_boot_init()) + return 0; + + ret = x86_init_cpus(); + if (ret) + return ret; + + /* + * Set up the northbridge, PCH and LPC if available. Note that these + * may have had some limited pre-relocation init if they were probed + * before relocation, but this is post relocation. + */ + uclass_first_device(UCLASS_NORTHBRIDGE, &dev); + uclass_first_device(UCLASS_PCH, &dev); + uclass_first_device(UCLASS_LPC, &dev); return 0; }
These devices currently need to be inited early in boot. Once we have the init in the right places (with each device doing its own init and no problems with ordering) we should be able to remove this. For now it is needed to keep things working. Signed-off-by: Simon Glass <sjg@chromium.org> --- Changes in v2: - Add a comment as to why we are initing the devices again arch/x86/cpu/cpu.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)