diff options
author | Simon Glass <sjg@chromium.org> | 2019-05-02 10:52:26 -0600 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2019-05-08 13:02:18 +0800 |
commit | bfeeb8d863de070b1f9a2cf17f5e491557c5ecb5 (patch) | |
tree | e71570c56f64342fee4ce119c71b535220c17ded | |
parent | 31d5261d3599dd7e1868e93e95076ac5d7468b3c (diff) | |
download | u-boot-bfeeb8d863de070b1f9a2cf17f5e491557c5ecb5.tar.gz |
x86: broadwell: Update PCH to work in TPL
The early init should only happen once. Update the probe method to
deal with TPL, SPL and U-Boot proper.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
-rw-r--r-- | arch/x86/cpu/broadwell/pch.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86/cpu/broadwell/pch.c b/arch/x86/cpu/broadwell/pch.c index e61efa7b16..a48945adf1 100644 --- a/arch/x86/cpu/broadwell/pch.c +++ b/arch/x86/cpu/broadwell/pch.c @@ -599,10 +599,16 @@ static int broadwell_pch_init(struct udevice *dev) static int broadwell_pch_probe(struct udevice *dev) { - if (!(gd->flags & GD_FLG_RELOC)) - return broadwell_pch_early_init(dev); - else + if (CONFIG_IS_ENABLED(X86_32BIT_INIT)) { + if (!(gd->flags & GD_FLG_RELOC)) + return broadwell_pch_early_init(dev); + else + return broadwell_pch_init(dev); + } else if (IS_ENABLED(CONFIG_SPL) && !IS_ENABLED(CONFIG_SPL_BUILD)) { return broadwell_pch_init(dev); + } else { + return 0; + } } static int broadwell_pch_get_spi_base(struct udevice *dev, ulong *sbasep) |