From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BD5EC433EF for ; Thu, 7 Oct 2021 12:51:38 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 86F05610A2 for ; Thu, 7 Oct 2021 12:51:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 86F05610A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 545B1834C6; Thu, 7 Oct 2021 14:51:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="RKWbMgHr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3FB3D834FB; Thu, 7 Oct 2021 14:51:23 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 57E09834B5 for ; Thu, 7 Oct 2021 14:51:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 4D0736109F; Thu, 7 Oct 2021 12:51:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633611073; bh=cZrCxnuBVXw4t/+Ck9xIWZslc3Fr/XC8Qa1BpCUqwOo=; h=From:To:Cc:Subject:Date:From; b=RKWbMgHrP4o7dPA9p+Vfcp6BchYU0sfSaUJl+Shn7fFS2yu7+9n6Jw/CkP3b/Zih5 1PIodeHG6FG+5T0qj0tFQGj5iog4BPd1Qlsj3GcXkZsYMkv2IpSLSW6NCxrgQbc58z S9c5v/xAS69PeyPJ9QBwEJhfkQfeHlHPRRb00sw31F5zkJxSWkd6t3z4UoeF3x+RlR dR+Pbz/3akzQysmAVkP0hoEPhya/lGOlc81xcFFBQ+pVXZhAqzxP6SBXA67fTPzkCD 2IzUPlYycF9Qo1GSvtrDmG9ZGqRGAd6eBb4mXUJDndYvkAsl1AUU466toAMK6Iugb/ bBdYn/XoGK6Aw== Received: by pali.im (Postfix) id D5E6781A; Thu, 7 Oct 2021 14:51:10 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Simon Glass , Vladimir Oltean , Bin Meng , Stefan Roese Cc: u-boot@lists.denx.de Subject: [PATCH 1/5] pci: Skip configuring PCI Rom Address for unsupported header types Date: Thu, 7 Oct 2021 14:50:57 +0200 Message-Id: <20211007125101.21811-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.103.2 at phobos.denx.de X-Virus-Status: Clean PCI Rom Address is currently supported only for Normal (0x00) and Bridge (0x01) header types. Fix code accordingly. Signed-off-by: Pali Rohár --- drivers/pci/pci_auto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c index 08082460eb86..288f7996c7c0 100644 --- a/drivers/pci/pci_auto.c +++ b/drivers/pci/pci_auto.c @@ -131,7 +131,8 @@ static void dm_pciauto_setup_device(struct udevice *dev, int bars_num, /* Configure the expansion ROM address */ dm_pci_read_config8(dev, PCI_HEADER_TYPE, &header_type); header_type &= 0x7f; - if (header_type != PCI_HEADER_TYPE_CARDBUS) { + if (header_type == PCI_HEADER_TYPE_NORMAL || + header_type == PCI_HEADER_TYPE_BRIDGE) { rom_addr = (header_type == PCI_HEADER_TYPE_NORMAL) ? PCI_ROM_ADDRESS : PCI_ROM_ADDRESS1; dm_pci_write_config32(dev, rom_addr, 0xfffffffe); -- 2.20.1