Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp660943pxv; Thu, 15 Jul 2021 12:47:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWJV9OkSJaeViTlhfGL5nApFe0HqeOkW+5WOhB+RA1+mcfH9W1dNuuqvXuG10FJzExN7zv X-Received: by 2002:a17:906:2dc9:: with SMTP id h9mr7370412eji.345.1626378422714; Thu, 15 Jul 2021 12:47:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626378422; cv=none; d=google.com; s=arc-20160816; b=daA7GvU+bN+qPVBemwiE/b/qyVeeKBjFhWuobKuhwLCHfy5jdZ1HtUW61JhxOsIyX5 BIXl1wq3qw0MNbE+SRduNLMbhUFV4Ad5PNetQemSqxIFSYpKyytZ+aZIzFhWGMn13zIV 0slF/tXHIPbJgX9NFXdIRh2qe+dFxd3s2CJ71LsnKRfN1LejVuHB8Gql3balEemOeltZ 5gwj2rIGvEpeGkfK3Wy0yyvvCktjj8oETagzTN3u2KFM0Fj2fqZ6Z0lacBuPeLCOGd9m oh4aXH/KYBQ+x8Cd6ADrTGJ3lx636asvvcjdJl4zu/d1wZ3jy726lf1AAscfB4eZKn5A +9uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LqtjcnLYE6zk7kBGgoMEnF0uxfiRktjKrSjIm5K5Ixc=; b=F0kh3hzjcEF9JoM80EKE3K6Kw0/tTL9QjeRZg0e7l3gZVwXBXLz0O85EJtBUZq2zlq /7zAnIBpA1wEAg8kBeLLdsOfS81W9TtIU2O9IHhipYkhAlVlZYBTwFTyYMulNnixm0U7 Y/sCUZab97kQZJ6zjaeVh/LgUYRe2R5bWoZz2ylrvKrINJq2a8QR8H63BTIWaTKN+GOk e3ZDEV3CuBECAjLneAU7w0Fal+WBOO4qV3YPQgr4ulK6yRzAozXmkYzOKSHnbG662A8m XUEuquYUdHJ0fD79xYg7Y5Taqrb9E2uioTkqWK9S3lz3ys9U6LM2CbwzgRrKW0nIBzYE Qizg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WCLQnFeZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y18si7157291edw.21.2021.07.15.12.46.40; Thu, 15 Jul 2021 12:47:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WCLQnFeZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344307AbhGOTsd (ORCPT + 99 others); Thu, 15 Jul 2021 15:48:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:58676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239983AbhGOTRw (ORCPT ); Thu, 15 Jul 2021 15:17:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5D0B461418; Thu, 15 Jul 2021 19:12:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376376; bh=rP4R48VjSEyDltaKD47DQRi54ShTMbn9bhVJtIVTmBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WCLQnFeZu9/Wz56+V1qz/ftPywCO4URPrNHolwms2WMPqkKGb3SGQ3P54gbJikSRJ CGGBEsVZNdJCT6yyL7xBo37wLudLkv27T1J6VjOiqFTPZMW8TyriRsufkGgMZa0GCu azZAehtrpWswLdLrgojor6TBgrnRSQK5Kc8ykFOM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= , Lorenzo Pieralisi , =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH 5.13 244/266] PCI: aardvark: Implement workaround for the readback value of VEND_ID Date: Thu, 15 Jul 2021 20:39:59 +0200 Message-Id: <20210715182651.443156777@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pali Rohár commit 7f71a409fe3d9358da07c77f15bb5b7960f12253 upstream. Marvell Armada 3700 Functional Errata, Guidelines, and Restrictions document describes in erratum 4.1 PCIe value of vendor ID (Ref #: 243): The readback value of VEND_ID (RD0070000h [15:0]) is 1B4Bh, while it should read 11ABh. The firmware can write the correct value, 11ABh, through VEND_ID (RD0076044h [15:0]). Implement this workaround in aardvark driver for both PCI vendor id and PCI subsystem vendor id. This change affects and fixes PCI vendor id of emulated PCIe root bridge. After this change emulated PCIe root bridge has correct vendor id. Link: https://lore.kernel.org/r/20210624222621.4776-5-pali@kernel.org Fixes: 8a3ebd8de328 ("PCI: aardvark: Implement emulated root PCI bridge config space") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Reviewed-by: Marek Behún Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/pci/controller/pci-aardvark.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c @@ -125,6 +125,7 @@ #define LTSSM_MASK 0x3f #define LTSSM_L0 0x10 #define RC_BAR_CONFIG 0x300 +#define VENDOR_ID_REG (LMI_BASE_ADDR + 0x44) /* PCIe core controller registers */ #define CTRL_CORE_BASE_ADDR 0x18000 @@ -385,6 +386,16 @@ static void advk_pcie_setup_hw(struct ad reg |= (IS_RC_MSK << IS_RC_SHIFT); advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG); + /* + * Replace incorrect PCI vendor id value 0x1b4b by correct value 0x11ab. + * VENDOR_ID_REG contains vendor id in low 16 bits and subsystem vendor + * id in high 16 bits. Updating this register changes readback value of + * read-only vendor id bits in PCIE_CORE_DEV_ID_REG register. Workaround + * for erratum 4.1: "The value of device and vendor ID is incorrect". + */ + reg = (PCI_VENDOR_ID_MARVELL << 16) | PCI_VENDOR_ID_MARVELL; + advk_writel(pcie, reg, VENDOR_ID_REG); + /* Set Advanced Error Capabilities and Control PF0 register */ reg = PCIE_CORE_ERR_CAPCTL_ECRC_CHK_TX | PCIE_CORE_ERR_CAPCTL_ECRC_CHK_TX_EN |