Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2708570ybi; Thu, 4 Jul 2019 17:43:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqybkwF+O7mYGu9hR8wiOAg9cuF0W4FUDh+z0t6yQtE5b99z6NVXiaYgRRroW/qeuSQKrcdL X-Received: by 2002:a63:7c0e:: with SMTP id x14mr1207174pgc.65.1562287400092; Thu, 04 Jul 2019 17:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562287400; cv=none; d=google.com; s=arc-20160816; b=TOLzI8A3Y15lvzUVFjgPORX9MV10moVwT48e65vygyUzXdE0/8f0AcaJFsQWuYKzXy yD0WFtVdlYfU3BGE0J7N0M/9MvxdDD29GPzSHHUk0+ROfW6BSGu3gZo4l2MekdMt9IbQ fu++bJCOOrteD9iqQ+c+vE0JMisUVza1r/1DZhywe/DTJkZZ2189IssvXhO45kOJpGNj S57ZxzFT8x4QfmlzK3yC02U62fLuOLDVTkNbOsxXaLkNfv/EEqP+83wnTCZ2S0w912RA vzwrWt5Y/MU84AuQhqVQFcFPIT5l2WjYMVpvvI/wtUQEyq+zhs7kdmfeZDXwBO0G0Erd d55g== 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=7Uj2sZnoCF1Oo31UPjYfIdiGwwBXHgA37hnFtsaYwjA=; b=pmw0LlMiqPzWILYMbI48c5iLbApJt6t75+PsaJYsWWMjewBQCm9qnpVe4pJmyMcXFD j49Mh90SDRoOe3UqBHogIt5ZVBijRg5Bt8BHZLizD5BBLEQ4DbKicjZtv/fRRWibVMT1 xwISWDS3Akc8CHaLPHydgQZVe8/Pn9gVb4T9t+3uGc//tnIoyBxiQccCxSy8dQR6CNvd 2tuYbaxNwboyY12xI5k85kARXm7Ay031vo6HwLzOqeIagWZlCcx6CW+JIWCusQZs5aDE yxCaKQtmpYk/M5SCxbOfRS97dRJwPzhUxlJcnH/+/qiq+hCwSuqKoVtMNILYT3PewGGd WJCA== 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 w18si7310906pgi.37.2019.07.04.17.43.05; Thu, 04 Jul 2019 17:43:20 -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 S1727972AbfGEAmZ (ORCPT + 99 others); Thu, 4 Jul 2019 20:42:25 -0400 Received: from mga03.intel.com ([134.134.136.65]:40861 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727914AbfGEAmQ (ORCPT ); Thu, 4 Jul 2019 20:42:16 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jul 2019 17:42:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,453,1557212400"; d="scan'208";a="185074810" Received: from hao-dev.bj.intel.com ([10.238.157.65]) by fmsmga001.fm.intel.com with ESMTP; 04 Jul 2019 17:42:14 -0700 From: Wu Hao To: gregkh@linuxfoundation.org, mdf@kernel.org, linux-fpga@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, atull@kernel.org, Wu Hao , Xu Yilun Subject: [PATCH v2 09/11] fpga: dfl: afu: add STP (SignalTap) support Date: Fri, 5 Jul 2019 08:23:56 +0800 Message-Id: <1562286238-11413-10-git-send-email-hao.wu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1562286238-11413-1-git-send-email-hao.wu@intel.com> References: <1562286238-11413-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 Signed-off-by: Moritz Fischer --- 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 15dd4cb..395f96e 100644 --- a/drivers/fpga/dfl-afu-main.c +++ b/drivers/fpga/dfl-afu-main.c @@ -514,6 +514,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, @@ -528,6 +558,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