Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp2826003img; Sun, 24 Mar 2019 20:25:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzC69/3z0ZNMhaT2ZfNL3LXbVYbqDU0xpw18UFojkj69P7twjEQOWQBND+efZodqKFlLHOq X-Received: by 2002:a65:6107:: with SMTP id z7mr7619945pgu.313.1553484322323; Sun, 24 Mar 2019 20:25:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553484322; cv=none; d=google.com; s=arc-20160816; b=l0AwirkkUayyZ7PU+vZzOxpVJEBK86SUKkdKgurhwyoTRqNI2LKK+aVHhQUfReonfX m3FLT5WpQNKqMZRSsqofvUS6zlxgUo0AxGVs+5ym7/LAsxCGmVH8V758SYFb/CWZZHEm XBahDQ8ySei7KXXuHTBEzbJRyQQQZO3ahkAPmFirEFAXIIPutDqehRO8LiR0K2/ETgX6 dvBAdsOEddNuCr27KDAsE7qz7P3hjJUwXdXwnmAo23nQhATR5VlpNXplPD3djU5KjhEr 5f6G/hshvtNfF4UwFkrxtDBAxjByX3T+CbaIwDTWLcAg7zMWoeXHheGahrEqulbf/JEJ giZQ== 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=9LgTdn4D1XAxoEwKdavo27DYOphrhO5c/bLRsfDibcI=; b=pqi4xpZcg1Cm+R9dSPrK5g0KEiVXgH0Yadwc2fm3Ox4wUME/EmKG2nVAavw7a1mWcX Cfz1U+YO3UXv1KhqTcoUOPNm7k+THcc0PTk0qf3wFrQOYaqIbmsC0z3aOnlIxwFdF/kt alQ1CnDEC7Pu3Op5uvSC0qd6eRVpJ8wteve4VSybcwBTS0mm0uukcq7j/cI16mUKlQYH Oxpz4vnymJrLB6i+X0fiUjxH2Q98Afb4n4HuBzN7XCWh0GW4ES6FYiSNdTy4Ikv3AD9G u7snbcw8ZqFk6d0Ry8xwyf2fotsTcEipJiqgs3dsR5VIHaDQn1OMPyknGX/GWA/i+05t O0pQ== 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 w11si12147076ply.321.2019.03.24.20.25.07; Sun, 24 Mar 2019 20:25:22 -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 S1729643AbfCYDYQ (ORCPT + 99 others); Sun, 24 Mar 2019 23:24:16 -0400 Received: from mga18.intel.com ([134.134.136.126]:19159 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729608AbfCYDYN (ORCPT ); Sun, 24 Mar 2019 23:24:13 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Mar 2019 20:24:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,256,1549958400"; d="scan'208";a="310109732" Received: from hao-dev.bj.intel.com ([10.238.157.65]) by orsmga005.jf.intel.com with ESMTP; 24 Mar 2019 20:24:11 -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 12/17] fpga: dfl: afu: add STP (SignalTap) support Date: Mon, 25 Mar 2019 11:07:39 +0800 Message-Id: <1553483264-5379-13-git-send-email-hao.wu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1553483264-5379-1-git-send-email-hao.wu@intel.com> References: <1553483264-5379-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 --- 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 const struct dfl_feature_ops port_afu_ops = { .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 struct dfl_feature_driver port_feature_drvs[] = { .ops = &port_err_ops, }, { + .id_table = port_stp_id_table, + .ops = &port_stp_ops, + }, + { .ops = NULL, } }; -- 2.7.4