Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2725388ioo; Tue, 24 May 2022 04:43:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzT5o0Sjeb+w92J4S888Grr+E8nlzpi4fjoF9hQWemfOZiIVYVcW8CNcsOvGdhBrOnLAjRv X-Received: by 2002:a17:907:9813:b0:6fa:78b0:9be2 with SMTP id ji19-20020a170907981300b006fa78b09be2mr24278856ejc.159.1653392589222; Tue, 24 May 2022 04:43:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653392589; cv=none; d=google.com; s=arc-20160816; b=X9N1K+Xhux5PWRdFx3j31hVZ6hMRichaCtZCv3sTSuy5mGdl3QvrbAhlmNgmnLXeKd 2y9+aIHHpJQjGeQAP2TBL/C7a0ELwJNnuRYFsuEb7AnnkuN/clozAxSUiqrAMkSxvm30 gQy2TSn6pCPPTyfv9Z1UEZToE+oEowOfX/P6LH923Z4MoB+aj/uY5mLl5o8qH+AhisOe doK6mf5Y3BCO/s8PjOsFpyzBC86IFs5Q2kYFP7f1M/U+YT9FhBAsqxYsra7kqBxXeSA5 OVEBkWvGe8L95YHCtDqxv/+wCxUiXOn5A7dG6Bmq/KGE/bRyCqxWonrBFqU+e4LjY3Ag R9cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ZneZlwTaWbu52y3FEEErRrYskpuDw+eBsbDnaaApUno=; b=l19lQT2xDpdbJtKwPII2HryHX7PBOdYU6X8DLM85cwGZu3BvfCe7POEfZvcdHfStzX cxPMRO9pb6VjIb1U04ArErk6gY72UrBWTf/NDfBQFjHLL2JqNgZrXjVZstj4hMj2B8Ej tgWHGx832EZkFfI4BZm0G7a/V8bcdy/pl61BLkoGJI/bh9ElIKmS1dQHDa0C6plI+ExU HR9YLeiuh/f/qWFBtiPjjDaA9rz5dWRja4XJJBOL61tZ5EmsGkYLkNr5HmM42dfI+UTw m9Uw8XuX/jtBCYyIb2RyAh4iexE0tj6jF9xF7bC0GzLOJ7+8Mi34AMxPjRwpxn+1tPsu Ydaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=kbHXg5iU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s18-20020a1709067b9200b006fea2a02361si11578268ejo.371.2022.05.24.04.42.43; Tue, 24 May 2022 04:43:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=kbHXg5iU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234928AbiEXHOv (ORCPT + 99 others); Tue, 24 May 2022 03:14:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235038AbiEXHOr (ORCPT ); Tue, 24 May 2022 03:14:47 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD1C995495; Tue, 24 May 2022 00:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1653376485; x=1684912485; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ZneZlwTaWbu52y3FEEErRrYskpuDw+eBsbDnaaApUno=; b=kbHXg5iUVwTgpd6JhL7/fSvdvdcM3mcG+HMs9G99UMbP7bEqfZv5s+M7 nA1RKtprVDaVwX36DqhKPuZZd3QEHKZZt5q/BbVwdOJ5GYkrU3bku5r82 EDFh/UsynjRLkwrDXZCDdScioyRYkhXjl+EO1z9d/LRl8uyX7fhdRb42B Y=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-02.qualcomm.com with ESMTP; 24 May 2022 00:14:45 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 00:14:45 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 24 May 2022 00:14:44 -0700 Received: from [10.239.133.9] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 24 May 2022 00:14:40 -0700 Message-ID: <6f44aa9e-ba5e-3c94-501c-32e0b35ade56@quicinc.com> Date: Tue, 24 May 2022 15:14:38 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH v7 05/10] coresight-tpdm: Add integration test support Content-Language: en-US To: Suzuki K Poulose , Mathieu Poirier , Alexander Shishkin , Konrad Dybcio , Mike Leach CC: Greg Kroah-Hartman , , , , Tingwei Zhang , Yuanfang Zhang , Tao Zhang , Trilok Soni , Hao Zhang , , Bjorn Andersson References: <20220509133947.20987-1-quic_jinlmao@quicinc.com> <20220509133947.20987-6-quic_jinlmao@quicinc.com> <7fd884ed-1255-5976-6fcc-7a19ad0eb04e@arm.com> From: Jinlong Mao In-Reply-To: <7fd884ed-1255-5976-6fcc-7a19ad0eb04e@arm.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Good afternoon. On 5/23/2022 5:17 PM, Suzuki K Poulose wrote: > On 09/05/2022 14:39, Mao Jinlong wrote: >> Integration test for tpdm can help to generate the data for >> verification of the topology during TPDM software bring up. >> >> Sample: >> echo 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink >> echo 1 > /sys/bus/coresight/devices/tpdm0/enable_source >> echo 1 > /sys/bus/coresight/devices/tpdm0/integration_test >> echo 2 > /sys/bus/coresight/devices/tpdm0/integration_test >> cat /dev/tmc_etf0 > /data/etf-tpdm0.bin >> >> Signed-off-by: Tao Zhang >> Signed-off-by: Mao Jinlong > > Please could we stick this under a sub-Kconfig entry, like > we did for the CTI ? > > CONFIG_CORESIGHT_TPMD_INTEGRATION_TEST This is comment in V5 patch. There is no adverse effects for all tpdms with integration test enabled. So i removed this config. " For the last patchset you mentioned that you were making this configurable because the CTI intgration tests were also configurable. The reason that the CTI intergration test registers were done in this way is that some of the CoreSight components were not guaranteed to return to a usable state once integration test was disabled. Thus after use of the integration test, a complete board reset was recommended. Therefore we ensured that these features would only be used by those specifically configuring them and who were hopefully aware of the potentail limitations If your hardware can reliably enable and disable integration test without adverse effects, then you may wish to consider making the integration test a permanent feature of the driver. Regards Mike " > >> --- >>   drivers/hwtracing/coresight/coresight-tpdm.c | 54 ++++++++++++++++++++ >>   drivers/hwtracing/coresight/coresight-tpdm.h | 14 +++++ >>   2 files changed, 68 insertions(+) >> >> diff --git a/drivers/hwtracing/coresight/coresight-tpdm.c >> b/drivers/hwtracing/coresight/coresight-tpdm.c >> index 70df888ac565..57e38aa7d2bd 100644 >> --- a/drivers/hwtracing/coresight/coresight-tpdm.c >> +++ b/drivers/hwtracing/coresight/coresight-tpdm.c >> @@ -123,6 +123,59 @@ static void tpdm_init_default_data(struct >> tpdm_drvdata *drvdata) >>       CS_LOCK(drvdata->base); >>   } >>   +/* >> + * value 1: 64 bits test data >> + * value 2: 32 bits test data >> + */ >> +static ssize_t integration_test_store(struct device *dev, >> +                      struct device_attribute *attr, >> +                      const char *buf, >> +                      size_t size) >> +{ >> +    int i, ret = 0; >> +    unsigned long val; >> +    struct tpdm_drvdata *drvdata = dev_get_drvdata(dev->parent); >> + >> +    ret = kstrtoul(buf, 10, &val); >> +    if (ret) >> +        return ret; >> + >> +    if (val != 1 && val != 2) >> +        return -EINVAL; >> + >> +    if (!drvdata->enable) >> +        return -EINVAL; >> + >> +    if (val == 1) >> +        val = ATBCNTRL_VAL_64; >> +    else >> +        val = ATBCNTRL_VAL_32; >> +    CS_UNLOCK(drvdata->base); >> +    writel_relaxed(0x1, drvdata->base + TPDM_ITCNTRL); >> + >> +    for (i = 1; i < INTEGRATION_TEST_CYCLE; i++) > > super minor nit : It is a bit un-natural, not to have i = 0; This should be 0. I will update. > > Rest looks fine to me . > > Suzuki > > >> +        writel_relaxed(val, drvdata->base + TPDM_ITATBCNTRL); >> + >> +    writel_relaxed(0, drvdata->base + TPDM_ITCNTRL); >> +    CS_LOCK(drvdata->base); >> +    return size; >> +} >> +static DEVICE_ATTR_WO(integration_test); >> + >> +static struct attribute *tpdm_attrs[] = { >> +    &dev_attr_integration_test.attr, >> +    NULL, >> +}; >> + >> +static struct attribute_group tpdm_attr_grp = { >> +    .attrs = tpdm_attrs, >> +}; >> + >> +static const struct attribute_group *tpdm_attr_grps[] = { >> +    &tpdm_attr_grp, >> +    NULL, >> +}; >> + >>   static int tpdm_probe(struct amba_device *adev, const struct >> amba_id *id) >>   { >>       struct device *dev = &adev->dev; >> @@ -157,6 +210,7 @@ static int tpdm_probe(struct amba_device *adev, >> const struct amba_id *id) >>       desc.ops = &tpdm_cs_ops; >>       desc.pdata = adev->dev.platform_data; >>       desc.dev = &adev->dev; >> +    desc.groups = tpdm_attr_grps; >>       drvdata->csdev = coresight_register(&desc); >>       if (IS_ERR(drvdata->csdev)) >>           return PTR_ERR(drvdata->csdev); >> diff --git a/drivers/hwtracing/coresight/coresight-tpdm.h >> b/drivers/hwtracing/coresight/coresight-tpdm.h >> index f95aaad9c653..4aa880794383 100644 >> --- a/drivers/hwtracing/coresight/coresight-tpdm.h >> +++ b/drivers/hwtracing/coresight/coresight-tpdm.h >> @@ -14,6 +14,20 @@ >>   /* Enable bit for DSB subunit */ >>   #define TPDM_DSB_CR_ENA        BIT(0) >>   +/* TPDM integration test registers */ >> +#define TPDM_ITATBCNTRL        (0xEF0) >> +#define TPDM_ITCNTRL        (0xF00) >> + >> +/* Register value for integration test */ >> +#define ATBCNTRL_VAL_32        0xC00F1409 >> +#define ATBCNTRL_VAL_64        0xC01F1409 >> + >> +/* >> + * Number of cycles to write value when >> + * integration test. >> + */ >> +#define INTEGRATION_TEST_CYCLE    10 >> + >>   /** >>    * This enum is for PERIPHIDR0 register of TPDM. >>    * The fields [6:0] of PERIPHIDR0 are used to determine what > > _______________________________________________ > CoreSight mailing list -- coresight@lists.linaro.org > To unsubscribe send an email to coresight-leave@lists.linaro.org