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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A51CAC05027 for ; Thu, 9 Feb 2023 12:43:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229596AbjBIMnO (ORCPT ); Thu, 9 Feb 2023 07:43:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbjBIMnN (ORCPT ); Thu, 9 Feb 2023 07:43:13 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73C145ACD1; Thu, 9 Feb 2023 04:43:12 -0800 (PST) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 74CB866020BA; Thu, 9 Feb 2023 12:43:10 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1675946591; bh=HwlWGSVTMDejL7PaZmKifPyYh1ewmmbzRWCaUaV371s=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Sot1tO8WBzRmvFLFkYF6l1V/Ugw3er4S0AHbdVcp4VvVdn4zw67laXl63h1bbH7jq RKXJtk2M/QD8iF1LrDvmW1PRnnVUW8C3BJqSMJfq0MuGdFzejBUc0bm77wYeBM1Vn0 PJKuAsmGUT0056XrvznfRL8ZEWvXctwm2o3y9vqKTut4qOI2KMWBIm/cYLcu3RjFFy jrLcHk/pn5mbTm6dFiSHXIeigof1iAU4Sx2PSjlM1ibJdPGUyo4/wSGWfeMTpVQhkO y3mdgzz/1B36ipfYcjCKi4AinXs+jqaE+HLRNknh5+J0rC7c6nqiFHxSEWxTcLQIeV zaIYLQO850IDg== Message-ID: <201c6871-4c42-efb6-3f97-04e63ebc2187@collabora.com> Date: Thu, 9 Feb 2023 13:43:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v4 06/12] remoteproc: mediatek: Extract remoteproc initialization flow Content-Language: en-US To: Tinghan Shen , Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger Cc: linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Project_Global_Chrome_Upstream_Group@mediatek.com References: <20230209074021.13936-1-tinghan.shen@mediatek.com> <20230209074021.13936-7-tinghan.shen@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20230209074021.13936-7-tinghan.shen@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org Il 09/02/23 08:40, Tinghan Shen ha scritto: > This is the preparation for probing multi-core SCP. The remoteproc > initialization flow is similar on cores and is reuesd to avoid > redundant code. > > The registers of config and l1tcm are shared for multi-core > SCP. Reuse the mapped addresses for all cores. > > Signed-off-by: Tinghan Shen > --- > drivers/remoteproc/mtk_common.h | 7 +++++ > drivers/remoteproc/mtk_scp.c | 55 +++++++++++++++++++++------------ > 2 files changed, 42 insertions(+), 20 deletions(-) > > diff --git a/drivers/remoteproc/mtk_common.h b/drivers/remoteproc/mtk_common.h > index 3778894c96f3..20c1a90be77d 100644 > --- a/drivers/remoteproc/mtk_common.h > +++ b/drivers/remoteproc/mtk_common.h > @@ -112,6 +112,13 @@ struct mtk_scp_of_data { > size_t ipi_buf_offset; > }; > > +struct mtk_scp_of_regs { That's not a common structure, but rather a commodity for internal flow: the right place for this one is in mtk_scp.c Regards, Angelo > + void __iomem *reg_base; > + void __iomem *l1tcm_base; > + size_t l1tcm_size; > + phys_addr_t l1tcm_phys; > +}; > + > struct mtk_scp { > struct device *dev; > struct rproc *rproc; > diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c > index b92274067522..feebcadd56cd 100644 > --- a/drivers/remoteproc/mtk_scp.c > +++ b/drivers/remoteproc/mtk_scp.c > @@ -854,7 +854,8 @@ static void scp_remove_rpmsg_subdev(struct mtk_scp *scp)