From patchwork Wed Mar 10 16:09:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 396755 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp502713jai; Wed, 10 Mar 2021 08:11:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqwCNM8r3qNcUJTo99c6YVfLcGedAYs28jQsosF7B7CmVtzA7w7GYwAqAleNsJFkRLvQbq X-Received: by 2002:a05:6402:1383:: with SMTP id b3mr4187553edv.374.1615392693228; Wed, 10 Mar 2021 08:11:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615392693; cv=none; d=google.com; s=arc-20160816; b=KrLfjYIfGl4tvvTjgm/cfRSK+PoIUAS+4GIZeDOv8WtnADF2MMU3/sJ1emfhkxd/At UywbB3SIJUXeSL734ml5wgOEfesyAhPpcDA2jZv/ogqH47rj4L/MtkVBZQpSlejtuqxc UIawFRx35pfeWwlBAkMUaoEbz60k7YiXsrwTw84PPUSK6JzG301CIX1O0JXD0XuPus3u 1KFLwt4wCNgnXgQGcjsZc+rLTF49AZRApeEAO1WEjjmqpcT11vboGEwacf9/CAp5Tg05 YZVFas3mroAbYs+vBxSPVffenczesZClTfGzH5dMJLhMKSWJ0zTM4RBz563MvngRQYKq MaQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=Uaw2AhSFxM9oBV3jzN5LoozupiwUAtWEp62rFJomdbs=; b=hpgC5NhwX+PBkuhllsL0XOSF0D8k+q/w5Wp6ie+AjBJWg1N+iHkJEWesXzgjhc5QID cGsWyomuTbUFENCSMw2Ao7NdQLnYsrdDnk4WuvjEewnWpwZTdmS6H235D7U0mB6vOHD0 mUVhd8nkOiWtgAVAH8TJFyyCnqhWLY6OWvTUMxjgAmPIWURJWwRj3ETO8JUIeC0qJUig D4vEVztJ3zpLJIy5URoyi0qDNCatCBdtvgkVFx2D+BeUV5ZNaGOJE6mBnaOnzGfm0JsI H5o0uilyQkH7QLOatZu8VIOKkdkHNjMIfscQTut47JjrQkQss0F4kTRn3Ks1TkWDIoOV 4U/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="edKji/Yp"; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rn25si8164962ejb.250.2021.03.10.08.11.33; Wed, 10 Mar 2021 08:11:33 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="edKji/Yp"; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233224AbhCJQK7 (ORCPT + 6 others); Wed, 10 Mar 2021 11:10:59 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:51386 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233214AbhCJQKe (ORCPT ); Wed, 10 Mar 2021 11:10:34 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 12AG9x4b127769; Wed, 10 Mar 2021 10:09:59 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1615392599; bh=Uaw2AhSFxM9oBV3jzN5LoozupiwUAtWEp62rFJomdbs=; h=From:To:CC:Subject:Date; b=edKji/Ypjl6R/GH86U7ToJnG27nz5QAOc8ejtMGf6CqAdPPGuMUEemeGoBPiXDJFN Iryf70ViYg3/+pQ/R+lEpZgd5IWLGoGnxfZNTKpWgWI/hesV4MqwWcuW2ZLJo0CvzU 0ItSAh9rZOHGCoQG6YpQUYDocrSSeF36asJLCuY4= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 12AG9x0F003935 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 10 Mar 2021 10:09:59 -0600 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Wed, 10 Mar 2021 10:09:59 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Wed, 10 Mar 2021 10:09:59 -0600 Received: from a0393678-ssd.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 12AG9qkr100440; Wed, 10 Mar 2021 10:09:52 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Lorenzo Pieralisi , Bjorn Helgaas , Jonathan Corbet , Rob Herring , Arnd Bergmann , Tom Joseph , Jingoo Han , Gustavo Pimentel , Marek Vasut , Yoshihiro Shimoda , Shawn Lin , Heiko Stuebner , Nadeem Athani CC: Greg Kroah-Hartman , , , , , , , , Lokesh Vutla Subject: [PATCH v4 0/7] Add SR-IOV support in PCIe Endpoint Core Date: Wed, 10 Mar 2021 21:39:36 +0530 Message-ID: <20210310160943.7606-1-kishon@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Patch series *) Adds support to add virtual functions to enable endpoint controller which supports SR-IOV capability *) Add support in Cadence endpoint driver to configure virtual functions *) Enable pci_endpoint_test driver to create pci_device for virtual functions v1 of the patch series can be found at [1] v2 of the patch series can be found at [2] v3 of the patch series can be found at [3] Here both physical functions and virtual functions use the same pci_endpoint_test driver and existing pcitest utility can be used to test virtual functions as well. Changes from v3: *) Fixed Rob's comment and added his Reviewed-by as suggested by him. Changes from v2: *) Fixed DT binding documentation comment by Rob *) Fixed the error check in pci-epc-core.c Changes from v1: *) Re-based and Re-worked to latest kernel 5.10.0-rc2+ (now has generic binding for EP) [1] -> http://lore.kernel.org/r/20191231113534.30405-1-kishon@ti.com [2] -> http://lore.kernel.org/r/20201112175358.2653-1-kishon@ti.com [3] -> https://lore.kernel.org/r/20210305050410.9201-1-kishon@ti.com Kishon Vijay Abraham I (7): dt-bindings: PCI: pci-ep: Add binding to specify virtual function PCI: endpoint: Add support to add virtual function in endpoint core PCI: endpoint: Add support to link a physical function to a virtual function PCI: endpoint: Add virtual function number in pci_epc ops PCI: cadence: Add support to configure virtual functions misc: pci_endpoint_test: Populate sriov_configure ops to configure SR-IOV device Documentation: PCI: endpoint/pci-endpoint-cfs: Guide to use SR-IOV .../PCI/endpoint/pci-endpoint-cfs.rst | 12 +- .../devicetree/bindings/pci/pci-ep.yaml | 7 + drivers/misc/pci_endpoint_test.c | 1 + .../pci/controller/cadence/pcie-cadence-ep.c | 251 +++++++++++++++--- drivers/pci/controller/cadence/pcie-cadence.h | 7 + .../pci/controller/dwc/pcie-designware-ep.c | 36 +-- drivers/pci/controller/pcie-rcar-ep.c | 19 +- drivers/pci/controller/pcie-rockchip-ep.c | 18 +- drivers/pci/endpoint/functions/pci-epf-ntb.c | 79 +++--- drivers/pci/endpoint/functions/pci-epf-test.c | 66 +++-- drivers/pci/endpoint/pci-ep-cfs.c | 24 ++ drivers/pci/endpoint/pci-epc-core.c | 130 ++++++--- drivers/pci/endpoint/pci-epf-core.c | 144 +++++++++- include/linux/pci-epc.h | 57 ++-- include/linux/pci-epf.h | 16 +- 15 files changed, 664 insertions(+), 203 deletions(-) -- 2.17.1