Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2266766pxm; Fri, 4 Mar 2022 12:42:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJykRZfLSu8trM+C1JsQ6pi/Imo1vlTgs0614RzWA2I8/U8p5Aohm7pnXxUqNLZx8kjKxF/R X-Received: by 2002:a17:903:24e:b0:151:9fa5:ebdd with SMTP id j14-20020a170903024e00b001519fa5ebddmr159155plh.84.1646426525782; Fri, 04 Mar 2022 12:42:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646426525; cv=none; d=google.com; s=arc-20160816; b=Rfy0qiCaiTFbD9+Aa+CKkWLE+1bVI99PbpKohfUskpTzJI7GnMOtH6lz1KfKCwKDF2 DO6KtFkEt60ahkH/eqU89csvE4m/3n0RaWzjKYXAHCVkIywgsuX2MicjOndwEYcRSRJy 2jlK/8BUwuVyY5pIxQQC2d9zmOUMhzfij+wLB3iJLmOz+qjlasqJ2ju009YX4AXfQrGj WNinZKDG9kY0p/fVEBeJYu0zkgVk8ZukcMjc2FPwMGxawMnyMAK00GpPeEFKNCgH8MfM nlPLhUXFZ9oq1/UsSFsUkfAoUsW1begffKQ1yiQ5acNY5S+qhPi36pix2WcBINlNxvor OZkw== 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=yUPsDtZ1SI5AqVj5Ic1qWZGxn8DiG0jpzCs/s6UDfpU=; b=BXddP9QPQJ8ZiZz9zvYpl8hjmqC1/67JmK4dQ4jTNrJJQhw1V9/8lpoHq9UB/TSChe 3F2xngV+d2/8xycIfvR4RuyNwlTeVlmoVUYPweJPuvQDHm7+b9R+HWqgZ5fWbK/foCdZ 3a9xL+VJONFBfLswViTeuRYuqTG4Xtl14mC4JPeeIv5BNrg/diIl1UjhWw/8k//4p0dz ZZrmR/6h9O1cB7RCGNI+Qx2ZpcZHrtpu6Fex9igoIaNX4elljT/jhMn92IzCsPJKsfME QiKg94pOyDQk0M/rPs8nE6syamjZCseEungEsQdxoL2WDaRKKtWYgwQt0qx3RJgzQZhr YItQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b2-20020a656682000000b00379066bb4b1si5941092pgw.36.2022.03.04.12.42.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 12:42:05 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 792362F3116; Fri, 4 Mar 2022 11:41:56 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241002AbiCDRUW (ORCPT + 99 others); Fri, 4 Mar 2022 12:20:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240991AbiCDRUP (ORCPT ); Fri, 4 Mar 2022 12:20:15 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3DDDE14CDA3 for ; Fri, 4 Mar 2022 09:19:27 -0800 (PST) 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 0BCDD14BF; Fri, 4 Mar 2022 09:19:27 -0800 (PST) Received: from e121896.arm.com (unknown [10.57.42.166]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6965C3F73D; Fri, 4 Mar 2022 09:19:25 -0800 (PST) From: James Clark To: suzuki.poulose@arm.com, coresight@lists.linaro.org, mike.leach@linaro.org, anshuman.khandual@arm.com Cc: mathieu.poirier@linaro.org, leo.yan@linaro.com, James Clark , Leo Yan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 02/15] coresight: etm4x: Cleanup TRCIDR2 register accesses Date: Fri, 4 Mar 2022 17:18:59 +0000 Message-Id: <20220304171913.2292458-3-james.clark@arm.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20220304171913.2292458-1-james.clark@arm.com> References: <20220304171913.2292458-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 This is a no-op change for style and consistency and has no effect on the binary output by the compiler. In sysreg.h fields are defined as the register name followed by the field name and then _MASK. This allows for grepping for fields by name rather than using magic numbers. Signed-off-by: James Clark --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 6 +++--- drivers/hwtracing/coresight/coresight-etm4x.h | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index 9120390a7613..fd44231e9d8a 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -1116,11 +1116,11 @@ static void etm4_init_arch_data(void *info) /* maximum size of resources */ etmidr2 = etm4x_relaxed_read32(csa, TRCIDR2); /* CIDSIZE, bits[9:5] Indicates the Context ID size */ - drvdata->ctxid_size = BMVAL(etmidr2, 5, 9); + drvdata->ctxid_size = FIELD_GET(TRCIDR2_CIDSIZE_MASK, etmidr2); /* VMIDSIZE, bits[14:10] Indicates the VMID size */ - drvdata->vmid_size = BMVAL(etmidr2, 10, 14); + drvdata->vmid_size = FIELD_GET(TRCIDR2_VMIDSIZE_MASK, etmidr2); /* CCSIZE, bits[28:25] size of the cycle counter in bits minus 12 */ - drvdata->ccsize = BMVAL(etmidr2, 25, 28); + drvdata->ccsize = FIELD_GET(TRCIDR2_CCSIZE_MASK, etmidr2); etmidr3 = etm4x_relaxed_read32(csa, TRCIDR3); /* CCITMIN, bits[11:0] minimum threshold value that can be programmed */ diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h index 300741fbc0de..cfdf966016b7 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.h +++ b/drivers/hwtracing/coresight/coresight-etm4x.h @@ -143,6 +143,10 @@ #define TRCIDR0_QSUPP_MASK GENMASK(16, 15) #define TRCIDR0_TSSIZE_MASK GENMASK(28, 24) +#define TRCIDR2_CIDSIZE_MASK GENMASK(9, 5) +#define TRCIDR2_VMIDSIZE_MASK GENMASK(14, 10) +#define TRCIDR2_CCSIZE_MASK GENMASK(28, 25) + /* * System instructions to access ETM registers. * See ETMv4.4 spec ARM IHI0064F section 4.3.6 System instructions -- 2.28.0