Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1510477yba; Tue, 2 Apr 2019 10:10:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxewZ7DPayjq54R60A2hKCuJbf15ITigpntiNM3k+kokxv1RCKs6SVu8nRCOFBn12eg3akN X-Received: by 2002:a63:2a8f:: with SMTP id q137mr67190101pgq.31.1554225043877; Tue, 02 Apr 2019 10:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554225043; cv=none; d=google.com; s=arc-20160816; b=Qjm/eZmErEpYDwAm2Tg8/Mr1k48gUZe0qTOQPsx1M5GgS+nCzayZDQx4V6Wx+xDRBD MHBnGER9NSEZGv/Hc5vbp23bpSlsYnYf8QsxGjUIkoBicoXHzl0eRGaVos2ogMp5V+hz Ddgjqa3dr7WvUqpux9dVMvL83tY2YYN481X2Rij2yGzYhsaYywVaOpZAnYpltIdj6WxC GdCIJLQEnOyORWb8NscVKVTBLcbpYI7GQwv27QN7ynbu7RO81zAbM3zpdZX1RDiTPprn gF47VrtLb/Vce6ktY9zUkwmQDLeq2mwntuzgAyh5V/+jkNOXvmgOejG/gX9giBOwYgry AvGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=w5CMHmhMeWTXXbeZMl06HEWjmEjDcB5sk0RH6cM/Y+c=; b=X3chyI9MaDpEtx5scCmqzaJCjQzmjWC9rv7iU55VHttyr3hcRA6tGG/1mtRc9sxxPj slh/HFcDh7Omn6L23RNgVVbUCCVLmSKaag2+4mTXWbUj8mx4xyVsmlHj0f46RlZ2qKYJ xs6sD8MnsMcmODb8OZoPpPDKVrtYGeWTJuugMB6c41GQPFHIRrEY/q28mfc+in+ygXoa XXxDN8g7KG21iuBtX/vGWNObqmM6xpTjUaCQZd0n3CHThJwgPj04eHT3RdEmsbgVWdkf HnNNok7A2TsA1jO43v+5TOw7oE2FyNQ/U+frZxTB8IC+UoFpZmkawVJV3M1ntlT8qyKz SLlA== 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 i97si12179133plb.213.2019.04.02.10.10.28; Tue, 02 Apr 2019 10:10:43 -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 S1732337AbfDBPHY (ORCPT + 99 others); Tue, 2 Apr 2019 11:07:24 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:35668 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728905AbfDBPHW (ORCPT ); Tue, 2 Apr 2019 11:07:22 -0400 Received: by mail-ot1-f67.google.com with SMTP id m10so12416006otp.2; Tue, 02 Apr 2019 08:07:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=w5CMHmhMeWTXXbeZMl06HEWjmEjDcB5sk0RH6cM/Y+c=; b=pE/WK3ju7SgpdW0pydyTTUBQ2pp53dbhhzhtKW48gZamlDXP6q7CYqa6IOe4VG3llf HphNo6XuZxFmQVBm2Kd1UOk6cjIU8Y07ss30ERUm0Tb42682O4FWMl2QIMDyciZ8z51E CbCvpCtHxX2lGCVqCYK/x2cQRTPrBfGBx19qysWRAKwBg72qgPKJhuy/P+97JURBeD9/ W4Wz0ni7SqXCbW9ew/gNK7tRnsckrdUfmNyJX0V0PvUDHbmO4/YjunpXDEYNMkqCbu2j rntbqUkJAxMKVglxzLBSfE5tAKCoios5J4Hj2up4i465H5Zlc79e9nnFntMgonO8FJau M/JQ== X-Gm-Message-State: APjAAAW5ltFyOuHpo/BPSUMWIRWGVlbB962WQxiO5Mcq7kO3RPwtcH9P zqMf10az/m3h66XZi3Esyt8SEV1v9hI= X-Received: by 2002:a9d:3de5:: with SMTP id l92mr49527432otc.200.1554217641349; Tue, 02 Apr 2019 08:07:21 -0700 (PDT) Received: from localhost ([130.164.62.212]) by smtp.gmail.com with ESMTPSA id r25sm5394128otk.37.2019.04.02.08.07.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Apr 2019 08:07:20 -0700 (PDT) Date: Tue, 2 Apr 2019 08:07:19 -0700 From: Moritz Fischer To: Wu Hao Cc: atull@kernel.org, mdf@kernel.org, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Xu Yilun Subject: Re: [PATCH 12/17] fpga: dfl: afu: add STP (SignalTap) support Message-ID: <20190402150719.GB15773@archbook> References: <1553483264-5379-1-git-send-email-hao.wu@intel.com> <1553483264-5379-13-git-send-email-hao.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1553483264-5379-13-git-send-email-hao.wu@intel.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Wu, On Mon, Mar 25, 2019 at 11:07:39AM +0800, Wu Hao wrote: > 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 > --- > 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 > Thanks, Moritz