Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3436310yba; Mon, 29 Apr 2019 02:14:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLjDmlyCtkMlqcreJYICOTcL34godxdkgvelF5+sjBamNLnEWp6L6Sllnlq4joIYGkrhO7 X-Received: by 2002:a17:902:42:: with SMTP id 60mr60897279pla.79.1556529261811; Mon, 29 Apr 2019 02:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556529261; cv=none; d=google.com; s=arc-20160816; b=qLLdqKMF4plhxDxxiYendwRx/kBzd9iOYtJn1LaK4JnBtAPSvv2fynVMZ30d+gQx2r w1oF80WypOaL8mhDPzCngKmhI/5RLtSBYgtwo5fCO7RvyiN71vGGTc//jphQ2d485C/B pU++YWc93arXyRxL1nGYwK8sdAcuiwQEW7SycGTeXx+HiH4tFLXHthIGq/uQ9PywHyA9 omW5eNSwkmABY6q4P6PnuznDoJ1hEZ2/7t5KEvT2PS5trer4L07hyYrGizBRJYZ0kmfK KLMp3hi6HHKl7nAGyryi+hQfQj1xHPNQQnQ5HeVQUN4jAC92NwIqtloghvEGIq48TPpH EDUg== 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=4n7vfz+/xjOl9zY4QKPrSbXetBBnpCGRrc7Q6zZFGIo=; b=Rokld+E9Tb1fLN+54t+8DXf6D7I66ZyIYPE83piZjwc7mWxuh+d2m66nuZbpqCmWeT ia2pFz1phPIMBAHHa4QPQfqN4ZuyH6uW+u5m5FOW/PafEbh82ViOr61B1VDfgTjp18pU erI4278Xux4jSw4wOUE7zdUhLBB3e0Pnd2qFxLUjh0mRZISaLyldE1WVXP+WeE+Raq5l fQj39goCCB08tJ6WjwQHnFZ41cNqVltSjeT+7XNdw7mmwG3Im0bntjQvxxfKAiM9RreU jYnvRfE/FhFNseWAAD2Cs9mYDOxjzDkDVER+p//Y8KoZgypPR2MyDwh+Cn6jv8s3Bt4Q Q94g== 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 l5si13924174pgj.560.2019.04.29.02.14.06; Mon, 29 Apr 2019 02:14:21 -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 S1727956AbfD2JND (ORCPT + 99 others); Mon, 29 Apr 2019 05:13:03 -0400 Received: from mga02.intel.com ([134.134.136.20]:32630 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727936AbfD2JM7 (ORCPT ); Mon, 29 Apr 2019 05:12:59 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Apr 2019 02:12:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,409,1549958400"; d="scan'208";a="165988292" Received: from hao-dev.bj.intel.com ([10.238.157.65]) by fmsmga004.fm.intel.com with ESMTP; 29 Apr 2019 02:12:57 -0700 From: Wu Hao To: atull@kernel.org, mdf@kernel.org, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-api@vger.kernel.org, Wu Hao , Xu Yilun Subject: [PATCH v2 13/18] fpga: dfl: afu: add STP (SignalTap) support Date: Mon, 29 Apr 2019 16:55:46 +0800 Message-Id: <1556528151-17221-14-git-send-email-hao.wu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556528151-17221-1-git-send-email-hao.wu@intel.com> References: <1556528151-17221-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 754729e..14970a4 100644 --- a/drivers/fpga/dfl-afu-main.c +++ b/drivers/fpga/dfl-afu-main.c @@ -518,6 +518,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, @@ -532,6 +562,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