Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2699574ybd; Thu, 27 Jun 2019 17:52:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqBdEvPShFESMXXVHw/Q9a2T+vF3C9vyVaiK+WB3mYyg3zWtTE3DAqc/2wZpKyaAS3er7x X-Received: by 2002:a17:902:2a27:: with SMTP id i36mr7939511plb.161.1561683174033; Thu, 27 Jun 2019 17:52:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561683174; cv=none; d=google.com; s=arc-20160816; b=vEW5AbrzwCLoWZF6PIpNl6a23InkaYkpyCQjLuyD3rRZ/s4FWa9ycvYFJZHPXd/qIq m9/adbpMxUGCBRUjLjLIfuhNC6LUJqY/H2dxNQn9bqYRsZvXop8hyFG3mwjFnEh9RZVK wXFzyycXrnkAPmiM7lyJPDVMTz2BDXF9A43JMqcecZ41WjYoRpsecR0+Vpk+kZRAlmRH LYN1njmIvFfl29Pm9qY+LdaDSdaiatMeHkSzdp+m0aRTJW3yfOC7TWQN2swaTeiFxGM/ yUjze6cbZe+J4YV8leKO3MFFqPWr2gzD2Y4gmScPWMq8E/wk4NgwPLNJ16hFVYZa3LfU wFqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=HyzOL0Pl+1y/hQEqhIjAQ6BJ3vDTfLUIBzwx5JkXRP0=; b=hjHg7dNtdOs482PtKBpMI72ceI3BzjTJuRpuekjQcwxnh4HD04FFLE5UlsRLmpQ9Y9 U9hxqqSnlKu3y1C/6HrsAQEoME9qxMSGkVc+/VW3zVCgyuERV87J+4B93KvwUBAfbGFU c0CenzhLdByLqHiZemDUNx9Q/qT3sQM932dm0vapmK0/9iW3jLtgNiOnatXzBhpkQvYI Mk07jsFAYLzyAyNDDao6pfTg2pxhl3hVp7YMFA1plseiI0o1SV7zo0B55wsPBfZpnLAj Lwl4bTYGm7O20IgECK2+nGGdvV5MTp58IPeDcUP5mX6sLnfhnn4TnyicqPsT52vVZFjL MwZw== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l23si611468pgb.333.2019.06.27.17.52.37; Thu, 27 Jun 2019 17:52:54 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726976AbfF1Aur (ORCPT + 99 others); Thu, 27 Jun 2019 20:50:47 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:42826 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726962AbfF1Auo (ORCPT ); Thu, 27 Jun 2019 20:50:44 -0400 Received: by mail-pf1-f194.google.com with SMTP id q10so2053733pff.9 for ; Thu, 27 Jun 2019 17:50:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HyzOL0Pl+1y/hQEqhIjAQ6BJ3vDTfLUIBzwx5JkXRP0=; b=JZF2qyNhhxO1xiffbwYctT1sL2m1hRCZYB2fFeHoXvSQgLroWuOTJ3Cf6HwJXCh33r +xBmvSxvp4ugnVf/0ZwcdVOEuKKkRGUR1a1jnplnfKiSwysiIAGIgcfe1+tuNAotOOvv 4Sn5qJkflpsw5AohLaUs6oWZp4nif4hpdaRl5kw/bLfF33/OQtfy5G+AN+wRyc6UT20N GiSRYQu4+mBaz/Fqx+uT7hfYmxZvMsJh4md4COzccf12NPu4bhWy1H9U2uYVM3401vtN CJ/tiO/H7APhiF8q0wkjotzPh4ZjNBHU56Z6kUOrW42apVkFUUPuXB08LbLkHKoRRhg0 ylsQ== X-Gm-Message-State: APjAAAVQvTJi8W3WFP1I48YiX6jvyHuNb7VYArMfCMUqE0zihIBgaoqx yaeYDdhnrM15le1VMwT8ZgpHZA== X-Received: by 2002:a63:db07:: with SMTP id e7mr2197338pgg.110.1561683043927; Thu, 27 Jun 2019 17:50:43 -0700 (PDT) Received: from localhost (c-76-21-109-208.hsd1.ca.comcast.net. [76.21.109.208]) by smtp.gmail.com with ESMTPSA id o32sm365158pje.9.2019.06.27.17.50.42 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 27 Jun 2019 17:50:42 -0700 (PDT) From: Moritz Fischer To: linux-fpga@vger.kernel.org, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Wu Hao , Xu Yilun , Moritz Fischer , Alan Tull Subject: [PATCH 13/15] fpga: dfl: afu: add STP (SignalTap) support Date: Thu, 27 Jun 2019 17:49:49 -0700 Message-Id: <20190628004951.6202-14-mdf@kernel.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190628004951.6202-1-mdf@kernel.org> References: <20190628004951.6202-1-mdf@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wu Hao 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 bcf6e285a854..8241aced2d5d 100644 --- a/drivers/fpga/dfl-afu-main.c +++ b/drivers/fpga/dfl-afu-main.c @@ -513,6 +513,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, @@ -526,6 +556,10 @@ static struct dfl_feature_driver port_feature_drvs[] = { .id_table = port_err_id_table, .ops = &port_err_ops, }, + { + .id_table = port_stp_id_table, + .ops = &port_stp_ops, + }, { .ops = NULL, } -- 2.22.0