Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 138B6C7618D for ; Mon, 20 Mar 2023 10:38:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230523AbjCTKi2 (ORCPT ); Mon, 20 Mar 2023 06:38:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230376AbjCTKiB (ORCPT ); Mon, 20 Mar 2023 06:38:01 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EF0B3EB6B; Mon, 20 Mar 2023 03:37:16 -0700 (PDT) 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 9C7DDFEC; Mon, 20 Mar 2023 03:37:58 -0700 (PDT) Received: from [10.57.53.93] (unknown [10.57.53.93]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 03C043F67D; Mon, 20 Mar 2023 03:37:11 -0700 (PDT) Message-ID: Date: Mon, 20 Mar 2023 10:37:10 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH 6/7] of/platform: Skip coresight etm4x devices from AMBA bus To: Rob Herring Cc: Anshuman Khandual , linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, scclevenger@os.amperecomputing.com, Frank Rowand , Russell King , Greg Kroah-Hartman , "Rafael J. Wysocki" , Len Brown , Sudeep Holla , Lorenzo Pieralisi , Mathieu Poirier , Mike Leach , Leo Yan , devicetree@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230317030501.1811905-1-anshuman.khandual@arm.com> <20230317030501.1811905-7-anshuman.khandual@arm.com> From: Suzuki K Poulose In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/03/2023 20:06, Rob Herring wrote: > On Fri, Mar 17, 2023 at 11:03 AM Suzuki K Poulose > wrote: >> >> Hi Rob >> >> Thanks for your response. >> >> On 17/03/2023 14:52, Rob Herring wrote: >>> On Thu, Mar 16, 2023 at 10:06 PM Anshuman Khandual >>> wrote: >>>> >>>> Allow other drivers to claim a device, disregarding the "priority" of >>>> "arm,primecell". e.g., CoreSight ETM4x devices could be accessed via MMIO >>>> (AMBA Bus) or via CPU system instructions. >>> >>> The OS can pick which one, use both, or this is a system integration >>> time decision? >> >> Not an OS choice. Historically, this has always been MMIO accessed but >> with v8.4 TraceFiltering support, CPUs are encouraged to use system >> instructions and obsolete MMIO. So, yes, MMIO is still possible but >> something that is discouraged and have to be decided at system >> integration time. >> >>> >>>> The CoreSight ETM4x platform >>>> driver can now handle both types of devices. In order to make sure the >>>> driver gets to handle the "MMIO based" devices, which always had the >>>> "arm,primecell" compatible, we have two options : >>>> >>>> 1) Remove the "arm,primecell" from the DTS. But this may be problematic >>>> for an older kernel without the support. >>>> >>>> 2) The other option is to allow OF code to "ignore" the arm,primecell >>>> priority for a selected list of compatibles. This would make sure that >>>> both older kernels and the new kernels work fine without breaking >>>> the functionality. The new DTS could always have the "arm,primecell" >>>> removed. >>> >>> 3) Drop patches 6 and 7 and just register as both AMBA and platform >>> drivers. It's just some extra boilerplate. I would also do different >>> compatible strings for CPU system instruction version (assuming this >>> is an integration time decision). >> >> The system instruction (and the reigster layouts) are all part of the >> ETMv4/ETE architecture and specific capabilities/features are >> discoverable, just like the Arm CPUs. Thus we don't need special >> versions within the ETMv4x or ETE minor versions. As of now, we have >> one for etm4x and another for ete. > > I just meant 2 new compatible strings. One each for ETMv4x and ETE, > but different from the 2 existing ones. It is different h/w presented > to the OS, so different compatible. > Sorry, was not very clear here. Right now, we have : 1) arm,coresight-etm4x && arm,primecell - For AMBA based devices 2) arm,coresight-etm4x-sysreg - For system instruction based 3) arm,embedded-trace-extension - For ETE >> One problem with the AMBA driver in place is having to keep on adding >> new PIDs for the CPUs. The other option is to have a blanket mask >> for matching the PIDs with AMBA_UCI_ID checks. > > But if MMIO access is discouraged, then new h/w would use the platform > driver(s), not the amba driver, and you won't have to add PIDs. Yes for v8.4 onwards. Alternatively, the newer DTS could skip arm,primecell in the entry and that would kick the platform driver in. So, that should be fine I guess. Kind regards Suzuki > > Rob