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=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 653FCC433ED for ; Tue, 13 Apr 2021 17:52:03 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 D469E61176 for ; Tue, 13 Apr 2021 17:52:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D469E61176 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=desiato.20200630; 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=TnINTUTp+C/c2H+JTO6J3MkogBZiWCIGVDABkPfX2tI=; b=AZ9mgO0UEEEbmczGpxrgw7nIu h8V9zjJ5ghCohjT85WPHdp87utrIuuWqinXq7Pb3RPeSKBl1TgkeFiF/geoU85P9D9BYIWdd2fLuX LbSws5CSkQnHfEJwFwhLVKI4W8ikWHav179LKo4fjJfoerzplIQwda0hqb4350aFZdVOc5WsiIbZH GPUB66FcNGbiresIJRRG6Kz/M0vFQoqJ1TSqcX+mASkTkTSpJIWCMtQAMl8bVxtlX30pUnpeuczuM FAaOx3GkmKMtjHVzmyiIR3EERUV2+b9jW2yeZQmTLnaP60p1zYuCue6FrkZzVdRvwmWTIGERYeD+g WsLfMcgCw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lWNAe-00A1kR-J7; Tue, 13 Apr 2021 17:49:56 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWNAS-00A1id-Rr for linux-arm-kernel@desiato.infradead.org; Tue, 13 Apr 2021 17:49:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=LR/kpiLYxcoerfHBg9UUUi//0uIfBkykKPg0p1xhzVI=; b=F/plFPwJMmVIU/hRBuo04RLdlV hSnWYxsghlypw0/nZzTZnYTe4PPWA/y+SfM7WNcVJWdYsARhbSQCQORMJr6u2diN7SbIjjYIiL6U4 BGQS/H7vV3mbkBUo3pYwNHhmB5BmvjM9rm2MGFepedkqOJQ6YLQo+qcOT0ewhFaBxkikm98qd9swt K74OpN4X4M/51iUywr7O87hIFg7WU6FcX3MIr6AIWcROQmUT0fppRffqWpjIm8/uO72vliCu3JlsO czpnhEsBKTr4oVZmXWSZCRFdKqL7AYvZYmwNRkb2MXEGTCWb+d20v17lYxYxHfSOSPf73SofWFAc+ SdrynrNw==; Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWNAQ-007ESb-7I for linux-arm-kernel@lists.infradead.org; Tue, 13 Apr 2021 17:49:39 +0000 Received: by mail-pl1-x62c.google.com with SMTP id e2so4337688plh.8 for ; Tue, 13 Apr 2021 10:49:37 -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=LR/kpiLYxcoerfHBg9UUUi//0uIfBkykKPg0p1xhzVI=; b=z754KZYShk0DnqmpTLvEXFBoX0DbtHXAHmHbjtUCupA+saYRfG2GJ1Gz/gaEXxrc2x ScsIoXJEfpADsyfId4tqgPeEtOOo6YoL/BonwEXnu6GVfM2u2fHMsoSVjXrOMWW1Mm7m iawK5Z8H7LcbH2nWR2YTixqvHW3yGPSgSARxS8FTfNVeQWYTYcsvuhjZOf94zVGfsW1j 5FQpHfL1e0eIQYvOFVcgmN8mfTUDre6Wl8cyCH1iaRorc2tdrH9x9ffHhWBvm28E6x1q AKkhqyddw7NiFT48seSctXU5LZXnkNaSEeinTs/ea+Vnm5nsIJ/GpEO6k/i9tO+2/lhk Hl5Q== 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=LR/kpiLYxcoerfHBg9UUUi//0uIfBkykKPg0p1xhzVI=; b=EeD2DyC3EIsVFpFM/oqwCNBlLx9A2JUv9p8kE9wCgZPtQle2k93gQXwRBHcKLyeptO m9AxmGQTMu3SwLT9nOeNKoQBiHeHOlSss/AAxQbeI0WZf4JxmLNW3e6zfUxqbBV9tS9h NMuoiGN80GUPDqkBKn45oncY3B2+LLdsxB/qAuljBGZ9DKXrknSRyO0VR/xqGwFAedgK bTEh4W/oTOUdddLRCPCjVL+hCnvlv7SVStzgi8umeGrwPNMjI8BriBldiBo6Dpf4rv7N nHzZljygwhF4aHs/2qcLyp+qVpBYzoyRNjfibJ3oaO6z4Y46saB9FHTV76cP+ewVBftv +iLw== X-Gm-Message-State: AOAM533SgCC7PKBj7pVXpwvL4po6R20vitMgwNXzr/odQHLFkj4Sk60O Ni4+keLQ0zV+Ygph7/RXMnbsjg== X-Google-Smtp-Source: ABdhPJz91wIZtAKvaPoUmSMwbHZvTMRvzFH8IAjyjJKj/beXEoNWGKzQG/4yV8SCxH8D6vx/1Z4rUA== X-Received: by 2002:a17:90a:fa14:: with SMTP id cm20mr1244169pjb.125.1618336175085; Tue, 13 Apr 2021 10:49:35 -0700 (PDT) Received: from xps15 (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id u7sm2785326pjx.8.2021.04.13.10.49.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Apr 2021 10:49:34 -0700 (PDT) Date: Tue, 13 Apr 2021 11:49:32 -0600 From: Mathieu Poirier To: peng.fan@oss.nxp.com Cc: ohad@wizery.com, bjorn.andersson@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org, devicetree@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: Re: [PATCH V3 7/8] remoteproc: imx_rproc: support i.MX7ULP Message-ID: <20210413174932.GE750651@xps15> References: <1617846898-13662-1-git-send-email-peng.fan@oss.nxp.com> <1617846898-13662-8-git-send-email-peng.fan@oss.nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1617846898-13662-8-git-send-email-peng.fan@oss.nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210413_104938_292217_7F6D8CFD X-CRM114-Status: GOOD ( 21.79 ) 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 On Thu, Apr 08, 2021 at 09:54:57AM +0800, peng.fan@oss.nxp.com wrote: > From: Peng Fan > > i.MX7ULP A7 core runs under control of M4 core, M4 core starts by ROM > and powers most serivces used by A7 core, so A7 core has no power to > start and stop M4 core. > > Signed-off-by: Peng Fan > --- > drivers/remoteproc/imx_rproc.c | 25 ++++++++++++++++++++++--- > 1 file changed, 22 insertions(+), 3 deletions(-) > > diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c > index a7fa9d7fc2d1..b911a7539897 100644 > --- a/drivers/remoteproc/imx_rproc.c > +++ b/drivers/remoteproc/imx_rproc.c > @@ -147,6 +147,14 @@ static const struct imx_rproc_att imx_rproc_att_imx8mq[] = { > { 0x40000000, 0x40000000, 0x80000000, 0 }, > }; > > +static const struct imx_rproc_att imx_rproc_att_imx7ulp[] = { > + {0x1FFD0000, 0x1FFD0000, 0x30000, ATT_OWN}, > + {0x20000000, 0x20000000, 0x10000, ATT_OWN}, > + {0x2F000000, 0x2F000000, 0x20000, ATT_OWN}, > + {0x2F020000, 0x2F020000, 0x20000, ATT_OWN}, > + {0x60000000, 0x60000000, 0x40000000, 0} > +}; > + > static const struct imx_rproc_att imx_rproc_att_imx7d[] = { > /* dev addr , sys addr , size , flags */ > /* OCRAM_S (M4 Boot code) - alias */ > @@ -207,6 +215,12 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mq = { > .method = IMX_RPROC_MMIO, > }; > > +static const struct imx_rproc_dcfg imx_rproc_cfg_imx7ulp = { > + .att = imx_rproc_att_imx7ulp, > + .att_size = ARRAY_SIZE(imx_rproc_att_imx7ulp), > + .method = IMX_RPROC_NONE, > +}; > + > static const struct imx_rproc_dcfg imx_rproc_cfg_imx7d = { > .src_reg = IMX7D_SRC_SCR, > .src_mask = IMX7D_M4_RST_MASK, > @@ -598,12 +612,16 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv) > return ret; > } > > - if (!(val & dcfg->src_stop)) { > - priv->rproc->state = RPROC_DETACHED; > + if (!(val & dcfg->src_stop)) > priv->mode = IMX_RPROC_EARLY_BOOT; > - } > } > > + if (dcfg->method == IMX_RPROC_NONE) > + priv->mode = IMX_RPROC_EARLY_BOOT; As I pointed out there is no need for priv->mode. Just declare a boolean variable that is local to this function and use it to determine the state of the remote processor: if (dcfg->method == IMX_RPROC_NONE) early_boot = true; if (early_boot) priv->rproc->state = RPROC_DETACHED; > + > + if (priv->mode == IMX_RPROC_EARLY_BOOT) > + priv->rproc->state = RPROC_DETACHED; > + > return 0; > } > > @@ -724,6 +742,7 @@ static int imx_rproc_remove(struct platform_device *pdev) > } > > static const struct of_device_id imx_rproc_of_match[] = { > + { .compatible = "fsl,imx7ulp-cm4", .data = &imx_rproc_cfg_imx7ulp }, > { .compatible = "fsl,imx7d-cm4", .data = &imx_rproc_cfg_imx7d }, > { .compatible = "fsl,imx6sx-cm4", .data = &imx_rproc_cfg_imx6sx }, > { .compatible = "fsl,imx8mq-cm4", .data = &imx_rproc_cfg_imx8mq }, > -- > 2.30.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel