From patchwork Fri May 27 14:08:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 97685 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 86B00B6F90 for ; Sat, 28 May 2011 00:09:04 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E3C71280FD; Fri, 27 May 2011 16:08:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8Jr1WfyVapFY; Fri, 27 May 2011 16:08:54 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5AA96280D7; Fri, 27 May 2011 16:08:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 42512280C1 for ; Fri, 27 May 2011 16:08:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a1WrazU5-YcP for ; Fri, 27 May 2011 16:08:34 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by theia.denx.de (Postfix) with ESMTP id 0584B280A9 for ; Fri, 27 May 2011 16:08:32 +0200 (CEST) Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 978701C01393; Fri, 27 May 2011 16:08:32 +0200 (CEST) X-Auth-Info: e95oO66DCVVHAJQLRh/yzB+Xvd5IjdNqAWNBllfC2OA= Received: from localhost (p4FDE7632.dip.t-dialin.net [79.222.118.50]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA id 5FBC21C00078; Fri, 27 May 2011 16:08:32 +0200 (CEST) From: Anatolij Gustschin To: u-boot@lists.denx.de Date: Fri, 27 May 2011 16:08:21 +0200 Message-Id: <1306505304-9593-3-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1306505304-9593-1-git-send-email-agust@denx.de> References: <1306505304-9593-1-git-send-email-agust@denx.de> Subject: [U-Boot] [PATCH 2/5] pci: option for configurable delay between pci reset and pci bus scan X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de PCI cards might need some time after reset to respond. On some boards (mpc5200 or mpc8260 based) the PCI bus reset is deasserted at pci_board_init() time, so we can not use available "pcidelay" option for waiting before pci bus scan here. Add an option to delay bus scan by setting "pci_scan_delay" environment variable. Signed-off-by: Anatolij Gustschin --- drivers/pci/pci.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index cdfc4fb..2206c12 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -699,6 +699,20 @@ int pci_hose_scan_bus(struct pci_controller *hose, int bus) int pci_hose_scan(struct pci_controller *hose) { +#if defined(CONFIG_PCI_SCAN_DELAY) + const char *s; + int i; + + /* wait "pci_scan_delay" ms, limit to max. 1 s */ + s = getenv("pci_scan_delay"); + if (s) { + int val = simple_strtoul(s, NULL, 10); + if (val > 1000) + val = 1000; + for (i = 0; i < val; i++) + udelay(1000); + } +#endif /* Start scan at current_busno. * PCIe will start scan at first_busno+1. */