From patchwork Tue Feb 22 15:50:24 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: 12755563 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 1E9BDC433F5 for ; Tue, 22 Feb 2022 15:55:33 +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:References:In-Reply-To: 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: List-Owner; bh=fNKnG/O4Gay+BcbGGu86ZGQb7gmjh9VLRTVQS/cyudU=; b=NYOZzDXbb5Vdwb E2NB2oMSRbpgL3tOM2SpX9lhIUHct8LoAn2mbemXCA/f5/i170fJ17V1JLmptxB22tAMJ2kWnd+xD c9bjRtiBBVVen0lMu292rwQdgoCGnBC44X+7Bbp5anLhzzlkSc8WeAKi1idTe3B5iI8O7hSGg7TJM woZlHevkXO2jINf55XsclOWWNnxnTSwL85XmH//q09gJNqwGQi7brrxVD3qLmogAxBsHci7Yvq5db 2ATmO7/GONpGOQh4I7Dr/0Q21zcfjE+jGBzpME37WCoFeYiPMpnwULIj9airIum3uy/prGN1E1xIe X5ggbqu6wpZ+9RVYwAPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMXUL-00AQvh-0h; Tue, 22 Feb 2022 15:54:05 +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 1nMXS3-00APfm-NP for linux-arm-kernel@lists.infradead.org; Tue, 22 Feb 2022 15:51:46 +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 0BD28B81B3D; Tue, 22 Feb 2022 15:51:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 392CBC340EB; Tue, 22 Feb 2022 15:51:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645545100; bh=bs4sKA1maaqaqniK3RdXMmapJ3D0NuaCLXrdJTmaiaI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=slrw8s8pkXgN++rHQZQWx6+CqEAGEu28keg9VijmEnZFPz1fcma0IoQtSNvNU1UZk 9EQNEXXRswvbSn4L4geX0zHP4OKcEdi8RUWoUBt/M2VqltCEqF4O3lRBEXzJqyp03h zMrbORmdjV6bULaY2OueKCXBpgUBWZ/hJYpTRJIwTlfseXXFuesQXoyUF58U/jkHMF aXDBbMLLtjxwXD7jAuvDDE27qwz7e3jE/e1H+INoAfeQhiFynN2FEZsBosy18fq8iQ sF1ZZGgbgwNP9gh0lJsCZHEwOjBtL8zs/GMJJodzej39QshkQqRGVqFbLuw/fbQny2 pfkGnJhdHYw9w== Received: by pali.im (Postfix) id E30E0FDB; Tue, 22 Feb 2022 16:51:39 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Lorenzo Pieralisi , Bjorn Helgaas , Rob Herring , Thomas Petazzoni , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , =?utf-8?q?Marek_Beh=C3=BAn?= , Russell King Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 06/12] PCI: mvebu: Add support for PCI Bridge Subsystem Vendor ID on emulated bridge Date: Tue, 22 Feb 2022 16:50:24 +0100 Message-Id: <20220222155030.988-7-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220222155030.988-1-pali@kernel.org> References: <20220222155030.988-1-pali@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220222_075144_002211_856035D7 X-CRM114-Status: GOOD ( 13.18 ) 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-mvebu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c index d0a75c3b78c3..566d8382afe6 100644 --- a/drivers/pci/controller/pci-mvebu.c +++ b/drivers/pci/controller/pci-mvebu.c @@ -32,6 +32,7 @@ #define PCIE_DEV_REV_OFF 0x0008 #define PCIE_BAR_LO_OFF(n) (0x0010 + ((n) << 3)) #define PCIE_BAR_HI_OFF(n) (0x0014 + ((n) << 3)) +#define PCIE_SSDEV_ID_OFF 0x002c #define PCIE_CAP_PCIEXP 0x0060 #define PCIE_HEADER_LOG_4_OFF 0x0128 #define PCIE_BAR_CTRL_OFF(n) (0x1804 + (((n) - 1) * 4)) @@ -731,6 +732,7 @@ static int mvebu_pci_bridge_emul_init(struct mvebu_pcie_port *port) struct pci_bridge_emul *bridge = &port->bridge; u32 dev_id = mvebu_readl(port, PCIE_DEV_ID_OFF); u32 dev_rev = mvebu_readl(port, PCIE_DEV_REV_OFF); + u32 ssdev_id = mvebu_readl(port, PCIE_SSDEV_ID_OFF); u32 pcie_cap = mvebu_readl(port, PCIE_CAP_PCIEXP); u8 pcie_cap_ver = ((pcie_cap >> 16) & PCI_EXP_FLAGS_VERS); @@ -752,6 +754,8 @@ static int mvebu_pci_bridge_emul_init(struct mvebu_pcie_port *port) */ bridge->pcie_conf.cap = cpu_to_le16(pcie_cap_ver); + bridge->subsystem_vendor_id = ssdev_id & 0xffff; + bridge->subsystem_id = ssdev_id >> 16; bridge->has_pcie = true; bridge->data = port; bridge->ops = &mvebu_pci_bridge_emul_ops;