From patchwork Wed Apr 8 18:57:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1268245 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=K/yDrJ/E; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48yD884GB0z9sSM for ; Thu, 9 Apr 2020 04:58:48 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7D78C8160C; Wed, 8 Apr 2020 20:58:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="K/yDrJ/E"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0E8C3812F0; Wed, 8 Apr 2020 20:58:16 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F11CC812F0 for ; Wed, 8 Apr 2020 20:58:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd43.google.com with SMTP id n20so1241007ioa.4 for ; Wed, 08 Apr 2020 11:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Tjl13dsPfS+uwJ8kr/40M15pdeLzWZkK4K9RvdC9h3Q=; b=K/yDrJ/EK750DK/dcX7Vnbv+XbTNcRZyXqfi4fhvztu/gAPSaxN/la4UoV5iKwXb9G 3yi4Qk8FR0lK+AcRbUJ7fBuwljJVpjlMsboTB21vWtny5D+1ireGWmqDMDix3dYyHzMX cgKjZwbRw/QuIOa5yr3jcSB0857VVv7aBd4Eo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Tjl13dsPfS+uwJ8kr/40M15pdeLzWZkK4K9RvdC9h3Q=; b=R9H2GEHxfpWalVjBrtB/yXhr7vdjbAHt9iesvictxxuJXq2c5/GGpkgkloM2jveCWh IakBw9HJwxQ0c7gCfIC62338UsNE+8PIgsJ16bFaivBFUwFB6Kj6IdcoNB8iN3O+Poti v/wCNlgqhtrX1/ZEMUnIvgGkWnryfLDnX3RlCJ8tk1D6gudRLlTrf19iWin0bErc7zQT AivFdTQNzApGZJRg1al6ocZDdNaAKg5F4J253U38D1+smfb4UYL8JEiS3A8YKnyiS4T7 zJygLedV/kNI6ZWE84NLOUVhUAzZ39ev4WKhHi3BI6LQR65LFvSasxJd09JigV8sYtdY zXdA== X-Gm-Message-State: AGi0PuaPdDXlwBlcT1MTc24aBekJorvDzdPf2tzYVt2Nmu97hIGTh+JH XCm7Sr8Y5/p8ReqUClIPeSUSrpLuYvEmeg== X-Google-Smtp-Source: APiQypIGpx8AS4ufe+o95obBBaz6QeXcYwu5llg523/dS7DWBFNnBRz+RVMKJxMscMDBaou1ATJSWg== X-Received: by 2002:a02:c913:: with SMTP id t19mr8401630jao.17.1586372288520; Wed, 08 Apr 2020 11:58:08 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id e11sm8384382ilr.30.2020.04.08.11.58.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2020 11:58:08 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Bin Meng , Simon Glass , Alex Marginean , =?utf-8?q?Marek_Beh=C3=BAn?= , Michael Walle , Thierry Reding Subject: [RESEND PATCH v3 4/7] pci: Avoid auto-config when chain loading Date: Wed, 8 Apr 2020 12:57:52 -0600 Message-Id: <20200408125746.RESEND.v3.4.Idfdc61ea876ea7aeafb2370394ac2c922344f9b4@changeid> X-Mailer: git-send-email 2.26.0.292.g33ef6b2f38-goog In-Reply-To: <20200408185755.116336-1-sjg@chromium.org> References: <20200408185755.116336-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean When U-Boot is not the first-stage bootloader we don't want to re-configure the PCI devices, since this has already been done. Add a check to avoid this. Signed-off-by: Simon Glass --- Changes in v3: None Changes in v2: - Drop patch 'dm: Avoid initing built-in devices when chain loading' drivers/pci/pci-uclass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index e2882e3b634..94733662b12 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -1007,7 +1007,7 @@ static int pci_uclass_post_probe(struct udevice *bus) if (ret) return ret; - if (CONFIG_IS_ENABLED(PCI_PNP) && + if (CONFIG_IS_ENABLED(PCI_PNP) && ll_boot_init() && (!hose->skip_auto_config_until_reloc || (gd->flags & GD_FLG_RELOC))) { ret = pci_auto_config_devices(bus); @@ -1029,7 +1029,7 @@ static int pci_uclass_post_probe(struct udevice *bus) * Note we only call this 1) after U-Boot is relocated, and 2) * root bus has finished probing. */ - if ((gd->flags & GD_FLG_RELOC) && (bus->seq == 0)) { + if ((gd->flags & GD_FLG_RELOC) && bus->seq == 0 && ll_boot_init()) { ret = fsp_init_phase_pci(); if (ret) return ret;