From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E50DBC433E0 for ; Thu, 9 Jul 2020 19:30:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B12B720775 for ; Thu, 9 Jul 2020 19:30:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="b93HuIJw"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="eRu13Z0E" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B12B720775 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aVH68i+OSJmzJTuQ5/7ccWAXAsqZbXOuH19mmC0Df9g=; b=b93HuIJwdg9XpfFt5hm7fjvyS KpGT52xw5gBB2iGJO59HWSroQQcJUoDVykddZJ/FSmI8tzIAQmYerVjD1UoFNCklyZXh3dwgnWgLt WSEZIesG4GInVNCzOrCA7mU2dzejq1s4GgeJjW9F5iVhdDCUPYzEc7qUXILB8Fre0ytJDTxlC+60C pJvsz4i2CEKYDJe+SPmtOpvn79UZOgAZTLedbNlVutqz63LN83Jf/xLl25qUnDet0/H2miONGBFSq 0IMsFXLhjH+sVdrhZNPGOILTEqfWCLXuaP021V6qG4k7UVgHsx/WKBBADgmIBphq8bU0I7s+J4pDK CA1J/lS/g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtcEd-0007gC-Kk; Thu, 09 Jul 2020 19:29:32 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtcEZ-0007fW-TV for linux-arm-kernel@lists.infradead.org; Thu, 09 Jul 2020 19:29:29 +0000 Received: by mail-pg1-x544.google.com with SMTP id l63so1388882pge.12 for ; Thu, 09 Jul 2020 12:29:27 -0700 (PDT) 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=x/U7Hyj1lkNWWpCKmP6FeJ+27MCr9OUMUAFO2UtX4yg=; b=eRu13Z0EkubMZlrKLPOJ7ZH9Fg6zy17jy5Vh09YLC/MQc9/t1N/M30Y5gmmdqqxr/E M8gLt+vonkUwcckkl84RgJf5wGq1TAiQIX9pUTQKuN5wU/0Pn7s8CGluxJbWx2sJujVY dcWCt0VkHhoTgydMDFu3FQZRJVYelVsdkZySZWRdk4NjQocply0RMyTrnpyTk5RAhrJV XG1bpymGRsL2i4yE31mQizwHmQhj7qB/XoGVVNEn/QZF0nHUovbceCsBBMLF/RA7I8va 3aywPIJXwNzKKvdQcnX0aD/PyNpjlv8US7ALyLRqtCidzmhTpNaiHssResHno3Zc/VMo +/ew== 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=x/U7Hyj1lkNWWpCKmP6FeJ+27MCr9OUMUAFO2UtX4yg=; b=sySQP8fqwgMGzjjok5He4AQktNBiHOF129czDN3ZarMvCP0L1//Al0RM0eRPySQs7h Z5j1AR92a4s/ijgzwF+G0wfaD1Rh4wAjUfB+eWXZLxEyZLny8o6HDBbNdiJ4Knn8FIYg jYku0wG2PNENB9/1l4OQkW9Fj2JzWuqFqV3YaPWtLiTXS0QiCoCDoPWZLzmjRJA1L+z6 ZkQuf1mXAO0QZx2nc2+YT/g6WzWHEYFAUFkofbcep65sCMEX3MbcfH6Q3sMn/Rzx/HNz g9NhYEooCCUtyvY6TJu1hlvuxYS/0tUGlsU+taYENOHFR279vewtLklkVWAfwgo2Zu41 29FA== X-Gm-Message-State: AOAM5334PjF0Dh37+75694jCXhhVTeZOS2m7ZSd9+jqJNH5+bQHHGb6S S2D161LElTD2nzs7eMuyIXcvHLkQjGk= X-Google-Smtp-Source: ABdhPJxRNWYbm4rzHtO99C40tFaWJAzQnnLjDsK2WcWD1ygXWJHbVEj61vEYDNgrc1iu404itWFSIg== X-Received: by 2002:a65:4349:: with SMTP id k9mr30627877pgq.404.1594322965775; Thu, 09 Jul 2020 12:29:25 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id u26sm3428393pfn.54.2020.07.09.12.29.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2020 12:29:25 -0700 (PDT) Date: Thu, 9 Jul 2020 13:29:23 -0600 From: Mathieu Poirier To: Suman Anna Subject: Re: [PATCH v2 3/4] remoteproc: k3-r5: Initialize TCM memories for ECC Message-ID: <20200709192923.GB948668@xps15> References: <20200630024922.32491-1-s-anna@ti.com> <20200630024922.32491-4-s-anna@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200630024922.32491-4-s-anna@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200709_152928_039281_61C6D044 X-CRM114-Status: GOOD ( 24.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Lokesh Vutla , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Rob Herring , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 29, 2020 at 09:49:21PM -0500, Suman Anna wrote: > The R5F processors on K3 SoCs all have two TCMs (ATCM and BTCM) that > support 32-bit ECC. The TCMs are typically loaded with some boot-up > code to initialize the R5 MPUs to further execute code out of DDR. > The ECC for the TCMs is enabled by default on K3 SoCs due to internal > default tie-off values, but the TCM memories are not initialized on > device power up. Any read access without the corresponding TCM memory > location initialized will generate an ECC error, and any such access > from a A72 or A53 core will trigger a SError. > > So, zero initialize both the TCM memories before loading any firmware > onto a R5F in remoteproc mode. Any R5F booted from U-Boot/SPL would > require a similar initialization in the bootloader. Note that both > the TCMs are initialized unconditionally as the TCM enable config bits > only manage the access and visibility from R5. > > Signed-off-by: Suman Anna > --- > v2: > - Fixed the logic of initializing TCMs even when the resets deassertion > failed > - Dropped the confusing last sentence from the 2nd paragraph of the > patch description > - Revised the patch title to move away from remoteproc/k3-r5 > - Dropped Mathieu's Acked-by because of the changes > v1: https://patchwork.kernel.org/patch/11456371/ > > drivers/remoteproc/ti_k3_r5_remoteproc.c | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) > > diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c > index c4f99e59dc2f..aca0eaf42a38 100644 > --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c > +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c > @@ -363,11 +363,24 @@ static int k3_r5_rproc_prepare(struct rproc *rproc) > > ret = (cluster->mode == CLUSTER_MODE_LOCKSTEP) ? > k3_r5_lockstep_release(cluster) : k3_r5_split_release(core); > - if (ret) > + if (ret) { > dev_err(dev, "unable to enable cores for TCM loading, ret = %d\n", > ret); > + return ret; > + } > > - return ret; > + /* > + * Zero out both TCMs unconditionally (access from v8 Arm core is not > + * affected by ATCM & BTCM enable configuration values) so that ECC > + * can be effective on all TCM addresses. > + */ > + dev_dbg(dev, "zeroing out ATCM memory\n"); > + memset(core->mem[0].cpu_addr, 0x00, core->mem[0].size); > + > + dev_dbg(dev, "zeroing out BTCM memory\n"); > + memset(core->mem[1].cpu_addr, 0x00, core->mem[1].size); > + > + return 0; Reviewed-by: Mathieu Poirier > } > > /* > -- > 2.26.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel