From patchwork Mon Jul 11 22:18:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 12914312 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EAB13C43334 for ; Mon, 11 Jul 2022 22:19:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=3p3ILf4kiCTz4OGt/irmSbyt7uDi4XJfaLrmpELKCX8=; b=hAK3oj4QqZkU4U iohTCiEXLWucPRPr9mdJtT4TZAmZEIIHVcoUCu6xxhXnqzDrj5/236PESk5WpWAlU83G4cGi2LkzD 91YQ9uhqpM4tFipnFAZUpNrUQIWaSWQg/RCU0rsJ40TVIlMdHJs9HhmNdUAlDcIfS3g5QvzjA+B1P /19iVG0T9YkLcw61jJY4luBdcEIgp1vCk+85MxsVSmVQJeePStGBYQhRzj9HuNrxXEV4vT+ozGO0C UE7cpB1uZd62kB5U5EDxuN/9Isp9Ja/7+2ydl9yYMS7OBKsKDpbONYXkta40DfX5Slqim48N+TQxu Z+Zuy2d853dSiIfiNPGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oB1k2-005DPc-AP; Mon, 11 Jul 2022 22:18:58 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oB1jz-005DMz-AB for linux-arm-kernel@lists.infradead.org; Mon, 11 Jul 2022 22:18:56 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id CE3A3B815F6; Mon, 11 Jul 2022 22:18:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BA0FC341C8; Mon, 11 Jul 2022 22:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657577929; bh=ETkCB/aehhBtnEDCWccc3Oh1+EJJkiDRqq1zwo6PZ+A=; h=From:To:Cc:Subject:Date:From; b=COl00AOaSWTtYDKodDOFVEME+H+7AMvnwzMHIYm2LHsKSl8bRSEQccSyXFnPUZB5D iyL1y64f2dLz1VcQdTWIcau1DL5DouBqLx4cHGjjgwXUK852SnT81feaJetIdntR1b Yv9DW73xNZeEwryJi6Pizbr94rh+j8YYfHGORR/SH8Z+WFJdvs2+QnCSa/lX9slwGf SSB07O4OjBBkK0RXj1ElS5H3ulIuIy2IJPa1Klbbsl12m19ILVZzBlX0UGgfqPyHnW jaip4TRVuCMkDsbLf/CdkF6uTIZeohfVp2MlfIiV7uNMj1MFgnvYeDUtgRX6TKWf6h 5eD4w+yP0MnAg== Received: by pali.im (Postfix) id 0E9CE9D7; Tue, 12 Jul 2022 00:18:46 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Thomas Petazzoni , Lorenzo Pieralisi , Rob Herring , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] PCI: aardvark: Add support for PCI Bridge Subsystem Vendor ID on emulated bridge Date: Tue, 12 Jul 2022 00:18:23 +0200 Message-Id: <20220711221823.12154-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220711_151855_528623_CCCFF044 X-CRM114-Status: GOOD ( 12.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Register with Subsystem Device/Vendor ID is at offset 0x2c. Export is via emulated bridge. After this change Subsystem ID is visible in lspci output at line: Capabilities: [40] Subsystem Signed-off-by: Pali Rohár --- drivers/pci/controller/pci-aardvark.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c index 74511f015168..924c9397a9a4 100644 --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c @@ -32,6 +32,8 @@ #define PCIE_CORE_DEV_ID_REG 0x0 #define PCIE_CORE_CMD_STATUS_REG 0x4 #define PCIE_CORE_DEV_REV_REG 0x8 +#define PCIE_CORE_SSDEV_ID_REG 0x2c +#define PCIE_CORE_EXP_ROM_BAR_REG 0x30 #define PCIE_CORE_PCIEXP_CAP 0xc0 #define PCIE_CORE_ERR_CAPCTL_REG 0x118 #define PCIE_CORE_ERR_CAPCTL_ECRC_CHK_TX BIT(5) @@ -982,6 +984,8 @@ static int advk_sw_pci_bridge_init(struct advk_pcie *pcie) /* Indicates supports for Completion Retry Status */ bridge->pcie_conf.rootcap = cpu_to_le16(PCI_EXP_RTCAP_CRSVIS); + bridge->subsystem_vendor_id = advk_readl(pcie, PCIE_CORE_SSDEV_ID_REG) & 0xffff; + bridge->subsystem_id = advk_readl(pcie, PCIE_CORE_SSDEV_ID_REG) >> 16; bridge->has_pcie = true; bridge->data = pcie; bridge->ops = &advk_pci_bridge_emul_ops;