From patchwork Thu Apr 6 13:30:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 96971 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp732847obc; Thu, 6 Apr 2017 06:32:04 -0700 (PDT) X-Received: by 10.98.218.73 with SMTP id w9mr36416899pfl.100.1491485524027; Thu, 06 Apr 2017 06:32:04 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j71si1865425pgd.347.2017.04.06.06.32.03; Thu, 06 Apr 2017 06:32:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934599AbdDFNcC (ORCPT + 9 others); Thu, 6 Apr 2017 09:32:02 -0400 Received: from mail-pg0-f49.google.com ([74.125.83.49]:34513 "EHLO mail-pg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934749AbdDFNb6 (ORCPT ); Thu, 6 Apr 2017 09:31:58 -0400 Received: by mail-pg0-f49.google.com with SMTP id 21so36649468pgg.1 for ; Thu, 06 Apr 2017 06:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TCzWnzJHkW2SFRPz4eiJs5qhJ0x1GgU4cRW9E8ItAJo=; b=D3ePKHRHV8rweUc1iVIX5PyIzfXazY20BeD2FhN+2txWU8aqdlop+EMztS5QWxB8OU RlkrtFPDZi76WtUWtBeXlwugwXaw0+NjGq3w438v+yQpN/7GXeqwH7k9nR86/owuyn7x wnig+lD/Audi49SJcL8KMjNiGMTfUoAOepoVk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TCzWnzJHkW2SFRPz4eiJs5qhJ0x1GgU4cRW9E8ItAJo=; b=YcqH1NCAvB1r8c2V+OOVtI1fr4BWg1b2n3AeT13qGDrpOvO7nrHh7Qw542RvOid2tQ 0TG5ct/uhNdQa+fWCpRZmeesvfG+9R9QPVZ9+SCpgWga5TgJhSQ141YsZrzlMsY8X+bt S3D7+059+JD2g6oKomnKQVgY75LL3YqqCaFnxn/FegQUB2AwjMNy5ARvRCtYFgJf52MX qbPezuzu0o8U7F78ns8sVx8ZiyCazM36MyjryvIDkQPHVmLXAD6xBL3F9B7SBodQuIsM GSpLdEkmG3a8hpYetgFJ2AYMZ1CF+7oHg+7+1NW9cIvkPnH0wov5rnZ2y2iTDPoDFjOR duEg== X-Gm-Message-State: AFeK/H3nCL5uNYU7xASD04h7J+rOBCCKOW28PtKCn7brL1qSUOXKw/1T+Dd/jG25yxg2lHgs X-Received: by 10.98.76.140 with SMTP id e12mr34817832pfj.82.1491485517591; Thu, 06 Apr 2017 06:31:57 -0700 (PDT) Received: from localhost.localdomain (li1627-128.members.linode.com. [172.104.47.128]) by smtp.gmail.com with ESMTPSA id 129sm4074223pgj.59.2017.04.06.06.31.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Apr 2017 06:31:56 -0700 (PDT) From: Leo Yan To: Jonathan Corbet , Rob Herring , Mark Rutland , Wei Xu , Catalin Marinas , Will Deacon , Andy Gross , David Brown , Mathieu Poirier , Suzuki K Poulose , Stephen Boyd , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, Mike Leach , Sudeep Holla Cc: Leo Yan Subject: [PATCH v6 1/8] coresight: bindings for CPU debug module Date: Thu, 6 Apr 2017 21:30:54 +0800 Message-Id: <1491485461-22800-2-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491485461-22800-1-git-send-email-leo.yan@linaro.org> References: <1491485461-22800-1-git-send-email-leo.yan@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org According to ARMv8 architecture reference manual (ARM DDI 0487A.k) Chapter 'Part H: External debug', the CPU can integrate debug module and it can support self-hosted debug and external debug. Especially for supporting self-hosted debug, this means the program can access the debug module from mmio region; and usually the mmio region is integrated with coresight. So add document for binding debug component, includes binding to APB clock; and also need specify the CPU node which the debug module is dedicated to specific CPU. Suggested-by: Mike Leach Reviewed-by: Mathieu Poirier Reviewed-by: Suzuki K Poulose Acked-by: Rob Herring Signed-off-by: Leo Yan --- .../bindings/arm/coresight-cpu-debug.txt | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/coresight-cpu-debug.txt -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/arm/coresight-cpu-debug.txt b/Documentation/devicetree/bindings/arm/coresight-cpu-debug.txt new file mode 100644 index 0000000..2982912 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/coresight-cpu-debug.txt @@ -0,0 +1,49 @@ +* CoreSight CPU Debug Component: + +CoreSight CPU debug component are compliant with the ARMv8 architecture +reference manual (ARM DDI 0487A.k) Chapter 'Part H: External debug'. The +external debug module is mainly used for two modes: self-hosted debug and +external debug, and it can be accessed from mmio region from Coresight +and eventually the debug module connects with CPU for debugging. And the +debug module provides sample-based profiling extension, which can be used +to sample CPU program counter, secure state and exception level, etc; +usually every CPU has one dedicated debug module to be connected. + +Required properties: + +- compatible : should be "arm,coresight-cpu-debug"; supplemented with + "arm,primecell" since this driver is using the AMBA bus + interface. + +- reg : physical base address and length of the register set. + +- clocks : the clock associated to this component. + +- clock-names : the name of the clock referenced by the code. Since we are + using the AMBA framework, the name of the clock providing + the interconnect should be "apb_pclk" and the clock is + mandatory. The interface between the debug logic and the + processor core is clocked by the internal CPU clock, so it + is enabled with CPU clock by default. + +- cpu : the CPU phandle the debug module is affined to. When omitted + the module is considered to belong to CPU0. + +Optional properties: + +- power-domains: a phandle to the debug power domain. We use "power-domains" + binding to turn on the debug logic if it has own dedicated + power domain and if necessary to use "cpuidle.off=1" or + "nohlt" in the kernel command line or sysfs node to + constrain idle states to ensure registers in the CPU power + domain are accessible. + +Example: + + debug@f6590000 { + compatible = "arm,coresight-cpu-debug","arm,primecell"; + reg = <0 0xf6590000 0 0x1000>; + clocks = <&sys_ctrl HI6220_DAPB_CLK>; + clock-names = "apb_pclk"; + cpu = <&cpu0>; + }; From patchwork Thu Apr 6 13:30:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 96972 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp732957obc; Thu, 6 Apr 2017 06:32:19 -0700 (PDT) X-Received: by 10.99.223.70 with SMTP id h6mr36888779pgj.50.1491485539808; Thu, 06 Apr 2017 06:32:19 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10si1879846plg.189.2017.04.06.06.32.19; Thu, 06 Apr 2017 06:32:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934784AbdDFNcR (ORCPT + 9 others); Thu, 6 Apr 2017 09:32:17 -0400 Received: from mail-pg0-f51.google.com ([74.125.83.51]:35932 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934780AbdDFNcL (ORCPT ); Thu, 6 Apr 2017 09:32:11 -0400 Received: by mail-pg0-f51.google.com with SMTP id g2so35935070pge.3 for ; Thu, 06 Apr 2017 06:32:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jnJmJ+Lrai9D8Gp2R8bDviMSQz4NY6FmS9V3fsZ6sG4=; b=OY5JvQecQZK4GzDX+QoT62SECsIAKoxRQ8s5Wq1gtHhITnIud5kP7pdbqECfvKvMcS zSxXfYFtNHSsu7CJVQYxm/QQoZcwvOh47oTB2HmFLV5J1pTUvh+Y8Hbx15+jueCIqiQU 8o81xVy/XjTxCZ9A0HZk7Q6YjAn3vrBG7Cjnc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jnJmJ+Lrai9D8Gp2R8bDviMSQz4NY6FmS9V3fsZ6sG4=; b=ev9viF1saMZigq7emqrmVe4uJ2BXSowIy6JVYqNtL+xo8GRcPerOXJVhq3B3IvnRuc TYfwUnqyStHLgC8VaAb3uC9Ol5TbeiGdIQbdaG/IxPWW49z8EYIu3eJfm3lt6fUWelcz bZlSo6OuBRD37fFX0l1Kv2ACUyiBlRqpY1BVHjiMCiVCIGhXHDGOLe6dvDG2UsJP1yUU sChttcIqH2Prnp82to9wyfVs4Y+pcRkjmIHID35nvvaWeAVOoivHw4hTTdsre7FLNdxz C5ZTBqCiJlJvrICl069Jkk4ITiTvX4IGJjpv/1w4o6YWsTz1GpHJkY6hHtHPt4u19Bl8 0VTQ== X-Gm-Message-State: AFeK/H3DGQgvAFbZyZEf39zDjX10pv3Fvh9KWtEWILdmvqWDMobkLTefN6HVnKaD1Mrwbr5K X-Received: by 10.99.124.71 with SMTP id l7mr36724823pgn.14.1491485530130; Thu, 06 Apr 2017 06:32:10 -0700 (PDT) Received: from localhost.localdomain (li1627-128.members.linode.com. [172.104.47.128]) by smtp.gmail.com with ESMTPSA id 129sm4074223pgj.59.2017.04.06.06.31.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Apr 2017 06:32:09 -0700 (PDT) From: Leo Yan To: Jonathan Corbet , Rob Herring , Mark Rutland , Wei Xu , Catalin Marinas , Will Deacon , Andy Gross , David Brown , Mathieu Poirier , Suzuki K Poulose , Stephen Boyd , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, Mike Leach , Sudeep Holla Cc: Leo Yan Subject: [PATCH v6 2/8] doc: Add documentation for Coresight CPU debug Date: Thu, 6 Apr 2017 21:30:55 +0800 Message-Id: <1491485461-22800-3-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491485461-22800-1-git-send-email-leo.yan@linaro.org> References: <1491485461-22800-1-git-send-email-leo.yan@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Update kernel-parameters.txt to add new parameter: coresight_cpu_debug.enable is a knob to enable debugging at boot time. Add detailed documentation, which contains the implementation, Mike Leach excellent summary for "clock and power domain". At the end some examples on how to enable the debugging functionality are provided. Suggested-by: Mike Leach Signed-off-by: Leo Yan --- Documentation/admin-guide/kernel-parameters.txt | 7 + Documentation/trace/coresight-cpu-debug.txt | 173 ++++++++++++++++++++++++ 2 files changed, 180 insertions(+) create mode 100644 Documentation/trace/coresight-cpu-debug.txt -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index facc20a..cf90146 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -650,6 +650,13 @@ /proc//coredump_filter. See also Documentation/filesystems/proc.txt. + coresight_cpu_debug.enable + [ARM,ARM64] + Format: + Enable/disable the CPU sampling based debugging. + 0: default value, disable debugging + 1: enable debugging at boot time + cpuidle.off=1 [CPU_IDLE] disable the cpuidle sub-system diff --git a/Documentation/trace/coresight-cpu-debug.txt b/Documentation/trace/coresight-cpu-debug.txt new file mode 100644 index 0000000..e7ad05e --- /dev/null +++ b/Documentation/trace/coresight-cpu-debug.txt @@ -0,0 +1,173 @@ + Coresight CPU Debug Module + ========================== + + Author: Leo Yan + Date: April 5th, 2017 + +Introduction +------------ + +Coresight CPU debug module is defined in ARMv8-a architecture reference manual +(ARM DDI 0487A.k) Chapter 'Part H: External debug', the CPU can integrate +debug module and it is mainly used for two modes: self-hosted debug and +external debug. Usually the external debug mode is well known as the external +debugger connects with SoC from JTAG port; on the other hand the program can +explore debugging method which rely on self-hosted debug mode, this document +is to focus on this part. + +The debug module provides sample-based profiling extension, which can be used +to sample CPU program counter, secure state and exception level, etc; usually +every CPU has one dedicated debug module to be connected. Based on self-hosted +debug mechanism, Linux kernel can access these related registers from mmio +region when the kernel panic happens. The callback notifier for kernel panic +will dump related registers for every CPU; finally this is good for assistant +analysis for panic. + + +Implementation +-------------- + +- During driver registration, use EDDEVID and EDDEVID1 two device ID + registers to decide if sample-based profiling is implemented or not. On some + platforms this hardware feature is fully or partialy implemented; and if + this feature is not supported then registration will fail. + +- When write this doc, the debug driver mainly relies on three sampling + registers. The kernel panic callback notifier gathers info from EDPCSR + EDVIDSR and EDCIDSR; from EDPCSR we can get program counter, EDVIDSR has + information for secure state, exception level, bit width, etc; EDCIDSR is + context ID value which contains the sampled value of CONTEXTIDR_EL1. + +- The driver supports CPU running mode with either AArch64 or AArch32. The + registers naming convention is a bit different between them, AArch64 uses + 'ED' for register prefix (ARM DDI 0487A.k, chapter H9.1) and AArch32 uses + 'DBG' as prefix (ARM DDI 0487A.k, chapter G5.1). The driver is unified to + use AArch64 naming convention. + +- ARMv8-a (ARM DDI 0487A.k) and ARMv7-a (ARM DDI 0406C.b) have different + register bits definition. So the driver consolidates two difference: + + If PCSROffset=0b0000. ARMv8-a doesn't apply offset on PCSR, but ARMv7-a + defines "PCSR samples are offset by a value that depends on the instruction + set state". For ARMv7-a, the driver checks furthermore if CPU runs with ARM + or thumb instruction set and calibrate PCSR value, the detailed description + for offset is in ARMv7-a ARM (ARM DDI 0406C.b) chapter C11.11.34 "DBGPCSR, + Program Counter Sampling Register". + + If PCSROffset=0b0010, ARMv8-a defines "EDPCSR implemented, and samples have + no offset applied and do not sample the instruction set state in AArch32 + state". So for the case when CPU runs with AArch32 state and PCSROffset= + 0b0010, the driver considers PCSR doesn't really work. + + +Clock and power domain +---------------------- + +Before accessing debug registers, we should ensure the clock and power domain +have been enabled properly. In ARMv8-a ARM (ARM DDI 0487A.k) chapter 'H9.1 +Debug registers', the debug registers are spread into two domains: the debug +domain and the CPU domain. + + +---------------+ + | | + | | + +----------+--+ | + dbg_clk -->| |**| |<-- cpu_clk + | Debug |**| CPU | + dbg_pd -->| |**| |<-- cpu_pd + +----------+--+ | + | | + | | + +---------------+ + +For debug domain, the user uses DT binding "clocks" and "power-domains" to +specify the corresponding clock source and power supply for the debug logic. +The driver calls the pm_runtime_{put|get} operations as needed to handle the +debug power domain. + +For CPU domain, the different SoC designs have different power management +schemes and finally this heavily impacts external debug module. So we can +divide into below cases: + +- On systems with a sane power controller which can behave correctly with + respect to CPU power domain, the CPU power domain can be controlled by + register EDPRCR in driver. The driver firstly writes bit EDPRCR.COREPURQ + to power up the CPU, and then writes bit EDPRCR.CORENPDRQ for emulation + of CPU power down. As result, this can ensure the CPU power domain is + powered on properly during the period when access debug related registers; + +- Some designs will power down an entire cluster if all CPUs on the cluster + are powered down - including the parts of the debug registers that should + remain powered in the debug power domain. The bits in EDPRCR are not + respected in these cases, so these designs do not really support debug over + power down in the way that the CoreSight / Debug designers anticipated. + This means that even checking EDPRSR has the potential to cause a bus hang + if the target register is unpowered. + + In this case, accessing to the debug registers while they are not powered + is a recipe for disaster; so we need preventing CPU low power states at boot + time or when user enable module at the run time. Please see chapter + "How to use the module" for detailed usage info for this. + + +Device Tree Bindings +-------------------- + +See Documentation/devicetree/bindings/arm/coresight-cpu-debug.txt for details. + + +How to use the module +--------------------- + +If you want to enable debugging functionality at boot time, you can add +"coresight_cpu_debug.enable=1" to the kernel command line parameter. + +The driver also can work as module, so can enable the debugging when insmod +module: +# insmod coresight_cpu_debug.ko debug=1 + +When boot time or insmod module you have not enabled the debugging, the driver +uses the debugfs file system to provide a knob to dynamically enable or disable +debugging: + +To enable it, write a '1' into /sys/kernel/debug/coresight_cpu_debug/enable: +# echo 1 > /sys/kernel/debug/coresight_cpu_debug/enable + +To disable it, write a '0' into /sys/kernel/debug/coresight_cpu_debug/enable: +# echo 0 > /sys/kernel/debug/coresight_cpu_debug/enable + +As explained in chapter "Clock and power domain", if you are working on one +platform which has idle states to power off debug logic and the power +controller cannot work well for the request from EDPRCR, then you should +firstly constraint CPU idle states before enable CPU debugging feature; so can +ensure the accessing to debug logic. + +If you want to limit idle states at boot time, you can use "nohlt" or +"cpuidle.off=1" in the kernel command line. + +At the runtime you can disable idle states with below methods: + +Set latency request to /dev/cpu_dma_latency to disable all CPUs specific idle +states (if latency = 0uS then disable all idle states): +# echo "what_ever_latency_you_need_in_uS" > /dev/cpu_dma_latency + +Disable specific CPU's specific idle state: +# echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable + + +Output format +------------- + +Here is an example of the debugging output format: + +ARM external debug module: +CPU[0]: + EDPRSR: 0000000b (Power:On DLK:Unlock) + EDPCSR: [] handle_IPI+0xe4/0x150 + EDCIDSR: 00000000 + EDVIDSR: 90000000 (State:Non-secure Mode:EL1/0 Width:64bits VMID:0) +CPU[1]: + EDPRSR: 0000000b (Power:On DLK:Unlock) + EDPCSR: [] debug_notifier_call+0x108/0x288 + EDCIDSR: 00000000 + EDVIDSR: 90000000 (State:Non-secure Mode:EL1/0 Width:64bits VMID:0) From patchwork Thu Apr 6 13:30:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 96975 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp733177obc; Thu, 6 Apr 2017 06:32:51 -0700 (PDT) X-Received: by 10.84.132.97 with SMTP id 88mr44196061ple.61.1491485571233; Thu, 06 Apr 2017 06:32:51 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y127si1892000pgy.49.2017.04.06.06.32.50; Thu, 06 Apr 2017 06:32:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934814AbdDFNct (ORCPT + 9 others); Thu, 6 Apr 2017 09:32:49 -0400 Received: from mail-pg0-f50.google.com ([74.125.83.50]:36233 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934818AbdDFNcq (ORCPT ); Thu, 6 Apr 2017 09:32:46 -0400 Received: by mail-pg0-f50.google.com with SMTP id g2so35949915pge.3 for ; Thu, 06 Apr 2017 06:32:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ppaMBM7qYZsHAO2vOvOpTvRShB1FfpzqjSETz4Io1D0=; b=V+b3XVB23RIrJCD+qO7Br8kOqgghtUjSJ0ZBsbiPfjdjMdnqDh5OXz8JwKg67eJMeV QwkouMFQ5jSGEQ9i5Ca2svjqhO/rHPnEQJQt9/x0+0bInJR1vY4Sq0N7KWQ8sI6EISXY +xRSMrDahqCuPqFmGTfqajoaR25Ios3BSI4KA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ppaMBM7qYZsHAO2vOvOpTvRShB1FfpzqjSETz4Io1D0=; b=Kq6oZTq1RP6rPi89dPZygi3EzVJJUBkBjwTi4QW0otdOpcFT5Gg/wmNm9gSOpPIVvo ltmuJm3IcOTUkZ3BP0ZgnOCBoUU5X3przewBnYukZ5jwOBt5BwqTPVIOFosdljjmeKYq Juv95eps+m68PCqz2uxKUezP/No7TTobslBDOW+pBsPRknPOEe1gw5OB29IFkzqvW96L ZLBAuz+KUfbtLEiDcEIFUqDG4WyP5CnQtLwdGcnj0yZC1EcXYQRPU9sj2ybp/BnTegyv 6EmtRYmhmO0A3gSPchhf3ImiKSYF5HKAMbhTOxu9aiPNpK3rOjQDgt5YYHosRQ0UiTvK Oowg== X-Gm-Message-State: AFeK/H1tBw/ecow856+lGERsjXjXCob7W0aEqGb3970ayk4gyMhr08OsPDPCei4cpKdJEPEe X-Received: by 10.99.247.69 with SMTP id f5mr37206773pgk.63.1491485565069; Thu, 06 Apr 2017 06:32:45 -0700 (PDT) Received: from localhost.localdomain (li1627-128.members.linode.com. [172.104.47.128]) by smtp.gmail.com with ESMTPSA id 129sm4074223pgj.59.2017.04.06.06.32.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Apr 2017 06:32:44 -0700 (PDT) From: Leo Yan To: Jonathan Corbet , Rob Herring , Mark Rutland , Wei Xu , Catalin Marinas , Will Deacon , Andy Gross , David Brown , Mathieu Poirier , Suzuki K Poulose , Stephen Boyd , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, Mike Leach , Sudeep Holla Cc: Leo Yan Subject: [PATCH v6 5/8] coresight: use const for device_node structures Date: Thu, 6 Apr 2017 21:30:58 +0800 Message-Id: <1491485461-22800-6-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491485461-22800-1-git-send-email-leo.yan@linaro.org> References: <1491485461-22800-1-git-send-email-leo.yan@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Almost low level functions from open firmware have used const to qualify device_node structures, so add const for device_node parameters in of_coresight related functions. Reviewed-by: Stephen Boyd Signed-off-by: Leo Yan --- drivers/hwtracing/coresight/of_coresight.c | 6 +++--- include/linux/coresight.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c index 78d2399..46eec0f 100644 --- a/drivers/hwtracing/coresight/of_coresight.c +++ b/drivers/hwtracing/coresight/of_coresight.c @@ -52,7 +52,7 @@ of_coresight_get_endpoint_device(struct device_node *endpoint) endpoint, of_dev_node_match); } -static void of_coresight_get_ports(struct device_node *node, +static void of_coresight_get_ports(const struct device_node *node, int *nr_inport, int *nr_outport) { struct device_node *ep = NULL; @@ -101,7 +101,7 @@ static int of_coresight_alloc_memory(struct device *dev, return 0; } -int of_coresight_get_cpu(struct device_node *node) +int of_coresight_get_cpu(const struct device_node *node) { int cpu; bool found; @@ -128,7 +128,7 @@ int of_coresight_get_cpu(struct device_node *node) EXPORT_SYMBOL_GPL(of_coresight_get_cpu); struct coresight_platform_data *of_get_coresight_platform_data( - struct device *dev, struct device_node *node) + struct device *dev, const struct device_node *node) { int i = 0, ret = 0; struct coresight_platform_data *pdata; diff --git a/include/linux/coresight.h b/include/linux/coresight.h index bf96678..4915254 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -263,13 +263,13 @@ static inline int coresight_timeout(void __iomem *addr, u32 offset, #endif #ifdef CONFIG_OF -extern int of_coresight_get_cpu(struct device_node *node); +extern int of_coresight_get_cpu(const struct device_node *node); extern struct coresight_platform_data *of_get_coresight_platform_data( - struct device *dev, struct device_node *node); + struct device *dev, const struct device_node *node); #else -static inline int of_coresight_get_cpu(struct device_node *node) { return 0; } +static inline int of_coresight_get_cpu(const struct device_node *node) { return 0; } static inline struct coresight_platform_data *of_get_coresight_platform_data( - struct device *dev, struct device_node *node) { return NULL; } + struct device *dev, const struct device_node *node) { return NULL; } #endif #ifdef CONFIG_PID_NS From patchwork Thu Apr 6 13:31:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 96978 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp733557obc; Thu, 6 Apr 2017 06:33:44 -0700 (PDT) X-Received: by 10.99.36.194 with SMTP id k185mr35869848pgk.201.1491485624155; Thu, 06 Apr 2017 06:33:44 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t68si1885490pfi.167.2017.04.06.06.33.43; Thu, 06 Apr 2017 06:33:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934719AbdDFNdm (ORCPT + 9 others); Thu, 6 Apr 2017 09:33:42 -0400 Received: from mail-pg0-f43.google.com ([74.125.83.43]:32978 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934873AbdDFNdV (ORCPT ); Thu, 6 Apr 2017 09:33:21 -0400 Received: by mail-pg0-f43.google.com with SMTP id x125so36645235pgb.0 for ; Thu, 06 Apr 2017 06:33:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3iVolIvXg3qQmw1sETyhp24AFQzhTE9koQ8mIEoUemM=; b=HdIAHosD6vA0cxtqy/GA3uhf1U/hHQ/1axvdAC/mvqXuh/bWRAKARIUmDJ08EO48To ev+BTqfxmWDvfGyM+EQ+oCpiUaFFZ5FpvSYEx2YHWYxqzW7yu5zM1F/voJB+p5yLmsdD M9yvYpYTjKqz6UZzNZOsSCt/TopwoOoooiXXs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3iVolIvXg3qQmw1sETyhp24AFQzhTE9koQ8mIEoUemM=; b=BWBUGhFbVx/YFxu1bj6F0kx4Kcv6W8dPyLDHzPAPnL8XzOu49ZRVFJbCFSiLAoykp+ tK/mcRmk6nEmO4J+SJ6uUctNeGG6Zm/B6z1FLVgQFgP4I1lmzUjCr0F7eQAbwLEr6CTf 3fSodDWzvgL85ea+SpTHhuexX9mDIulDzkgGlC7HEdxzHT0A6pscdPYHsZQRekGF2N45 BqebPChWOEJ9z60sqV4USdzlUCQwD3hzLKb2/utj5q+HWD5EKbnmfj42QtsbllR7sXRT o38w3qfJT/+HUVp3KhiQrfG9nSq71ij9dnYV/AH8HbM9zu/zErCWpGVbd1hyK9NGTj6s /TkQ== X-Gm-Message-State: AFeK/H1U+qNup8eEuHcXf6qaaEQWEV1HyuNjePg1fBVm0FxBW4YM0bKD8lznwm1r+wM84yZr X-Received: by 10.98.11.70 with SMTP id t67mr35636821pfi.259.1491485600062; Thu, 06 Apr 2017 06:33:20 -0700 (PDT) Received: from localhost.localdomain (li1627-128.members.linode.com. [172.104.47.128]) by smtp.gmail.com with ESMTPSA id 129sm4074223pgj.59.2017.04.06.06.33.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Apr 2017 06:33:18 -0700 (PDT) From: Leo Yan To: Jonathan Corbet , Rob Herring , Mark Rutland , Wei Xu , Catalin Marinas , Will Deacon , Andy Gross , David Brown , Mathieu Poirier , Suzuki K Poulose , Stephen Boyd , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, Mike Leach , Sudeep Holla Cc: Leo Yan Subject: [PATCH v6 8/8] arm64: dts: qcom: msm8916: Add debug unit Date: Thu, 6 Apr 2017 21:31:01 +0800 Message-Id: <1491485461-22800-9-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491485461-22800-1-git-send-email-leo.yan@linaro.org> References: <1491485461-22800-1-git-send-email-leo.yan@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add debug unit on Qualcomm msm8916 based platforms, including the DragonBoard 410c board. Signed-off-by: Leo Yan --- arch/arm64/boot/dts/qcom/msm8916.dtsi | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi index 68a8e67..3af814b 100644 --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi @@ -1104,6 +1104,38 @@ }; }; + debug@850000 { + compatible = "arm,coresight-cpu-debug","arm,primecell"; + reg = <0x850000 0x1000>; + clocks = <&rpmcc RPM_QDSS_CLK>; + clock-names = "apb_pclk"; + cpu = <&CPU0>; + }; + + debug@852000 { + compatible = "arm,coresight-cpu-debug","arm,primecell"; + reg = <0x852000 0x1000>; + clocks = <&rpmcc RPM_QDSS_CLK>; + clock-names = "apb_pclk"; + cpu = <&CPU1>; + }; + + debug@854000 { + compatible = "arm,coresight-cpu-debug","arm,primecell"; + reg = <0x854000 0x1000>; + clocks = <&rpmcc RPM_QDSS_CLK>; + clock-names = "apb_pclk"; + cpu = <&CPU2>; + }; + + debug@856000 { + compatible = "arm,coresight-cpu-debug","arm,primecell"; + reg = <0x856000 0x1000>; + clocks = <&rpmcc RPM_QDSS_CLK>; + clock-names = "apb_pclk"; + cpu = <&CPU3>; + }; + etm@85c000 { compatible = "arm,coresight-etm4x", "arm,primecell"; reg = <0x85c000 0x1000>;