u-boot-brain/cmd
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
..
aes.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
ambapp.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
armflash.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
bdinfo.c microblaze: Do not print eth device when DM_ETH is enabled 2016-01-27 15:55:49 +01:00
bedbug.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
blob.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
bmp.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
boot.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
bootldr.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
bootm.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
bootmenu.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
bootstage.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
cache.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
cbfs.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
clk.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
console.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
cplbinfo.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
cpu.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
cramfs.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
dataflash_mmc_mux.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
date.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
dcr.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
demo.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
dfu.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
diag.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
disk.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
display.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
dtt.c bug.h: move BUILD_BUG_* defines to include/linux/bug.h 2016-01-25 10:39:59 -05:00
echo.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
eeprom.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
efi.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
elf.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
ethsw.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
exit.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
ext2.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
ext4.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
fastboot.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
fat.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
fdc.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
fdt.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
fitupd.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
flash.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
fpga.c fpga: Fix compilation warnings 2016-01-27 15:55:54 +01:00
fpgad.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
fs_uuid.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
fs.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
fuse.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
gettime.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
gpio.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
gpt.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
hash.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
help.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
host.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
i2c.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
ide.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
immap.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
ini.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
io.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
iotrace.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
irq.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
itest.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
jffs2.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
Kconfig Move all command code into its own directory 2016-01-25 10:39:43 -05:00
ldrinfo.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
led.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
license.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
load.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
log.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
lzmadec.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
mac.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
Makefile Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
md5sum.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
mdio.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
mem.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
mfsl.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
mii.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
misc.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
mmc_spi.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
mmc.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
mp.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
mtdparts.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
nand.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
net.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
nvedit.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
onenand.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
otp.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
part.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
pci.c Implement "pci enum" command for CONFIG_DM_PCI 2016-01-28 21:01:23 -07:00
pcmcia.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
pmic.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
portio.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
pxe.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
read.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
reginfo.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
regulator.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
reiser.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
remoteproc.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
sata.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
scsi.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
setexpr.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
sf.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
sha1sum.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
softswitch.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
sound.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
source.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
spi.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
spibootldr.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
spl.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
strings.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
terminal.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
test.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
thordown.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
time.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
tpm_test.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
tpm.c tpm: Fix fault in case CONFIG_DM_TPM is set without any TPM 2016-01-28 21:01:22 -07:00
trace.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
tsi148.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
ubi.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
ubifs.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
universe.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
unzip.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
usb_mass_storage.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
usb.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
version.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
ximg.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
yaffs2.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
zfs.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00
zip.c Remove the cmd_ prefix from command files 2016-01-25 10:39:43 -05:00