From patchwork Fri Nov 13 18:45:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 7614001 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7AB6FBF90C for ; Fri, 13 Nov 2015 19:03:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A595F2054B for ; Fri, 13 Nov 2015 19:03:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B6EC920549 for ; Fri, 13 Nov 2015 19:03:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZxJbL-0006Zy-K8; Fri, 13 Nov 2015 19:01:35 +0000 Received: from mail-pa0-x234.google.com ([2607:f8b0:400e:c03::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZxJN4-0006SV-O7 for linux-arm-kernel@lists.infradead.org; Fri, 13 Nov 2015 18:46:57 +0000 Received: by pacej9 with SMTP id ej9so1000126pac.2 for ; Fri, 13 Nov 2015 10:46:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XU9aN9LaMJiyyrlFifbwqbrmv90C2HDPwO5wDUD78D4=; b=WXRjJ/YANv4LCRWqEcSqWBWRlpZ6XDoH+FPuPJ5DTClCyJ3wNhHJ1gT6qJAYt+TXQr tYrhU06B/Z4ExRG/t7BdQSRXLca9b8nw3+6J0uA5w6Z0TDXsvmAuEp5Rj/4l/krBWaSN gr7bGID+IuvqSmRNEDyp/0yB02azf01Ro0+rzC49842L0C7BsH2dN+n0PZAWVZHxnUeZ dsQ9TRJ829HvfZxLrmuJ4JoOjOyCOnXUvFuFfcaUqpFzZ7TY0d7RVuTsPso5Ru52jnvy jutUk6dhJppVGg+GthaTMMJx4gVFsKGsW+Z7CCYIWr3tJ5uSvPYZa0m7/gLo6IjY2lIw 6WZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XU9aN9LaMJiyyrlFifbwqbrmv90C2HDPwO5wDUD78D4=; b=OE2VffbDXtj3Bp/qK6xfq6tFIUT6nMLpG5O+hM5FCmmF1Wp18/PkXA8eIhguEOYAEh anrumu86MLQAfSrt2at7kJTueKAdPS9lOXxu1cKOXyzWHmhX2MmfTzIMllrr0tMR7g8P K8loj+gwkfn/kQpXYrI04DiSzneG5YZUsr3uKnezFVuT4iAtmXWl8O5JKSb177iVSEIr 4T3jtmVPxU5Maos0Ty6AXP3GtbBvD12AT5yuC5mAazWB4fu6U0MfSwIjG4SAS1HX+VUI tjxhVDEp/5uHr2g+Lp5oNiP/Fjk38v74odOODoC7f9JKh7RXf2o+sp5Dngal6LPJ0Mn4 QV0w== X-Gm-Message-State: ALoCoQm3/b0a7M/bED06cyz6iFUypEbgEW/n00PF3gks/L79O3ZhAU71aVB2oEum0RAcIN1RVbwo X-Received: by 10.68.219.3 with SMTP id pk3mr34609554pbc.85.1447440394845; Fri, 13 Nov 2015 10:46:34 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id xi7sm21737967pbc.56.2015.11.13.10.46.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Nov 2015 10:46:34 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org, a.p.zijlstra@chello.nl, alexander.shishkin@linux.intel.com, acme@kernel.org, mingo@redhat.com, corbet@lwn.net, nicolas.pitre@linaro.org Subject: [PATCH V4 12/26] coresight: etm3x: consolidating initial config Date: Fri, 13 Nov 2015 11:45:03 -0700 Message-Id: <1447440317-1977-13-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447440317-1977-1-git-send-email-mathieu.poirier@linaro.org> References: <1447440317-1977-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151113_104651_095410_6B4CC18A X-CRM114-Status: GOOD ( 13.09 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: al.grant@arm.com, mathieu.poirier@linaro.org, pawel.moll@arm.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, fainelli@broadcom.com, adrian.hunter@intel.com, tor@ti.com, mike.leach@arm.com, zhang.chunyan@linaro.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is really no point in having two functions to take care of doing the initials tracer configuration. As such moving everything to 'etm_set_default()'. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm3x.c | 37 ++++++++++----------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c index 4c54e104b610..e973e4d13bcb 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x.c +++ b/drivers/hwtracing/coresight/coresight-etm3x.c @@ -41,7 +41,6 @@ module_param_named(boot_enable, boot_enable, int, S_IRUGO); /* The number of ETM/PTM currently registered */ static int etm_count; static struct etm_drvdata *etmdrvdata[NR_CPUS]; -static void etm_init_default_data(struct etm_config *config); /* * Memory mapped writes to clear os lock are not supported on some processors @@ -199,7 +198,7 @@ struct etm_config *get_etm_config(struct etm_drvdata *drvdata) return NULL; /* Set default config */ - etm_init_default_data(config); + etm_set_default(config); drvdata->config = config; out: return drvdata->config; @@ -212,6 +211,19 @@ void etm_set_default(struct etm_config *config) if (WARN_ON_ONCE(!config)) return; + /* + * Taken verbatim from the TRM: + * + * To trace all memory: + * set bit [24] in register 0x009, the ETMTECR1, to 1 + * set all other bits in register 0x009, the ETMTECR1, to 0 + * set all bits in register 0x007, the ETMTECR2, to 0 + * set register 0x008, the ETMTEEVR, to 0x6F (TRUE). + */ + config->enable_ctrl1 = BIT(24); + config->enable_ctrl2 = 0x0; + config->enable_event = ETM_HARD_WIRE_RES_A; + config->trigger_event = ETM_DEFAULT_EVENT_VAL; config->enable_event = ETM_HARD_WIRE_RES_A; @@ -605,27 +617,6 @@ static void etm_init_arch_data(void *info) CS_LOCK(drvdata->base); } -static void etm_init_default_data(struct etm_config *config) -{ - if (WARN_ON_ONCE(!config)) - return; - - etm_set_default(config); - - /* - * Taken verbatim from the TRM: - * - * To trace all memory: - * set bit [24] in register 0x009, the ETMTECR1, to 1 - * set all other bits in register 0x009, the ETMTECR1, to 0 - * set all bits in register 0x007, the ETMTECR2, to 0 - * set register 0x008, the ETMTEEVR, to 0x6F (TRUE). - */ - config->enable_ctrl1 = BIT(24); - config->enable_ctrl2 = 0x0; - config->enable_event = ETM_HARD_WIRE_RES_A; -} - static void etm_init_trace_id(struct etm_drvdata *drvdata) { /*