u-boot-brain/drivers/pci
Stephen Warren e578b92cdb Implement "pci enum" command for CONFIG_DM_PCI
With CONFIG_DM_PCI enabled, PCI buses are not enumerated at boot, as they
are without that config option enabled. No command exists to enumerate the
PCI buses. Hence, unless some board-specific code causes PCI enumeration,
PCI-based Ethernet devices are not detected, and network access is not
available.

This patch implements "pci enum" in the CONFIG_DM_PCI case, thus giving a
mechanism whereby PCI can be enumerated.

do_pci()'s handling of case 'e' is moved into a single location before the
dev variable is assigned, in order to skip calculation of dev. The enum
sub-command doesn't need the dev value, and skipping its calculation
avoids an irrelevant error being printed.

Using a command to initialize PCI like this has a disadvantage relative to
enumerating PCI at boot. In particular, Ethernet devices are not probed
during PCI enumeration, but only when used. This defers setting variables
such as ethact, ethaddr, etc. until the first network-related command is
executed. Hopefully this will not cause further issues. Perhaps in the
long term, we need a "net start/enum" command too?

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2016-01-28 21:01:23 -07:00
..
fsl_pci_init.c fsl/pci: Set CFG_READY for PCIe v3.0 and later 2015-05-04 09:24:23 -07:00
Kconfig dm: pci: Disable PCI compatibility functions by default 2015-12-01 06:26:38 -07:00
Makefile dm: pci: video: Convert video and pci_rom to use DM PCI API 2016-01-12 10:19:09 -07:00
pci_auto_common.c dm: pci: Move common auto-config functions to a common file 2015-12-01 06:26:37 -07:00
pci_auto_old.c drivers/pci: Fix for debug builds without CONFIG_PCI_ENUM_ONLY 2016-01-14 14:08:59 +01:00
pci_auto.c dm: pci: Avoid using pci_bus_to_hose() in the uclass 2016-01-24 12:07:17 +08:00
pci_common.c dm: pci: Switch to DM API for PCI address mapping 2016-01-12 10:19:09 -07:00
pci_compat.c dm: pci: Move pci_bus_to_hose() to compatibility 2016-01-24 12:07:17 +08:00
pci_ftpci100.c Merge branch 'master' of git://git.denx.de/u-boot-nds32 2013-07-25 08:51:51 -04:00
pci_gt64120.c qemu-malta: Update for SPDX license identifiers 2013-07-25 08:51:48 -04:00
pci_indirect.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
pci_internal.h dm: pci: Move pci_bus_to_hose() to compatibility 2016-01-24 12:07:17 +08:00
pci_msc01.c malta: support for coreFPGA6 boards 2013-11-09 17:21:01 +01:00
pci_mvebu.c drivers/pci/pci_mvebu: Fix for boards with X4 lanes 2016-01-14 14:08:59 +01:00
pci_rom.c dm: pci: Convert bios_emu to use the driver model PCI API 2016-01-24 12:07:19 +08:00
pci_sandbox.c dm: sandbox: Add a simple PCI driver 2015-04-16 19:27:43 -06:00
pci_sh4.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
pci_sh7751.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
pci_sh7780.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
pci_tegra.c dm: tegra: pci: Convert tegra boards to driver model for PCI 2015-12-01 06:26:36 -07:00
pci_x86.c x86: pci: Tidy up the generic x86 PCI driver 2015-07-14 18:03:19 -06:00
pci-emul-uclass.c dm: sandbox: pci: Add a PCI emulation uclass 2015-04-16 19:27:43 -06:00
pci-uclass.c Implement "pci enum" command for CONFIG_DM_PCI 2016-01-28 21:01:23 -07:00
pci.c dm: pci: Mark legacy files as such 2016-01-12 10:19:09 -07:00
pcie_imx.c pci: imx: Adjust the return value when imx_pcie_addr_valid() fails 2016-01-08 10:15:49 -05:00
pcie_layerscape.c pci: layerscape: Adjust the return value when ls_pcie_addr_valid() fails 2016-01-08 10:15:49 -05:00
tsi108_pci.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
w83c553f.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00