Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3927618pxu; Mon, 30 Nov 2020 13:24:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlvFRD6Zfh9zlBr72OnA9iEUF3keMTPaDZFwH4cHYGUvLPHhljH28VLSWUc6tYQnsgSI69 X-Received: by 2002:aa7:cc19:: with SMTP id q25mr14793484edt.290.1606771455188; Mon, 30 Nov 2020 13:24:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606771455; cv=none; d=google.com; s=arc-20160816; b=hkcwP2fZQxNjqQUy/ZiFKLC2lzvKFrblnRWeZsasdrYCquLrfwtAYSV46jKXLd6RfH XIA5gFQ85WMXjo7iSOOhdEYeu3ftA83QF9YGAVuFBL8blNt7s2dzlVmUaJJsqsH/Sxow WueZf+GkRZuEq3o6HEa1LPkrST62gZ/rKE8G18Ol+dlUhJH79xI1eqCkeoXDTbyEpddk dHpyKA7sYTNiWUY+3KgfP2lWtE1g+NipcFBrfsDBDW+Juez+9r2YbwxUMpYIfq35UOrH 722L7Yhi5vMtN/aa70eL1tnfFCnYN6nvuPCZh8C92cVADv2WGol9Rx2yf1euXrq+oyc8 I3nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=R+fRkUoQp+Unl2rwWqZSXKuCttfMlLMAzbaR7xc5JoE=; b=UT3sd8frnU/AAk9AiWeoSAVV6nmhoi2+o4j8GkekSd2yfYhNihdU68fyXEHlBRtPUf Pn8wlM8xHrOBXVIo9+czCjMYB5UhrqqrrYKEqJBdNeI4BROHx88Ba/Qe/sWJhrfvEPOT rNOsjJXlr5aBfgdtLqXB0+2xFhoTPbLE3irUt32ZNsQC1GVTmEe2wLmKkYzmdBSgehfx Ja/471uG5Lb27IcQpN2EU7C+1xvda7GoNmslB32mtAOL12mqXs9+zAig7E342kK7vjwQ X5BssVjI6JZQGweN1aq1HCSvlby/akYhdFc/yqw+QAkG0OI1PKThXxgOQlqxdOELvB8G CkHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PYGaSkx+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ng3si7429017ejb.344.2020.11.30.13.23.51; Mon, 30 Nov 2020 13:24:15 -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; dkim=pass header.i=@linaro.org header.s=google header.b=PYGaSkx+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388546AbgK3VT5 (ORCPT + 99 others); Mon, 30 Nov 2020 16:19:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387645AbgK3VT5 (ORCPT ); Mon, 30 Nov 2020 16:19:57 -0500 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73851C0613D2 for ; Mon, 30 Nov 2020 13:19:11 -0800 (PST) Received: by mail-pj1-x1042.google.com with SMTP id r20so385358pjp.1 for ; Mon, 30 Nov 2020 13:19:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=R+fRkUoQp+Unl2rwWqZSXKuCttfMlLMAzbaR7xc5JoE=; b=PYGaSkx+R23+S+lfB9W0YiljksUoh0XjND8T8xEmQOGzwp2vDmPXxTepNqM2mD3qKX VcETzGLoSFrWbezZ22URw73NdNvN3Vja52iDl4wCJ0QP7ZTx1ylKVrEFx9p3jMZpdAJx 94IZDENfmbWw2JAI1acwWhgdVvFpbOt/qwxFL2lV6ya/A7J/HJcbrMZWSA6cDSG8uPCG djQQMFysUB4g35Wn/U2xQqL2XByKkm5+aFCZJ0svTQKJ4p0hziIMtXGjUT0WMijIRjEo UrH3TM8BpJ5M5kSZjrs5fGz884r4okKUZxG6R6f0VlGChYzvSoMT39nZryPFHGP+8CcZ k3WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=R+fRkUoQp+Unl2rwWqZSXKuCttfMlLMAzbaR7xc5JoE=; b=MXXEkIV5sTWGM0pV0Xnpl1E4Y+r1NjqwFhykEPUEhinrhP8uuTv9/saATeJw0p5xso Xs4fZscfFj/I0DKP8EWh+RAG/mptnNFgqRV2ZGkjtGNtaOgVjBMafqSl8i3xV3QKFElz 2eRGguNbLIM2SGRh9GAj3/ueZODbQ1Z+bxF9ETii8e8hHPiGmky4T3WyKQarfcLm2BU+ IWUbMn4PuUwI3YYZiRTALAnoH2EXdfQ949e2RwP3Avx+kKmPFecpcemI5x8eMnY70SeF 9kWLLCqfxiPjag6Sxn9h8BY3TblUvkVDCEjRECpTlOROJHwYNlE6ee5b8NSpJ3uwRX0H 9U8A== X-Gm-Message-State: AOAM531xlduDENcD8n9Vgtx+q8gJe6Spgsp4FkrWZyvScsONXi0owNfS AUNYbHa/D4SHuUQzBGxQvdg3Vw== X-Received: by 2002:a17:902:6acc:b029:d8:c6ee:6d6c with SMTP id i12-20020a1709026accb02900d8c6ee6d6cmr20684450plt.7.1606771150937; Mon, 30 Nov 2020 13:19:10 -0800 (PST) Received: from xps15 (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id gp14sm400005pjb.6.2020.11.30.13.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2020 13:19:10 -0800 (PST) Date: Mon, 30 Nov 2020 14:19:08 -0700 From: Mathieu Poirier To: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org, linux-kernel@vger.kernel.org, anshuman.khandual@arm.com, jonathan.zhouwen@huawei.com, coresight@lists.linaro.org Subject: Re: [PATCH v4 11/25] coresight: etm4x: Define DEVARCH register fields Message-ID: <20201130211908.GG1092947@xps15> References: <20201119164547.2982871-1-suzuki.poulose@arm.com> <20201119164547.2982871-12-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201119164547.2982871-12-suzuki.poulose@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 19, 2020 at 04:45:33PM +0000, Suzuki K Poulose wrote: > 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(-) Reviewed-by: Mathieu Poirier > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c > index c2499b62e64e..6f776f075602 100644 > --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c > +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c > @@ -1622,8 +1622,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 6591a59c1012..d8f047547a36 100644 > --- a/drivers/hwtracing/coresight/coresight-etm4x.h > +++ b/drivers/hwtracing/coresight/coresight-etm4x.h > @@ -498,6 +498,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 >