From patchwork Mon Jul 11 22:59:15 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: 12914327 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 AA78BC43334 for ; Mon, 11 Jul 2022 23:01:00 +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=CUULOx8dFyvCXr73AJf5v0uKpQnRmvsEn00GPAJBz78=; b=wGGOQhL8bYskM/ CbyNxYqdatDjlF0cFys7Mue7OMISOn2HETAVpEPVG037BWC+6Xfq41jFLV9JiN2cwWJzHFxtZ5H49 k/8BVs60yvASTZ5K0VpiZuKW2BXab4+Hsr6WsTsDCMUTYdGoRdZQ+KmIx+8FT26x85RkQjU50cEGU ZFk2053hE46KYW5ngwnSu0rY2qm8vycyW7PGzJYoO1fjotO6zfsFF6bv7oDZ6+zXsbwj5vQzXC/vT VY159GZJvJKPWT2lXO9zpWkktoCgmNohM1BcTyaUpQIjeayNzFsV8LhuGH6d+w6uUd2nvOp8LXZVM hI2Z4gzR7k2c3fv4q56A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oB2Nc-005RpB-3S; Mon, 11 Jul 2022 22:59:52 +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 1oB2NX-005Ro4-L4 for linux-arm-kernel@lists.infradead.org; Mon, 11 Jul 2022 22:59:49 +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 19D8EB815F3; Mon, 11 Jul 2022 22:59:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6878C34115; Mon, 11 Jul 2022 22:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657580384; bh=pbckF8CQeGBYncZRbq1u1LrG1FBJr8f03PbBYkrf4UA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O93hKy3KCgZUlHegyC/RvwcSQJLVyXIbYrv2glU0Gw4+WHqB+BBoMlrJ3/UFD+MCo /eLtLLV8iwEMp3dLqF2jjbOlrZ9UpWg9XnVimoy4bs6uV9gT5z/k74lif1lhbrZwdE knyQO97OnjxtIHz5hwPXlUCFGsy3wYG+8NTFadq7usulIdOsUvGwrJaaKWrNXeZWpX ev6Zlk43bzWQxe/QUBoGH/4AEFWVjzieesCS54sreRsfOrOTdtMM7K+VUvx1fhbLga MF66FgbtqNvrXG9a0LLbuRA1jWloxsKt9E3dRbhLdqmOB4lxJNDEjvOpLMAQB/HFLP wZqN/Z+f3W2vQ== Received: by pali.im (Postfix) id 9AE529D7; Tue, 12 Jul 2022 00:59:41 +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 v2] PCI: aardvark: Add support for PCI Bridge Subsystem Vendor ID on emulated bridge Date: Tue, 12 Jul 2022 00:59:15 +0200 Message-Id: <20220711225915.13896-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220711221823.12154-1-pali@kernel.org> References: <20220711221823.12154-1-pali@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220711_155947_858758_761FE2F4 X-CRM114-Status: GOOD ( 13.12 ) 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 --- Changes in v2: * Fix wrong rebase, do not add PCIE_CORE_EXP_ROM_BAR_REG --- drivers/pci/controller/pci-aardvark.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c index 74511f015168..060936ef01fe 100644 --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c @@ -32,6 +32,7 @@ #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_PCIEXP_CAP 0xc0 #define PCIE_CORE_ERR_CAPCTL_REG 0x118 #define PCIE_CORE_ERR_CAPCTL_ECRC_CHK_TX BIT(5) @@ -982,6 +983,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;