Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp295525pxx; Thu, 29 Oct 2020 02:53:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGVveJEmuY8dfEXYUy6Ifiu889vRhFTlbG6e83Qi5F2EG/hyMiIej4zhZsHOjO2aLWhNCb X-Received: by 2002:a50:ed90:: with SMTP id h16mr675299edr.255.1603965216509; Thu, 29 Oct 2020 02:53:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603965216; cv=none; d=google.com; s=arc-20160816; b=mnwsYBsV6/xhWztodkK88I20+B8eg7Zh/GS0YBIKfI6S/YBtf6qO5PK08yFVCcbBFX OypWuvF0X5Fq9fzxNnXayqt8v9ZZixyQzzT4KL3LMEHnN+DBZL0Ho5tyTviB82CLE5qi ajp21zHo6S92yZGQdVyQ7icdRpVLpBfY8CBRXtfuMhSRUiviAUsx/9iOMSjx8wtG+92D pvH7OquvONyhpy9EpkF6xM32iLm3MnAKfUiolFnMyVaZ7ohRMQSxRnrA1b+URj8w5KDo hNuNcSF6oEKGHG+pyllZ6LHoguZ9/5ZCcGEBa8l1sxBSAeapHdrIj7ayobflhP+o6UbW KQWw== 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=vXfAVQH3swBvXdz0rirL7Te1A6kpUSoE83XKygzp7QU=; b=kjMZLiCNmdjPXuP/4fF4vot1kW5FW3GUOrDYVkRRvfxPaHPVaIQGc/eIXgj65m2jSH Ia/F6HQiWEDl82Z+PO6/gLZhzhb/Or/vxcYLFAT428HrulQYOa4xFXA8KS9bMkdEb/RT npZkPwulX6xGjZP/hBgEvGapTRiykhjlcZLfR5LFFS9eAo9A/eLkBrvuYBAOu6x4l4/A NINSoVvWRJaqBScYTwLv6RozQ41vsfOq9UqgVtjv/mZvjnTGKIZ+pa3jbzm7ecfg0uzk xmXuBLPrKnXYhKNEto+7Zasb8qh3gmlVDkIo5wDShs/f6a3eX4dNj/sHd9jnoqBf7qcj aLuA== 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 pw16si1459909ejb.430.2020.10.29.02.53.13; Thu, 29 Oct 2020 02:53:36 -0700 (PDT) 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 S1730495AbgJ1WKT (ORCPT + 99 others); Wed, 28 Oct 2020 18:10:19 -0400 Received: from foss.arm.com ([217.140.110.172]:39132 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730488AbgJ1WKS (ORCPT ); Wed, 28 Oct 2020 18:10:18 -0400 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 BC502176B; Wed, 28 Oct 2020 15:10:17 -0700 (PDT) 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 C96573F73C; Wed, 28 Oct 2020 15:10:16 -0700 (PDT) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: mathieu.poirier@linaro.org, mike.leach@linaro.org, coresight@lists.linaro.org, linux-kernel@vger.kernel.org, Suzuki K Poulose Subject: [PATCH v3 15/26] coresight: etm4x: Define DEVARCH register fields Date: Wed, 28 Oct 2020 22:09:34 +0000 Message-Id: <20201028220945.3826358-17-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20201028220945.3826358-1-suzuki.poulose@arm.com> References: <20201028220945.3826358-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 Define the fields of the DEVARCH register for identifying a component as an ETMv4.x unit. Going forward, we use the DEVARCH register for the component identification, rather than the TRCIDR3. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- .../coresight/coresight-etm4x-core.c | 4 +- drivers/hwtracing/coresight/coresight-etm4x.h | 42 +++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index 90b80982c615..a5c914b16e59 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -1610,8 +1610,8 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) static struct amba_cs_uci_id uci_id_etm4[] = { { /* ETMv4 UCI data */ - .devarch = 0x47704a13, - .devarch_mask = 0xfff0ffff, + .devarch = ETM_DEVARCH_ETMv4x_ARCH, + .devarch_mask = ETM_DEVARCH_ID_MASK, .devtype = 0x00000013, } }; diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h index 5cf71b30a652..e7f6b7b16fb7 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.h +++ b/drivers/hwtracing/coresight/coresight-etm4x.h @@ -497,6 +497,48 @@ ETM_MODE_EXCL_KERN | \ ETM_MODE_EXCL_USER) +/* + * TRCDEVARCH Bit field definitions + * Bits[31:21] - ARCHITECT = Always Arm Ltd. + * * Bits[31:28] = 0x4 + * * Bits[27:21] = 0b0111011 + * Bit[20] - PRESENT, Indicates the presence of this register. + * + * Bit[19:16] - REVISION, Revision of the architecture. + * + * Bit[15:0] - ARCHID, Identifies this component as an ETM + * * Bits[15:12] - architecture version of ETM + * * = 4 for ETMv4 + * * Bits[11:0] = 0xA13, architecture part number for ETM. + */ +#define ETM_DEVARCH_ARCHITECT_MASK GENMASK(31, 21) +#define ETM_DEVARCH_ARCHITECT_ARM ((0x4 << 28) | (0b0111011 << 21)) +#define ETM_DEVARCH_PRESENT BIT(20) +#define ETM_DEVARCH_REVISION_SHIFT 16 +#define ETM_DEVARCH_REVISION_MASK GENMASK(19, 16) +#define ETM_DEVARCH_REVISION(x) \ + (((x) & ETM_DEVARCH_REVISION_MASK) >> ETM_DEVARCH_REVISION_SHIFT) +#define ETM_DEVARCH_ARCHID_MASK GENMASK(15, 0) +#define ETM_DEVARCH_ARCHID_ARCH_VER_SHIFT 12 +#define ETM_DEVARCH_ARCHID_ARCH_VER_MASK GENMASK(15, 12) +#define ETM_DEVARCH_ARCHID_ARCH_VER(x) \ + (((x) & ETM_DEVARCH_ARCHID_ARCH_VER_MASK) >> ETM_DEVARCH_ARCHID_ARCH_VER_SHIFT) + +#define ETM_DEVARCH_MAKE_ARCHID_ARCH_VER(ver) \ + (((ver) << ETM_DEVARCH_ARCHID_ARCH_VER_SHIFT) & ETM_DEVARCH_ARCHID_ARCH_VER_MASK) + +#define ETM_DEVARCH_ARCHID_ARCH_PART(x) ((x) & 0xfffUL) + +#define ETM_DEVARCH_MAKE_ARCHID(major) \ + ((ETM_DEVARCH_MAKE_ARCHID_ARCH_VER(major)) | ETM_DEVARCH_ARCHID_ARCH_PART(0xA13)) + +#define ETM_DEVARCH_ARCHID_ETMv4x ETM_DEVARCH_MAKE_ARCHID(0x4) + +#define ETM_DEVARCH_ID_MASK \ + (ETM_DEVARCH_ARCHITECT_MASK | ETM_DEVARCH_ARCHID_MASK | ETM_DEVARCH_PRESENT) +#define ETM_DEVARCH_ETMv4x_ARCH \ + (ETM_DEVARCH_ARCHITECT_ARM | ETM_DEVARCH_ARCHID_ETMv4x | ETM_DEVARCH_PRESENT) + #define TRCSTATR_IDLE_BIT 0 #define TRCSTATR_PMSTABLE_BIT 1 #define ETM_DEFAULT_ADDR_COMP 0 -- 2.24.1