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 DFE34C433EF for ; Mon, 6 Jun 2022 09:52:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233030AbiFFJwj (ORCPT ); Mon, 6 Jun 2022 05:52:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233025AbiFFJwi (ORCPT ); Mon, 6 Jun 2022 05:52:38 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CE9F1091B6; Mon, 6 Jun 2022 02:52:36 -0700 (PDT) X-UUID: 0cb88c1cb1094b2abfed64b3a6c2c6e3-20220606 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.5,REQID:00dcf17f-d879-4fd0-8aae-b3de4726c5f3,OB:0,LO B:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:45,FILE:0,RULE:Release_Ham,ACT ION:release,TS:45 X-CID-INFO: VERSION:1.1.5,REQID:00dcf17f-d879-4fd0-8aae-b3de4726c5f3,OB:0,LOB: 0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:45,FILE:0,RULE:Release_Ham,ACTIO N:release,TS:45 X-CID-META: VersionHash:2a19b09,CLOUDID:a180c0ad-3171-4dd4-a2d9-73b846daf167,C OID:2f8c2e4cc389,Recheck:0,SF:28|17|19|48,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,QS:0,BEC:nil X-UUID: 0cb88c1cb1094b2abfed64b3a6c2c6e3-20220606 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2101235386; Mon, 06 Jun 2022 17:52:33 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Mon, 6 Jun 2022 17:52:31 +0800 Received: from mtksdccf07 (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.3 via Frontend Transport; Mon, 6 Jun 2022 17:52:31 +0800 Message-ID: Subject: Re: [PATCH v1 05/15] remoteproc: mediatek: Add SCP core 1 driver for dual-core scp From: Tinghan Shen To: AngeloGioacchino Del Regno , Bjorn Andersson , Mathieu Poirier , Rob Herring , "Krzysztof Kozlowski" , Matthias Brugger , Lee Jones , Benson Leung , Guenter Roeck , Daisuke Nojiri , Sebastian Reichel , "Dustin L. Howett" , Tzung-Bi Shih , "Gustavo A. R. Silva" , Prashant Malani , "Brian Norris" CC: , , , , , , , Date: Mon, 6 Jun 2022 17:52:31 +0800 In-Reply-To: References: <20220601112201.15510-1-tinghan.shen@mediatek.com> <20220601112201.15510-6-tinghan.shen@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org On Mon, 2022-06-06 at 11:15 +0200, AngeloGioacchino Del Regno wrote: > Il 01/06/22 13:21, Tinghan Shen ha scritto: > > MT8195 SCP is a dual-core processor. The mtk_scp.c driver only controls > > SCP core 0. This patch adds a basic driver to control the another core. > > > > Core 1 and core 0 of the SCP are housed in the same subsys.They see > > registers and memory in the same way. > > > > Core 1 of the SCP features its own set of core configuration registers, > > interrupt controller, timers, and DMAs. The rest of the peripherals > > in this subsystem are shared by core 0 and core 1. > > > > As for memory, core 1 has its own cache memory, and the SCP SRAM is shared > > by core 0 and core 1. > > > > Hello Tinghan, > > checking all the patches that are introducing support for the secondary SCP core, > it's clear that you're practically reusing *most of* mtk_scp in mtk_scp_dual. > > I don't think that adding a new configuration option for MTK_SCP_DUALCORE (nor a > new file just for that) is a good idea... the code is "short enough" so you should > really just add support for multi-core SCP in mtk_scp.c instead. > > After doing so, I have a hunch that we'll be able to reduce the size of this > implementation even more, as I see literally too much common code :-) > Hi Angelo, Thanks for your review. This series has 2 new files, mtk_scp_dual.c and mtk_scp_subdev.c. Is your advice to merge both files into mtk_scp.c, or to merely merge mtk_scp_dual.c to mtk_scp.c? Thanks, TingHan