Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1627117ybd; Wed, 26 Jun 2019 22:04:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxF4cKoiuCRQgngzuB/BvL/aOrde+vO0RBFozDGgrx6j4i4pcsiqaQMMUybzvxd9vK5MkRf X-Received: by 2002:a65:480b:: with SMTP id h11mr1895493pgs.222.1561611856941; Wed, 26 Jun 2019 22:04:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561611856; cv=none; d=google.com; s=arc-20160816; b=kkYXHyae/5L3WHzJQSyeF7iq/HqASse1RK/srC+xjvjT5RgnvtQ0UtkiEAlA/Iil0M TaoFqR4Rukj/D95Nc/KXsDa4h+Rw4KP1Vkc/CeDIAkr6gayPCcYm+DSRzvT1IbYoPDoP S9IZHTz9RS4O/ri44tZwMEMennXhd7aJvpYQttyffOet41E63JK+zvyiQZr8a9kIKt4C RFbC7Ii4DiTOnUGS0HarKIUQ+fAOI2T1P2g9uf/J2yBXSYoYLNLcxr6D7AbH7ZMsEZIe uCpppZ9qE5oMTECeeDWMWxa4bxU7xYlJdn3Z5UQQj8mYv7JA8AZ8GZ8fgd0Lv2ITt/mW zfXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=GjR4aeaNbblaQpPlDL3bDup8mf8cV7eDCTatZxhnaAo=; b=drfoH+CA33tf8Yyr5af77ZpZqjyG+YNHKA3n1LOB82DXu9ffwPygaCCT0BByHXBqz3 HkpL5ZcANDY8K5+f9TbW+VNYku+G8JoRetk5t1sVZNkekoLb2pxUv9beEVHErWBdmfd+ PdV8UOtrpnnj5ysjTZNy1kM38351San0O1+hSCn8w4ApEwzlqKHfb3wVt2gycWJnreCq ANc/+Ym9UjyXi2Jl7aMnVl9+52WBk0LnUlmzF+cqmq2QiS2MvWh+Y1QZGOTLgqvA4v+5 KbYfgWD7j6fen7HhysU/NeU0fXRYInS7j5GPi3kIqemQj2c1OsDZ7VJe+1ceVuYCp2kB uMaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w61si1303724plb.319.2019.06.26.22.03.35; Wed, 26 Jun 2019 22:04:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727454AbfF0FCR (ORCPT + 99 others); Thu, 27 Jun 2019 01:02:17 -0400 Received: from mga11.intel.com ([192.55.52.93]:22943 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727436AbfF0FCQ (ORCPT ); Thu, 27 Jun 2019 01:02:16 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2019 22:02:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,422,1557212400"; d="scan'208";a="173005152" Received: from hao-dev.bj.intel.com ([10.238.157.65]) by orsmga002.jf.intel.com with ESMTP; 26 Jun 2019 22:02:14 -0700 From: Wu Hao To: mdf@kernel.org, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-api@vger.kernel.org, yilun.xu@intel.com, hao.wu@intel.com, gregkh@linuxfoundation.org, atull@kernel.org Subject: [PATCH v4 13/15] fpga: dfl: afu: add STP (SignalTap) support Date: Thu, 27 Jun 2019 12:44:53 +0800 Message-Id: <1561610695-5414-14-git-send-email-hao.wu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561610695-5414-1-git-send-email-hao.wu@intel.com> References: <1561610695-5414-1-git-send-email-hao.wu@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org STP (SignalTap) is one of the private features under the port for debugging. This patch adds private feature driver support for it to allow userspace applications to mmap related mmio region and provide STP service. Signed-off-by: Xu Yilun Signed-off-by: Wu Hao Acked-by: Moritz Fischer Acked-by: Alan Tull --- drivers/fpga/dfl-afu-main.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/drivers/fpga/dfl-afu-main.c b/drivers/fpga/dfl-afu-main.c index bcf6e28..8241ace 100644 --- a/drivers/fpga/dfl-afu-main.c +++ b/drivers/fpga/dfl-afu-main.c @@ -513,6 +513,36 @@ static void port_afu_uinit(struct platform_device *pdev, .uinit = port_afu_uinit, }; +static int port_stp_init(struct platform_device *pdev, + struct dfl_feature *feature) +{ + struct resource *res = &pdev->resource[feature->resource_index]; + + dev_dbg(&pdev->dev, "PORT STP Init.\n"); + + return afu_mmio_region_add(dev_get_platdata(&pdev->dev), + DFL_PORT_REGION_INDEX_STP, + resource_size(res), res->start, + DFL_PORT_REGION_MMAP | DFL_PORT_REGION_READ | + DFL_PORT_REGION_WRITE); +} + +static void port_stp_uinit(struct platform_device *pdev, + struct dfl_feature *feature) +{ + dev_dbg(&pdev->dev, "PORT STP UInit.\n"); +} + +static const struct dfl_feature_id port_stp_id_table[] = { + {.id = PORT_FEATURE_ID_STP,}, + {0,} +}; + +static const struct dfl_feature_ops port_stp_ops = { + .init = port_stp_init, + .uinit = port_stp_uinit, +}; + static struct dfl_feature_driver port_feature_drvs[] = { { .id_table = port_hdr_id_table, @@ -527,6 +557,10 @@ static void port_afu_uinit(struct platform_device *pdev, .ops = &port_err_ops, }, { + .id_table = port_stp_id_table, + .ops = &port_stp_ops, + }, + { .ops = NULL, } }; -- 1.8.3.1