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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3C1FC433EF for ; Thu, 24 Mar 2022 15:57:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=2VFB4BU8odTYV7V9sCFAjMv7HdOG6viQ/L1OzjnJMAI=; b=JSqdM/Lyic3ETd 12K58YaU6E8lwHK6JwYUdznelEu2xZXVDg3EBRsFnrexMU/mWExulip6WnULzvO0IzWIgnnqlzBb0 DP4S1a7pd2GJaTbApzcL2lQmW0Vt/CtMxRkN6sWdxcshXkICcnefdbEXqrWV4RKA6rqJP0migOUrF gXj+TxKfpiOppXBYAEe/cEBFiVhLqd7FIsk7fe3ZTa4fdelNIivwuRRHkndONlW8qXXS6Ye0xRisS FRgzlvuiI+OBiFRVmuly2yLw/rENY3MtLb4nMzvXjJcewoG0prPPEv2oQ61oboDr1u4Th4RZ+DqOv s+AQ/nyfduBjGJb4SAvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nXPpF-00H4vH-1D; Thu, 24 Mar 2022 15:56:37 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nXPpB-00H4uQ-KF for linux-arm-kernel@lists.infradead.org; Thu, 24 Mar 2022 15:56:35 +0000 Received: by mail-pj1-x1033.google.com with SMTP id p4-20020a17090ad30400b001c7ca87c05bso1121076pju.1 for ; Thu, 24 Mar 2022 08:56:32 -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=ne9OYL5CfWNLmAIU1ktd7k6bzX961vRnh7JsrHpoDCE=; b=Mo5KsPPSgnxGxZkAbOQY4wXE7rPREwoiIpmvFYqkA2rgmGggEsYL7IPCwqlDS1MZxW tRDAp0+YpIQjI813unWjBmL6NWl4EgP8KFOuOTpNtUBJpDyoaAumOWEU4Dh/Gh1EGCYu oEu4rfjYp1y38w6+m35Z9v4plMMCrqnjTuRSWYgxfMY7nKkpVtU9f7N9KxhpMS+zYaGc sE5pCNsfufxQKD6hVtemU9rl3xWOijablRSYktVU7wwqVkV6sDXSUzv+5B+8cDE7f3e/ G1uYT9qT5FYAVOkFp0dGlh2ds8Xn6cDAuFiJ94c2ZX9cdRCCjAzG6V5Tqz0bKj98W0J4 +RIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ne9OYL5CfWNLmAIU1ktd7k6bzX961vRnh7JsrHpoDCE=; b=nOWJdTR6g/6gESjnUwbOm2R2wbtXReKrHLMrCtY7nUszo6hKu2GmN87lGE/Q8Oh2Yy AIrr1aVQBKwqzuAOKLSZrK9x7S7LVCK21V6bUnA0/hPJhUsP7FngpZlMDKmUcSrwd+bd n0MhFmDHBX2Qe7og9HlIH33c79EePtBt37gq8rGIcYUxYT72BMqtTANTWZ/nAnjuX3KD 5pxgA9k+D6kfeH2ifF+1qKyg2s6LTo0a/dfFbuzDmXb02gwqOfYFkqyF5v2Ntc3IM41o S9+fhJqLUtoSIGfe1NCdSaZ+nVV5Tg5NUIx+qyxrhGdeEws88A/y9no2DU2W0xCk0Syh E7/A== X-Gm-Message-State: AOAM532W8kHOtWTytTEtspmomPwhPRdOu7x2H/6fUmXtAWmUh2O2g0N8 aAr+OKTUHLh+JA/CYo27v9pq9g== X-Google-Smtp-Source: ABdhPJy8nDCvoMyZv7HY/JHEm34TZfmOQhWBhT7JqRM3pglG7soXNfBfct5EyFVyJ7HskDz+ILQeQQ== X-Received: by 2002:a17:902:bd88:b0:14f:8ddf:e373 with SMTP id q8-20020a170902bd8800b0014f8ddfe373mr6771743pls.89.1648137391723; Thu, 24 Mar 2022 08:56:31 -0700 (PDT) Received: from p14s (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id f16-20020a056a00239000b004fa7103e13csm4256187pfc.41.2022.03.24.08.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 08:56:30 -0700 (PDT) Date: Thu, 24 Mar 2022 09:56:28 -0600 From: Mathieu Poirier To: Allen-KH Cheng Cc: Ohad Ben-Cohen , Bjorn Andersson , Rob Herring , Matthias Brugger , Tinghan Shen , Project_Global_Chrome_Upstream_Group@mediatek.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-remoteproc@vger.kernel.org Subject: Re: [PATCH] remoteproc: mediatek: enable cache for mt8186 SCP Message-ID: <20220324155628.GC3514576@p14s> References: <20220322122845.4068-1-allen-kh.cheng@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220322122845.4068-1-allen-kh.cheng@mediatek.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220324_085633_748164_B42433BE X-CRM114-Status: GOOD ( 21.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Hi Allen, On Tue, Mar 22, 2022 at 08:28:45PM +0800, Allen-KH Cheng wrote: > 1. Set SCP cache size before loading SCP FW. (8KB+8KB) > 2. Adjust ipi_buf_offset from 0x7bdb0 to 0x3BDB0 for enableing cache > > SCP side > - IPI Buffer: 0x3BDB0 <-> 0x3C000 > - Cache: 0x3C000 <-> 0x40000 > I would also like to find in this changelog "why" this patch is needed and more importantly, how it remains compatible with existing implementation. I am mostly worried about implemenations where the application processor is using caches while the SCP is not. I will also need a couple of "Tested-by" tags before moving forward with this patch. Thanks, Mathieu > Signed-off-by: Allen-KH Cheng > --- > drivers/remoteproc/mtk_scp.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c > index 38609153bf64..24065b6b4da8 100644 > --- a/drivers/remoteproc/mtk_scp.c > +++ b/drivers/remoteproc/mtk_scp.c > @@ -401,6 +401,14 @@ static int mt8186_scp_before_load(struct mtk_scp *scp) > writel(0x0, scp->reg_base + MT8186_SCP_L1_SRAM_PD_P1); > writel(0x0, scp->reg_base + MT8186_SCP_L1_SRAM_PD_p2); > > + /* > + * Set I-cache and D-cache size before loading SCP FW. > + * SCP SRAM logical address may change when cache size setting differs. > + */ > + writel(MT8183_SCP_CACHE_CON_WAYEN | MT8183_SCP_CACHESIZE_8KB, > + scp->reg_base + MT8183_SCP_CACHE_CON); > + writel(MT8183_SCP_CACHESIZE_8KB, scp->reg_base + MT8183_SCP_DCACHE_CON); > + > return 0; > } > > @@ -905,7 +913,7 @@ static const struct mtk_scp_of_data mt8186_of_data = { > .scp_da_to_va = mt8183_scp_da_to_va, > .host_to_scp_reg = MT8183_HOST_TO_SCP, > .host_to_scp_int_bit = MT8183_HOST_IPC_INT_BIT, > - .ipi_buf_offset = 0x7bdb0, > + .ipi_buf_offset = 0x3bdb0, > }; > > static const struct mtk_scp_of_data mt8192_of_data = { > -- > 2.18.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel