From patchwork Tue Feb 22 10:46:19 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: 12754889 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 41557C433F5 for ; Tue, 22 Feb 2022 10:52:41 +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=xacZoJvrc2L2kHRBiWlE/t35DIbHU0UfIxucP1BF5GI=; b=OmlhtiTF12W7EY HXAbgpgd2cy7NOU0MT5qO9J47SYIpPYhnQloZKpPslGkMiaBK0XDwF/I25M+zh7zQSZH6n9naFpQ0 tjjqWLtuszen8RLBOKF+OOVf1SjeEVv+JjPXojUiq/dCdoRMt4485RXivK2Zfp6Lec/bmw1Kx23co 36ZqMK4ktZbz6oWF96r90H4SGRIoD5/32RF2OXHmkW7XHISQPvgRN/kk/0YMapks9e6g3+YLOb0m9 04QR/Ezx9oyom+MR/KcG2o7uiBVloPoEKl/XDjCCwdgJt2fGaIpIiMmMSnoNGc8hNZjC38R03oJ31 ZWIn6puVkbVW0ka8NkSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMSlG-009BrJ-Ho; Tue, 22 Feb 2022 10:51:15 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMSh1-0099tt-Dn for linux-arm-kernel@lists.infradead.org; Tue, 22 Feb 2022 10:46:57 +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 0387AB81986; Tue, 22 Feb 2022 10:46:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8519AC340F0; Tue, 22 Feb 2022 10:46:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645526809; bh=ww7911UP3Fbvn/wTWNYU+t606JgfxRHZwCcarZxvnyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DWy2gShve30hWDl5ny4pawXlqCfm9xg9QuFGN175H4msLFtYVSjz8mP37+28DPP94 4hQJL0Xfb7Tl+GGVOhCQrlfOlMnCTkSqpdy5p05dopJaUzQQwLDzehn2hJcLD+RHBf E1sMKhlb9mkKxdYxNCjo2CW78rbssGY/nBdis+nCUaM1BBA7/2/qe5zyusL3kAdJn9 pUXzrUtrew/U7at7IdgyQghSpoxAIsC4WcyW/TbU79uktljaVkC1V17rlsSkxSkm8p 2w89vTs6RGQv1mg3cdwM3Vao+NNrXbyNvyhgtsKaqCeIn2wBxN47dlxjsZbVL0Kmsc BzhJ9pb/BsvkA== Received: by pali.im (Postfix) id 3D7D0FDB; Tue, 22 Feb 2022 11:46:49 +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 v3 06/12] PCI: mvebu: Add support for PCI Bridge Subsystem Vendor ID on emulated bridge Date: Tue, 22 Feb 2022 11:46:19 +0100 Message-Id: <20220222104625.28461-7-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220222104625.28461-1-pali@kernel.org> References: <20220222104625.28461-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_024651_679868_048C52FD X-CRM114-Status: GOOD ( 13.11 ) 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 0f2ec0a17874..811af9e6ede5 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;