Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2209583pxm; Fri, 4 Mar 2022 11:25:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzueSEW6gy5zvT30c7fn5D3loaPhVGk29PTBzzDTrFmspCZRZVbNo3d9aNdGEtp4ZK9+Kli X-Received: by 2002:a62:fb0d:0:b0:4f1:a584:71f with SMTP id x13-20020a62fb0d000000b004f1a584071fmr168220pfm.2.1646421950120; Fri, 04 Mar 2022 11:25:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646421950; cv=none; d=google.com; s=arc-20160816; b=Ct8RetSsBJ4ktzc8m0FW4xdXLBxrs+JiPl0qUbngH7k+6XxjzOkK08YVymNEkvo6tf aFkXH9KykM97uxKccapTo6lUdxaGW4X0KDcx4WBNDM9009BkG3YcJ9L0PglZ6RTA9IVJ JI1V6GhdBxIfmJMYYax5xN1fXT2Ht7aEGQbkYyu6BWYhAiI267bqm9kl5z/cw5v/48kr 1ne8sl7IktftB248HFtp5nkJWdSbzhlRWRsO3e4PHMrhYUMtbVsRca/LDeanjQ1nhz/T Eqo8EnbodWiZw9lEqAYMI3owApSRI5aEvyMPwfatpgjG5ihxtj6zp+/AwuYMCgu/dHDx i8qA== 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 :message-id:date:subject:cc:to:from; bh=oqLPJiNoIF742Ye2ogASIO4ascNL67NIvRyBpj9ZLLA=; b=n6LYobYoRkA/rVxSdz0MiS2d9OvhjOeitpMRuEQ7z8ODWbmzZCMWp2SnNmDv3dYvXy P0J5tUvCixHSIB7JqwdbUj7ZmIGWu/CmGZDRWc7LexP1WYQA/TY0onozEZGuO8limbI0 KIVK9UTJ+nQpaYNhSaUY53Kz/FB0bHIbqJ+jcHumv1XIcIgcD32+wAsU4oOm9vWmfb8H 4OdT7csudHhPzeR/xjdg0946mzimR1bDCDqb5kwYzcgtCgerhDFFh2WvxGI9pbEeinvO stMjZq7y5qjZFKUfv4JXzEXxp4wBhN2+A3J+UnZnp6AFibMrWni+h2NJrvD8G+dFmc3J 9mHg== 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 k5-20020a654645000000b00378c9e5630bsi5490609pgr.555.2022.03.04.11.25.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 11:25:50 -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 1D87720B3BC; Fri, 4 Mar 2022 11:10:35 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240975AbiCDRUM (ORCPT + 99 others); Fri, 4 Mar 2022 12:20:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237373AbiCDRUK (ORCPT ); Fri, 4 Mar 2022 12:20:10 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EF7221480C9 for ; Fri, 4 Mar 2022 09:19:21 -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 AF1971424; Fri, 4 Mar 2022 09:19:21 -0800 (PST) Received: from e121896.arm.com (unknown [10.57.42.166]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1308B3F73D; Fri, 4 Mar 2022 09:19:19 -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 00/15] Make ETM register accesses consistent with sysreg.h Date: Fri, 4 Mar 2022 17:18:57 +0000 Message-Id: <20220304171913.2292458-1-james.clark@arm.com> X-Mailer: git-send-email 2.28.0 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 Changes since v2: * Implement Mike's suggestion of not having _SHIFT and using the existing FIELD_GET and FIELD_PREP methods. * Dropped the change to add the new REG_VAL macro because of the above. * FIELD_PREP could be used in some trivial cases, but in some cases the shift is still required but can be calculated with __bf_shf * Improved the commit messages. * The change is still binary equivalent, but requires an extra step mentioned at the end of this cover letter. Applies to coresight/next 3619ee28488 Also available at https://gitlab.arm.com/linux-arm/linux-jc/-/tree/james-cs-register-refactor-v3 To check for binary equivalence follow the same steps in the cover letter of v2, but apply the following change to coresight-priv.h. This is because the existing version of the macros wrap the expression in a new scope {} that flips something in the compiler: #undef FIELD_GET #define FIELD_GET(_mask, _reg) (((_reg) & (_mask)) >> __bf_shf(_mask)) #undef FIELD_PREP #define FIELD_PREP(_mask, _val) (((_val) << __bf_shf(_mask)) & (_mask)) Thanks James James Clark (15): coresight: etm4x: Cleanup TRCIDR0 register accesses coresight: etm4x: Cleanup TRCIDR2 register accesses coresight: etm4x: Cleanup TRCIDR3 register accesses coresight: etm4x: Cleanup TRCIDR4 register accesses coresight: etm4x: Cleanup TRCIDR5 register accesses coresight: etm4x: Cleanup TRCCONFIGR register accesses coresight: etm4x: Cleanup TRCEVENTCTL1R register accesses coresight: etm4x: Cleanup TRCSTALLCTLR register accesses coresight: etm4x: Cleanup TRCVICTLR register accesses coresight: etm3x: Cleanup ETMTECR1 register accesses coresight: etm4x: Cleanup TRCACATRn register accesses coresight: etm4x: Cleanup TRCSSCCRn and TRCSSCSRn register accesses coresight: etm4x: Cleanup TRCSSPCICRn register accesses coresight: etm4x: Cleanup TRCBBCTLR register accesses coresight: etm4x: Cleanup TRCRSCTLRn register accesses .../coresight/coresight-etm3x-core.c | 2 +- .../coresight/coresight-etm3x-sysfs.c | 2 +- .../coresight/coresight-etm4x-core.c | 136 +++++-------- .../coresight/coresight-etm4x-sysfs.c | 180 +++++++++--------- drivers/hwtracing/coresight/coresight-etm4x.h | 122 ++++++++++-- 5 files changed, 244 insertions(+), 198 deletions(-) -- 2.28.0