Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp196311pxm; Tue, 22 Feb 2022 08:49:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJy0vJC0M2zpAEsGZOfiHnOLfqor9yOANDZavMzu80GGtNdwKkRajUlNewaT/Eca9E4XxJ2m X-Received: by 2002:a50:e144:0:b0:410:d813:92 with SMTP id i4-20020a50e144000000b00410d8130092mr27361936edl.9.1645548549347; Tue, 22 Feb 2022 08:49:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645548549; cv=none; d=google.com; s=arc-20160816; b=WBhGHFEcs2gtqUGEnTe6+Z5sk4YwZJCpJ/I9kIleQb3NwQu3wmOFTAGHr3sZFhllF+ Cu9KyQVSzZkGph3AcgKCim0VRjwOXJbwqrPmo0SDu2oCy/GpB4s07CQPmuiyVN4C2yqy 63ecCY94sVTSeAizUXFTHLI82WtEcx/UGsIA42Dh2UOorvo8n9Ezu1GFVKFWMRLhM3Bt LWBQmAeHUSYM0J/iyDs0CulAP4wGd88XUHUgakWk9DIJ9oonmcBhpHHEjQy/dl1lDAlw EXQJjgMXhfwMxhmOdG7ITgE6DfjUKuWZi93dvjin2Bfac5OwJpiF0ukTeP7ln9V5ATU1 JbcA== 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=E0MPu1RjSz7c5TF2wr/llgabTa/5XK0w+GzkYjwcvX0=; b=N4S1XM0RI6zLFP1i3RjdJxyhy1MiS73b6lj3khpThNDem3+fEnBvnql3OxTPLf4vjK 9U/RGQ1Q0PO80niD/wyKdM/O031X0VUBmOu/USRX0xID2RMiUVVmZBzSt6D6ySC6gZoS 99XepUxm7AhvkPQjTZ0EuAJ3DmfA+vzkAIpkp/AjRaP6p8TpTPSzi8mEdQ5UzslhgE+y VaB/o59vjp7iq5C8iXLwUyOyWeSAQzlZem8ORN4QpL/K7phd+0ORvaLg/JG/unosd2f1 ywrjOy80HHzfpQUygqtqx2XYqkcWE9Tb3KP+dC3jrvUGHgdyvi7r+s+qC3Xe99c3MjEo 05lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=slrw8s8p; 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 td13si10178665ejc.769.2022.02.22.08.48.44; Tue, 22 Feb 2022 08:49:09 -0800 (PST) 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=slrw8s8p; 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 S233755AbiBVPwg (ORCPT + 99 others); Tue, 22 Feb 2022 10:52:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233697AbiBVPwK (ORCPT ); Tue, 22 Feb 2022 10:52:10 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09ECA2AE17; Tue, 22 Feb 2022 07:51:43 -0800 (PST) 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 B02DEB81B37; Tue, 22 Feb 2022 15:51:41 +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=20Roh=C3=A1r?= To: Lorenzo Pieralisi , Bjorn Helgaas , Rob Herring , Thomas Petazzoni , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , =?UTF-8?q?Marek=20Beh=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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 --- 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; -- 2.20.1