From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751103AbdGYJfz (ORCPT ); Tue, 25 Jul 2017 05:35:55 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:43424 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750828AbdGYJfy (ORCPT ); Tue, 25 Jul 2017 05:35:54 -0400 Subject: Re: [PATCH v5 18/19] coresight tmc: Add support for Coresight SoC 600 TMC To: Mathieu Poirier References: <1500545849-23724-1-git-send-email-suzuki.poulose@arm.com> <1500545849-23724-19-git-send-email-suzuki.poulose@arm.com> Cc: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Mike Leach From: Suzuki K Poulose Message-ID: <027be70e-d5ff-c0ac-7c85-fcabd5c56628@arm.com> Date: Tue, 25 Jul 2017 10:35:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/07/17 18:12, Mathieu Poirier wrote: > On 20 July 2017 at 04:17, Suzuki K Poulose wrote: >> The coresight SoC 600 supports ETR save-restore which allows us >> to restore a trace session by retaining the RRP/RWP/STS.Full values >> when the TMC leaves the Disabled state. However, the TMC doesn't >> have a scatter-gather unit in built. >> >> Also, TMCs have different PIDs in different configurations (ETF, >> ETB & ETR), unlike the previous generation. >> >> While the DEVID exposes some of the features/changes in the TMC, >> it doesn't explicitly advertises the new save-restore feature >> as described above. >> >> Cc: Mathieu Poirier >> Signed-off-by: Suzuki K Poulose >> --- >> drivers/hwtracing/coresight/coresight-tmc.c | 16 ++++++++++++++++ >> drivers/hwtracing/coresight/coresight-tmc.h | 4 ++++ >> 2 files changed, 20 insertions(+) >> >> diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c >> index c4a5dea..e754a3e 100644 >> --- a/drivers/hwtracing/coresight/coresight-tmc.c >> +++ b/drivers/hwtracing/coresight/coresight-tmc.c >> @@ -442,6 +442,22 @@ static struct amba_id tmc_ids[] = { >> .id = 0x000bb961, >> .mask = 0x000fffff, >> }, >> + { >> + /* Coresight SoC 600 TMC-ETR/ETS */ >> + .id = 0x000bb9e8, >> + .mask = 0x000fffff, >> + .data = (void *)(unsigned long)CORESIGHT_SOC_600_ETR_CAPS, > > It the casting to unsigned long mandatory? Yes. Given the ETR caps is u32, we don't want a trouble with little/big endian switch. Also, it keeps the compiler happy when you upsize an integer to a pointer directly. e.g: $ cat cast.c int main(void) { void *ptr; int a; ptr = (void *)a; return 0; } Compiler warns: cc cast.c -o cast cast.c: In function ‘main’: cast.c:5:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] ptr = (void *)a; ^ Cheers Suzuki