Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3286668ybl; Sun, 11 Aug 2019 20:10:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqylUIB8QHAqFJNY/FBAcPAQjZ9/w2seXQazSDHuZ8lNEdRZvNNvY44bpWM2v+M2imtqPkeq X-Received: by 2002:a63:5162:: with SMTP id r34mr27554191pgl.229.1565579408105; Sun, 11 Aug 2019 20:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565579408; cv=none; d=google.com; s=arc-20160816; b=wDm8znZ4whdIhFkMqo5UGpI8+NYDJ0HU6U6p60eXN0hYJrorDgcIh4BzOxG9r+jfTS vgR5casvKHvQBE4W4lOWueVbznTI+pujvOHelj3yfwSCBMls7zRSccXJGIeUsCvYN9mc FgXXBxAMWNb/OUTy21f7f796c7vN90tzNO1u6FZu6fk7/Dc5TJV/oNTmemNpYO1kLY+r XBe8xgI6OfCHqD4n5Krx3KdnNifm2j2hNEowQOOeIFhjRPu4rddHu+epeyiTwU1VRLuO aOkQPNSfSkvm3Cb7LCw8hjaEWm4y1O6AKy9hTltenz4RRFOg2NwlKG7/TzJfnXd3jUUE jgxg== 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=xo57AQ02e8RtJascXGEidzMDX6Lowi1ByAJQnytOc40=; b=m6RJI+zS9o8c0UH50qbyp5Pj3TxDwsZEcAT2SXXBUlVgW3bjiedh6OtfIzgU21fcRq VHPVTID26JPGMwNkUvSgdfUO2TRH7jiYXpU59Ip77ukDERnCZpw7TSI/HDOl9o2+Oyc3 RMb7Ve7p8iXpxxBdPwfFhZtvg1AUVRG0mUEIs+/jQMmturZ9/yiDeTJ/Wftr0hmPN1Kv Kvqx5aQ2QRuUIzqc0Nlu9MP1jHA7GfF82ypqxKdwbiVl/cVZPJTDbg+avwME6LtHJeky Wz/LQ86aUBfs7XBW9YFHDLXFvPeM3cZ+x1BtD0yNAumdXOICJVqbA64zLbFTQ9jyyO0x Sxkg== 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 q16si61193016pgv.140.2019.08.11.20.09.52; Sun, 11 Aug 2019 20:10:08 -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 S1726849AbfHLDID (ORCPT + 99 others); Sun, 11 Aug 2019 23:08:03 -0400 Received: from mga17.intel.com ([192.55.52.151]:12631 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726836AbfHLDIA (ORCPT ); Sun, 11 Aug 2019 23:08:00 -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 fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Aug 2019 20:08:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,375,1559545200"; d="scan'208";a="199987499" Received: from hao-dev.bj.intel.com ([10.238.157.65]) by fmsmga004.fm.intel.com with ESMTP; 11 Aug 2019 20:07:58 -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, linux-doc@vger.kernel.org, atull@kernel.org, Wu Hao , Xu Yilun Subject: [PATCH v5 7/9] fpga: dfl: afu: add STP (SignalTap) support Date: Mon, 12 Aug 2019 10:50:02 +0800 Message-Id: <1565578204-13969-8-git-send-email-hao.wu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1565578204-13969-1-git-send-email-hao.wu@intel.com> References: <1565578204-13969-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 --- v4: remove uinit callback which does nothing. remove dev_dbg in init callback function. --- drivers/fpga/dfl-afu-main.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/fpga/dfl-afu-main.c b/drivers/fpga/dfl-afu-main.c index e11352a..e4a34dc 100644 --- a/drivers/fpga/dfl-afu-main.c +++ b/drivers/fpga/dfl-afu-main.c @@ -508,6 +508,27 @@ static int port_afu_init(struct platform_device *pdev, .init = port_afu_init, }; +static int port_stp_init(struct platform_device *pdev, + struct dfl_feature *feature) +{ + struct resource *res = &pdev->resource[feature->resource_index]; + + 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 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, +}; + static struct dfl_feature_driver port_feature_drvs[] = { { .id_table = port_hdr_id_table, @@ -522,6 +543,10 @@ static int port_afu_init(struct platform_device *pdev, .ops = &port_err_ops, }, { + .id_table = port_stp_id_table, + .ops = &port_stp_ops, + }, + { .ops = NULL, } }; -- 1.8.3.1