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 D6D1FC433F5 for ; Wed, 20 Oct 2021 09:50:50 +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 00F8B6136A for ; Wed, 20 Oct 2021 09:50:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 00F8B6136A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de 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 DDEC78326F; Wed, 20 Oct 2021 11:50:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1634723448; bh=bfQ4kkywPAvyq+niJj6aO0voB6/QKTq5tFVSG+WggNI=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=UrwlygHgUYN9wyuY2KdejkRXxO1tLHkcDM/otOfD6duIlp9EjDdR6a4Em11zJmtwp zPGaGkFbfzZfJhZK+lVrJoaWkpmDdE8KWQ2ip2Aysc9pIPE/opIp4ekfHY1BR2j+BS KnZFXqPV+fxzwgK87I1JixWb14rbrLWnlBBxqLVZ4ei4icZptY+v/U5MPyJcEfYm9u Gt57lDxUeyREHT3T5KRzZ28nAV/GmWLRuWhfDu2iB3GJVs4I7x4w8y9iA10o9dPn3v Cwb/NwzWd5VMASh/kMPWQg2x4a2cHFKrB8uRj8/4X4w2+Qk3BlDiYSKwIvM+NgDbe3 zwW6w4Iuktgow== Received: by phobos.denx.de (Postfix, from userid 109) id B6D0883276; Wed, 20 Oct 2021 11:50:45 +0200 (CEST) Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [91.198.250.252]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9C11F83195 for ; Wed, 20 Oct 2021 11:50:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:105:465:1:4:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4HZ5TG1vzhzQk99; Wed, 20 Oct 2021 11:50:42 +0200 (CEST) Subject: Re: [PATCH] arm: a37xx: pci: Do not allow setting bars on PCI Bridge To: =?UTF-8?Q?Pali_Roh=c3=a1r?= Cc: u-boot@lists.denx.de References: <20211012111919.10918-1-pali@kernel.org> From: Stefan Roese Message-ID: Date: Wed, 20 Oct 2021 11:50:38 +0200 MIME-Version: 1.0 In-Reply-To: <20211012111919.10918-1-pali@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C059130A 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 On 12.10.21 13:19, Pali Rohár wrote: > PCI Bridge which represents Aardvark PCIe Root Port does not have > configurable bars. > > So ensure that write operation to bars registers on PCI Bridge is noop and > bars registers always contain zero address which indicates that bars are > unsupported. > > After this change U-Boot 'pci bar 0.0.0' command does not show any > allocated bars for PCI Bridge device. > > Signed-off-by: Pali Rohár > Fixes: cb056005dc67 ("arm: a37xx: pci: Add support for accessing PCI Bridge on root bus") Reviewed-by: Stefan Roese Thanks, Stefan > --- > drivers/pci/pci-aardvark.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c > index 38eff495ab1c..ade5ab056f84 100644 > --- a/drivers/pci/pci-aardvark.c > +++ b/drivers/pci/pci-aardvark.c > @@ -581,6 +581,10 @@ static int pcie_advk_write_config(struct udevice *bus, pci_dev_t bdf, > if (offset >= 0x10 && offset < 0x34) { > data = pcie->cfgcache[(offset - 0x10) / 4]; > data = pci_conv_size_to_32(data, value, offset, size); > + /* This PCI bridge does not have configurable bars */ > + if ((offset & ~3) == PCI_BASE_ADDRESS_0 || > + (offset & ~3) == PCI_BASE_ADDRESS_1) > + data = 0x0; > pcie->cfgcache[(offset - 0x10) / 4] = data; > } else if ((offset & ~3) == PCI_ROM_ADDRESS1) { > data = advk_readl(pcie, PCIE_CORE_EXP_ROM_BAR_REG); > Viele Grüße, Stefan -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de