Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1783397pxy; Thu, 6 May 2021 16:10:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7TN/DS8ThLFzUbDmsmsIEKc76xTHs9ZUc7GSy30xFVUVcPOQDzO0Ic1kNW4YeVUtB/dkv X-Received: by 2002:a17:90a:7896:: with SMTP id x22mr7046761pjk.182.1620342634136; Thu, 06 May 2021 16:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620342634; cv=none; d=google.com; s=arc-20160816; b=JlmNJKjg6g8c9wul4mkwd/U7QQ6iUzroIGKRlXgw/0m3lfnFfeCTHtVSlW52JXuYJY rXGpbkvMHx2U6Q+yGXeuPsiv8Fdpwuebzp7RNYw8QpiH61iCv3MHllknX5MDjUFHOdgq LD3BC7RGpFzmEjlGgmMVcwFTbYlFptSmmoJX/llVInHRE6HCbFFQt0gCBwqSQuFZBdQN Y94Ji7x1V2g78Pd/wjvH/DmgbHlqa+wgPghj7QsoI9IpPIZP2TdhO5Pq5xLE2qT7yTWJ C+4OMntJsth3Y4Jag/rABdYsm3XbG3echw4ukCSLYQjeiWtDEFySRtgWDZYLvMlfaw5M Wnww== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1b7RVHlchIifWMChtCFsGxsytpVpDcGCaScJSjbXjI4=; b=LB5YMmU91vZlq9qc69NknhDKWF+3vYxbRHYfPxC+P6v9Slii3LsNdSQSV0rz+fXzYD E4RuBWw+GL0vlivvaJEYcRYSCnpw00MGhUfS30JofcBU69TUSWnm6D3lqNjDHzFvZOuy F9HL8TjeZgzv1qtZJp0G8aca1g+1wtIEmXEaOGaWCVazW5AlYgmn9wDRKSwvn1edUzep Am3vVQenWzKrOiM4IhWAlxNnWrhTb5gXPTJypEQvUEEa4EpF7pzz+qammwxgFyYScHDo De0Q4Kn0flpBS4sZcJAO130bpLr7x8l+IjD8b0OOT1n/61qqj3DR29Hoc8G1CWRRXNoT GMqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OMXkbHya; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a6si4795054pgm.17.2021.05.06.16.10.21; Thu, 06 May 2021 16:10:34 -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=@kernel.org header.s=k20201202 header.b=OMXkbHya; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236077AbhEFPhy (ORCPT + 99 others); Thu, 6 May 2021 11:37:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:45974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235702AbhEFPdy (ORCPT ); Thu, 6 May 2021 11:33:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 97FDC61625; Thu, 6 May 2021 15:32:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620315174; bh=0YkTEBWISevDvHgokN8XUsGMwtVKvfnG9KGkSIjT5Co=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OMXkbHyayU7EJ06iuIZVStBfcPs+TIdvxPzRYPg8sKF16YEUQphEicjVbabUnZ6we zAsro4QRH2vBWa45bDxXDGF8qn3RmOoKKofVmkL1CO1n1i9FIUeMaGEVca5rVP1V1V R124NrK+EXSGLJDgSlFbliWaAJzrvsyuKjgHA+F8yYMmOVtkeAn+DnKZy5NUnjyKJZ DT4AMkYg7Pun4Jz5Bln0vhpx1XjEOIhQqV75+fGsZUITSupwc8uY++tv8j1gJBlM5X 8RA2AW+hhHx8xJ+BtgdO18m9vakQXjItJtF6f2Rd9RI9Zpqpo2SB3w/26Bt7AH+cqe aRxXLoC6NVivw== Received: by pali.im (Postfix) id 535E389A; Thu, 6 May 2021 17:32:54 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Lorenzo Pieralisi , Thomas Petazzoni , Rob Herring , Bjorn Helgaas Cc: Russell King , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Remi Pommarel , Xogium , Tomasz Maciej Nowak , Marc Zyngier , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 34/42] PCI: aardvark: Add support for DEVCAP2, DEVCTL2, LNKCAP2 and LNKCTL2 registers on emulated bridge Date: Thu, 6 May 2021 17:31:45 +0200 Message-Id: <20210506153153.30454-35-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210506153153.30454-1-pali@kernel.org> References: <20210506153153.30454-1-pali@kernel.org> 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 PCI aardvark hardware supports access to DEVCAP2, DEVCTL2, LNKCAP2 and LNKCTL2 configuration registers of PCIe core via PCIE_CORE_PCIEXP_CAP. Export them via emulated software root bridge. Signed-off-by: Pali Rohár Reviewed-by: Marek Behún Fixes: 8a3ebd8de328 ("PCI: aardvark: Implement emulated root PCI bridge config space") --- drivers/pci/controller/pci-aardvark.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c index e724d05a61a8..13bbc0b5134d 100644 --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c @@ -610,8 +610,13 @@ advk_pci_bridge_emul_pcie_conf_read(struct pci_bridge_emul *bridge, case PCI_EXP_DEVCAP: case PCI_EXP_DEVCTL: case PCI_EXP_LNKCAP: + case PCI_EXP_DEVCAP2: + case PCI_EXP_DEVCTL2: + case PCI_EXP_LNKCAP2: + case PCI_EXP_LNKCTL2: *value = advk_readl(pcie, PCIE_CORE_PCIEXP_CAP + reg); return PCI_BRIDGE_EMUL_HANDLED; + default: return PCI_BRIDGE_EMUL_NOT_HANDLED; } @@ -631,16 +636,18 @@ advk_pci_bridge_emul_pcie_conf_write(struct pci_bridge_emul *bridge, */ switch (reg) { - case PCI_EXP_DEVCTL: - advk_writel(pcie, new, PCIE_CORE_PCIEXP_CAP + reg); - break; - case PCI_EXP_LNKCTL: advk_writel(pcie, new, PCIE_CORE_PCIEXP_CAP + reg); if (new & PCI_EXP_LNKCTL_RL) advk_pcie_wait_for_retrain(pcie); break; + case PCI_EXP_DEVCTL: + case PCI_EXP_DEVCTL2: + case PCI_EXP_LNKCTL2: + advk_writel(pcie, new, PCIE_CORE_PCIEXP_CAP + reg); + break; + default: break; } -- 2.20.1