Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp269490pxu; Thu, 7 Jan 2021 04:42:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwMHjlEoorr+Ew+RAZ/pMPJasff8CNbOKHmuyhvYMSgJyMl9bUFoK2ufXgGkvRMhBMWu4Ss X-Received: by 2002:a05:6402:104e:: with SMTP id e14mr1599131edu.316.1610023376534; Thu, 07 Jan 2021 04:42:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610023376; cv=none; d=google.com; s=arc-20160816; b=YYKwGHsKrhcqYncjoJPWtK6ZxdOexLYt3qvC+gx9PS4M3eAKbeXjSWAqFC5srYnknx IsYwUKDWIpSMNadg1wDbC13yGHLJZ8AVuL8/jI8CXugpH+WKzRCyrNh3WWm2P6ryqEhu VJMs8D/haRTlI/xEGBc7mRqC5K1fWU2S58hY6pQGEAjCj3V+Ga7I165nM5IT19oyuz6M s8JP9wAditw0kIg4Q2kAs+z8q5gLoyk3gNRQwqNxY66B5M5E4RHa+eBejP/zVcg0bB16 64kY2Kr4SVCtu+zUPcGiFnZn2vIwYyNQA4HMY0gBL8TyhtutdoJ5ZZwKH4yGwLG9LWEx ZJ3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=OE34xg/ACP4NM93bIfLP4IRqhNGm84y1Er/0K5pcH3M=; b=mOrN0+KpLpQS1TBJymPcX009cDM1zNIRydxO+RATp6OILYaRGeKs4nZQsmseXJs5+I h9Hed3eZXWsIPczolZ3QrOzRwXGz5qOGFAJkI+6ydm8fcZiTAo+38skSfQgRYpx80shB h+hhjvyg1CkA3fbvYXnTyB0JDcYZB1/dfRGrPqIaDtz6BA/IC6Jyea6gGW0hpmk27mZv MC9nn+zUHsXkQdlthAZisNYtq5wv0F69cdmYpK85EMQJu3O+h67U7ZeqT8HhkHKcgwba QluUMNBRTNB3EhES3qkVsOr1E38qaDVAfqXhbHgyolLsHzQBIVULlwWQgG+hebBb8wap xNMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u22si2180495ejt.406.2021.01.07.04.42.32; Thu, 07 Jan 2021 04:42:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728479AbhAGMlJ (ORCPT + 99 others); Thu, 7 Jan 2021 07:41:09 -0500 Received: from foss.arm.com ([217.140.110.172]:59932 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728297AbhAGMlI (ORCPT ); Thu, 7 Jan 2021 07:41:08 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CAE8F1500; Thu, 7 Jan 2021 04:39:38 -0800 (PST) Received: from ewhatever.cambridge.arm.com (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B0ED53F719; Thu, 7 Jan 2021 04:39:37 -0800 (PST) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, coresight@lists.linaro.org, mathieu.poirier@linaro.org, leo.yan@linaro.org, mike.leach@linaro.org, anshuman.khandual@arm.com, Suzuki K Poulose Subject: [PATCH v6 18/26] coresight: etm4x: Expose trcdevarch via sysfs Date: Thu, 7 Jan 2021 12:38:51 +0000 Message-Id: <20210107123859.674252-19-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20210107123859.674252-1-suzuki.poulose@arm.com> References: <20210107123859.674252-1-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Expose the TRCDEVARCH register via the sysfs for component detection. Given that the TRCIDR1 may not completely identify the ETM component and instead need to use TRCDEVARCH, expose this via sysfs for tools to use it for identification. Cc: Mike Leach Reviewed-by: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- Changes since v5: - Move the trcdevarch to mgmt/ instead of the trcidr (Mike L) - Add sysfs documentation for the new register (Mike L) --- .../ABI/testing/sysfs-bus-coresight-devices-etm4x | 8 ++++++++ drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-coresight-devices-etm4x b/Documentation/ABI/testing/sysfs-bus-coresight-devices-etm4x index 881f0cd99ce4..8e53a32f8150 100644 --- a/Documentation/ABI/testing/sysfs-bus-coresight-devices-etm4x +++ b/Documentation/ABI/testing/sysfs-bus-coresight-devices-etm4x @@ -371,6 +371,14 @@ Contact: Mathieu Poirier Description: (Read) Print the content of the Device ID Register (0xFC8). The value is taken directly from the HW. +What: /sys/bus/coresight/devices/etm/mgmt/trcdevarch +Date: January 2021 +KernelVersion: 5.12 +Contact: Mathieu Poirier +Description: (Read) Print the content of the Device Architecture Register + (offset 0xFBC). The value is taken directly read + from the HW. + What: /sys/bus/coresight/devices/etm/mgmt/trcdevtype Date: April 2015 KernelVersion: 4.01 diff --git a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c index 009818675928..b590b042dca3 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c @@ -2357,6 +2357,7 @@ coresight_etm4x_cross_read(trclsr, TRCLSR); coresight_etm4x_cross_read(trcauthstatus, TRCAUTHSTATUS); coresight_etm4x_cross_read(trcdevid, TRCDEVID); coresight_etm4x_cross_read(trcdevtype, TRCDEVTYPE); +coresight_etm4x_cross_read(trcdevarch, TRCDEVARCH); coresight_etm4x_cross_read(trcpidr0, TRCPIDR0); coresight_etm4x_cross_read(trcpidr1, TRCPIDR1); coresight_etm4x_cross_read(trcpidr2, TRCPIDR2); @@ -2375,6 +2376,7 @@ static struct attribute *coresight_etmv4_mgmt_attrs[] = { &dev_attr_trcauthstatus.attr, &dev_attr_trcdevid.attr, &dev_attr_trcdevtype.attr, + &dev_attr_trcdevarch.attr, &dev_attr_trcpidr0.attr, &dev_attr_trcpidr1.attr, &dev_attr_trcpidr2.attr, -- 2.24.1