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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D30ACC77B6E for ; Thu, 13 Apr 2023 20:44:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3A18285D9D; Thu, 13 Apr 2023 22:44:23 +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="LFzCWsvs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A176985D13; Thu, 13 Apr 2023 22:44:14 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (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 8166D85D63 for ; Thu, 13 Apr 2023 22:44:08 +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: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4C8726418B; Thu, 13 Apr 2023 20:44:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C4DAC433A0; Thu, 13 Apr 2023 20:44:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681418646; bh=pdLP4ptIO/3lUnJ323bG6N70b3WP9uHD1XW6tdfxXTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LFzCWsvse2cQfMNnlzzbQL4gsgQWbFnb/Qd2mrJDnZnrJWnC31RET96AKMUwVaoTG y/5ynwNpZtn/nEpacx99kr3EGTAGKczM120XIKR2HKHVfxg3M6JbpIQuh8Q01x4xYB 99O0L/NVbrVvI/F0/BN44qK4vOwwlzYbwU3zLQ21XyNl8PJPLTypAQfl3q6/kBy52e OcWt34Jp0wWahS8rRndZO+SSw6rRiethKLq92LNrauIbezHlaIutWf5rjtsNQkr1Vy /yvvSR3Zw3kFhPwKE+eMmBigIi4QRwUt4si8G9iBjUvcHm2FORzfU4fnBqW3ofq1kI +gfkomAdfh6TQ== Received: by pali.im (Postfix) id AC141EB1; Thu, 13 Apr 2023 22:44:03 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Heiko Schocher Cc: u-boot@lists.denx.de Subject: [PATCH u-boot 3/3] pci: mpc85xx: Do not try to access extended PCIe registers Date: Thu, 13 Apr 2023 22:41:46 +0200 Message-Id: <20230413204146.9318-4-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230413204146.9318-1-pali@kernel.org> References: <20230413204146.9318-1-pali@kernel.org> 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.39 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.8 at phobos.denx.de X-Virus-Status: Clean Driver pci_mpc85xx.c is PCI controller driver for old PCI Local Bus, which does not support access to extended PCIe registers (above 0xff), as opposite of the PCIe driver pcie_fsl.c for the same platform. So do not try to access extended PCIe registers as it cannot work. Signed-off-by: Pali Rohár --- drivers/pci/pci_mpc85xx.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pci_mpc85xx.c b/drivers/pci/pci_mpc85xx.c index d144f2b791b8..833de816c459 100644 --- a/drivers/pci/pci_mpc85xx.c +++ b/drivers/pci/pci_mpc85xx.c @@ -22,7 +22,12 @@ static int mpc85xx_pci_dm_read_config(const struct udevice *dev, pci_dev_t bdf, struct mpc85xx_pci_priv *priv = dev_get_priv(dev); u32 addr; - addr = PCI_CONF1_EXT_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), offset); + if (offset > 0xff) { + *value = pci_get_ff(size); + return 0; + } + + addr = PCI_CONF1_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), offset); out_be32(priv->cfg_addr, addr); sync(); @@ -48,7 +53,10 @@ static int mpc85xx_pci_dm_write_config(struct udevice *dev, pci_dev_t bdf, struct mpc85xx_pci_priv *priv = dev_get_priv(dev); u32 addr; - addr = PCI_CONF1_EXT_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), offset); + if (offset > 0xff) + return 0; + + addr = PCI_CONF1_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), offset); out_be32(priv->cfg_addr, addr); sync(); -- 2.20.1