From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Tue, 26 Jan 2016 12:59:55 -0700 Subject: [U-Boot] [PATCH 1/4] Implement "pci enum" command for CONFIG_DM_PCI In-Reply-To: <1453831814-23973-1-git-send-email-swarren@wwwdotorg.org> References: <1453831814-23973-1-git-send-email-swarren@wwwdotorg.org> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 26 January 2016 at 11:10, Stephen Warren wrote: > From: Stephen Warren > > 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 > --- > This series naturally needs to be applied in order in a single branch. > This series depends on all previous applied test/py patches. > > common/cmd_pci.c | 18 +++++------------- > drivers/pci/pci-uclass.c | 15 +++++++++++++++ > 2 files changed, 20 insertions(+), 13 deletions(-) Reviewed-by: Simon Glass