x86: tpl: Add a fake PCI bus
authorSimon Glass <sjg@chromium.org>
Mon, 21 Oct 2019 03:37:50 +0000 (21:37 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Sat, 2 Nov 2019 23:20:28 +0000 (07:20 +0800)
commit0ced70a0bb7a114226c831bf2058681011c0fb4e
tree850143902fe64e70d9335b1fe9cfbe2df4ff15bc
parentc0e2c81d8e845cd700bb2311514f9d6877f784bb
x86: tpl: Add a fake PCI bus

In TPL we try to minimise code size so do not include the PCI subsystem.
We can use fixed BARs and drivers can directly program the devices that
they need.

However we do need to bind the devices on the PCI bus and without PCI this
does not ordinarily happen. As a work-around, define a fake PCI bus which
does this binding, but no other PCI operations. This is a convenient way
to ensure that we can use the same device tree for TPL, SPL and U-Boot
proper:

   TPL    - CONFIG_TPL_PCI is not set (no auto-config, fake PCI bus)
   SPL    - CONFIG_SPL_PCI is set (no auto-config but with real PCI bus)
   U-Boot - CONFIG_PCI is set (full auto-config after relocation)

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/lib/tpl.c