Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3803188imw; Mon, 11 Jul 2022 16:33:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uL7dssWdaNgWZO7ivC/iq82KLt79a6c6SyZHBHMX4NoA8A49jweA15STV5SpsvJZNELTeU X-Received: by 2002:a17:902:f785:b0:16a:4f3b:a20c with SMTP id q5-20020a170902f78500b0016a4f3ba20cmr21501064pln.118.1657582428532; Mon, 11 Jul 2022 16:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657582428; cv=none; d=google.com; s=arc-20160816; b=u0RnqMOe5WdVmjby/6zOhh8IJpwgQCXGUzCv2UHq8itpenY6khqcDImP9HPUflCkMi +qG0Wn8f80VPhclOkax81NHLcIdi4ZPejYfviyYF/WXIYGvXkvphHlDgdPnwxcSqPPxy wZ1BVLWiVOzfN1zxqKhOPEwmdFr/9Zj7sPqWiNRLO5lq+tKaXFZ4GYA5ENpW032b/EPk U+ccQwKNCHojNCgfUhDv5w9k15Vyi6D5SYetYTJk98o0ZLYFGT7VTWJ0ntK6Ts1kaLFB qp0cnAWMsq/u6LNSUkxCAY4T2jfaCWQ1uZEs+hWPGYDkyy/eTArEJ2siFGzcMvdmBI4X aZYg== 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=iA1JvY0z9YDdObWrCBT28VQW0n1Japb5m4pMv88pfh8=; b=dWixIBPkNlv9u1ic2HBDYG/upil1itK0GW73iwXs0KnptiEtZS9SLR+6BqSY7p2gGy LR3k3Rz3nhI8gTLPYpWBoqF3+3luNHGBtTcjeHhmIcKfSEjHtRe/27g0kC97O/rAHBsy c6M1WX7a0u29uRPcidMNk+4kvuO2qXous+jdouOKVufCj1v9Io23QrLvU810Q0CAV0Zb 9aqFHC6AGKCt+QalsJ9M9mip2Ys5/PJc71a5ALsfbV3vDbw3o6AJDMi6SdZdxnt4R1nt I/UDGeL0fSwt6ZfIdJXdBhZKbYgiFIYah3bD4RIvJ+aWlGrLThnrD7nFfNwmsPTUdufW rFjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O93hKy3K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 5-20020a621705000000b0051b9771d617si11136758pfx.179.2022.07.11.16.33.35; Mon, 11 Jul 2022 16:33:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O93hKy3K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230356AbiGKW7t (ORCPT + 99 others); Mon, 11 Jul 2022 18:59:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229568AbiGKW7s (ORCPT ); Mon, 11 Jul 2022 18:59:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63EA3509EB; Mon, 11 Jul 2022 15:59:47 -0700 (PDT) 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 1E2B9B81611; 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=20Roh=C3=A1r?= To: Thomas Petazzoni , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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; -- 2.20.1