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=-10.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,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 63CB8C07E9C for ; Wed, 14 Jul 2021 10:29:08 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2A68D61363 for ; Wed, 14 Jul 2021 10:29:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A68D61363 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/3lywUM5Yu6iSKtHS2ND2VFlBCNTiUYgT4HpJVx6rXg=; b=WAbyHHgvtMaUjR uqtmnKcHFRWTHg3ngb3CuLwKkeLTm9AEc7RPdVx61OJPI7x1LP9eCcLQei+OBzwHzR3h8AdQ0kMeR ezjf+b3zSJ97yz/S1sHSFVKIXlTxDmu0aUmgVIgCF6fAOIA1NJKm2JW+jeFAl5AWyUYi0LjcULsaE nw3tRWppNn57FidoOrhFxs3+6B43/Z2AqPjFelUMeOn9HDl+F0fjfuZKFrZYudNteib/h9im483E3 3CxD6NDkOkk/p2R5RZCiQTn3lB46XEnkZPoRQxtP1H2AKTp9LuYgEtDBechw9xgBsJJ7XWbapSkva m1z0Ps0ojPZFCYyEMeNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3c6f-00D8B6-7J; Wed, 14 Jul 2021 10:27:09 +0000 Received: from mail-ot1-x32f.google.com ([2607:f8b0:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3c6a-00D88J-RS for linux-arm-kernel@lists.infradead.org; Wed, 14 Jul 2021 10:27:06 +0000 Received: by mail-ot1-x32f.google.com with SMTP id h24-20020a9d64180000b029036edcf8f9a6so1968026otl.3 for ; Wed, 14 Jul 2021 03:27:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=B+tfBuHb7/kW15VVhZVOcs3ykTV6M2hEc298Cb8pdFs=; b=CT/5sKTekuX48StStI0OKf2LFfgOYjHAUilolN36r/Rhhvvfmw0azbYeir6bPIB046 uZ9g99EK0jrDZBcAqneA3LDf7d7bYXvJTMmTe/Oxz8qrMFh5+et3ijGQjLnTkz9kxJ3j 3xmUC4zWzFym/r+9E1qISOqPRyupMOtXtgzwQqCIFer9QeY88Q9rSRLUeq0O+NwAQOPA qB4RagMX+ykVW9mbbcdOBoF1TklOBilxbFvgaHmTC6kN+xA5jBNPaP5dYz7zaaCnTkbb j69c/XnV/xZ+PavH+DZka+ToafHAMHkek6MtHuAlGopDEtuL4vwYYZOMVGr4p8sHGpqF DUCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=B+tfBuHb7/kW15VVhZVOcs3ykTV6M2hEc298Cb8pdFs=; b=Fb/XORnZMXDmDeG7GSgJ4yTHskjcGgNmRj73BPNADsGBhAUiCH0xKVEeQghVGgt06j TyxLTARNGmPjZ8F0Ozi4d6MxkJxS3fM4KNs0LnI6zxE5ztq1FCzScBRxw1EkPt7qUtib FW3zBhhyaddhQtl4MXgS30v5GX5OoYotcS8g6wSHud+1CACdylrB0cKnbYYd6/WkYgQL zOuv+waKUw7vucP/37nksluZGxp4jObYDlPFeUN7NAvgCIuWSQph8xSv0i14IafVlqjH igBbPg9O1hY4nSFVKATv+4KU7loM0Eqz0Bs6EXl0OvSV4k9ehg/r1UAhwJJHuk501eRZ PV4g== X-Gm-Message-State: AOAM531QjGG439/PP7JeRyQMvHazz7HTbBbBG2uvHPFpYk40OAlUBoPX rRWtvRYjUSFrXzTuZ1UGC32crcNqfONVJF/QA5A= X-Google-Smtp-Source: ABdhPJzUbCa3RFYROZmpAKbkzWB0B8WaYQQ2lOejtky5xwZ8qKT6M5NE6pfRm3/JiPNA6GYbY58Jqoj6Zk/npsWrnwc= X-Received: by 2002:a05:6830:160c:: with SMTP id g12mr7508699otr.118.1626258422102; Wed, 14 Jul 2021 03:27:02 -0700 (PDT) MIME-Version: 1.0 References: <20210707094033.1959752-1-aisheng.dong@nxp.com> <20210707094033.1959752-2-aisheng.dong@nxp.com> In-Reply-To: From: Dong Aisheng Date: Wed, 14 Jul 2021 18:25:02 +0800 Message-ID: Subject: Re: [PATCH V2 2/5] remoteproc: imx_rproc: fix TCM io memory type To: Peng Fan Cc: Aisheng Dong , "linux-remoteproc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "ohad@wizery.com" , "bjorn.andersson@linaro.org" , "mathieu.poirier@linaro.org" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210714_032704_920938_4817E6A8 X-CRM114-Status: GOOD ( 29.14 ) 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 Wed, Jul 14, 2021 at 9:12 AM Peng Fan wrote: > > > Subject: [PATCH V2 2/5] remoteproc: imx_rproc: fix TCM io memory type > > > > is_iomem was introduced in the commit 40df0a91b2a5 ("remoteproc: add > > is_iomem to da_to_va"), but the driver seemed missed to provide the io type > > missed->missing > > > correctly. > > This patch updates remoteproc driver to indicate the TCM on IMX are io > > memories. Without the change, remoteroc kick will fail. > > remoteroc->remoteproc > Will fix, thanks. > > > > Cc: Bjorn Andersson > > Cc: Mathieu Poirier > > Cc: Peng Fan > > Fixes: d59eedc0e408 ("remoteproc: imx_rproc: support i.MX8ULP") > > Drop this fix. 8ULP only support ROM loaded M33 images, no > chance to let Kernel load M33 image. Will drop, thanks Regards Aisheng > > > Fixes: 79806d32d5aa ("remoteproc: imx_rproc: support i.MX8MN/P") > > Signed-off-by: Dong Aisheng > > --- > > ChangeLog: > > v1->v2: > > * using ioremap_wc for non TCM memory > > --- > > drivers/remoteproc/imx_rproc.c | 35 ++++++++++++++++++++-------------- > > 1 file changed, 21 insertions(+), 14 deletions(-) > > > > diff --git a/drivers/remoteproc/imx_rproc.c > > b/drivers/remoteproc/imx_rproc.c index d88f76f5305e..71dcc6dd32e4 > > 100644 > > --- a/drivers/remoteproc/imx_rproc.c > > +++ b/drivers/remoteproc/imx_rproc.c > > @@ -71,6 +71,7 @@ struct imx_rproc_mem { > > /* att flags */ > > /* M4 own area. Can be mapped at probe */ > > #define ATT_OWN BIT(1) > > +#define ATT_IOMEM BIT(2) > > > > /* address translation table */ > > struct imx_rproc_att { > > @@ -117,7 +118,7 @@ struct imx_rproc { > > static const struct imx_rproc_att imx_rproc_att_imx8mn[] = { > > /* dev addr , sys addr , size , flags */ > > /* ITCM */ > > - { 0x00000000, 0x007E0000, 0x00020000, ATT_OWN }, > > + { 0x00000000, 0x007E0000, 0x00020000, ATT_OWN | ATT_IOMEM }, > > /* OCRAM_S */ > > { 0x00180000, 0x00180000, 0x00009000, 0 }, > > /* OCRAM */ > > @@ -131,7 +132,7 @@ static const struct imx_rproc_att > > imx_rproc_att_imx8mn[] = { > > /* DDR (Code) - alias */ > > { 0x10000000, 0x40000000, 0x0FFE0000, 0 }, > > /* DTCM */ > > - { 0x20000000, 0x00800000, 0x00020000, ATT_OWN }, > > + { 0x20000000, 0x00800000, 0x00020000, ATT_OWN | ATT_IOMEM }, > > /* OCRAM_S - alias */ > > { 0x20180000, 0x00180000, 0x00008000, ATT_OWN }, > > /* OCRAM */ > > @@ -147,7 +148,7 @@ static const struct imx_rproc_att > > imx_rproc_att_imx8mn[] = { static const struct imx_rproc_att > > imx_rproc_att_imx8mq[] = { > > /* dev addr , sys addr , size , flags */ > > /* TCML - alias */ > > - { 0x00000000, 0x007e0000, 0x00020000, 0 }, > > + { 0x00000000, 0x007e0000, 0x00020000, ATT_IOMEM}, > > /* OCRAM_S */ > > { 0x00180000, 0x00180000, 0x00008000, 0 }, > > /* OCRAM */ > > @@ -159,9 +160,9 @@ static const struct imx_rproc_att > > imx_rproc_att_imx8mq[] = { > > /* DDR (Code) - alias */ > > { 0x10000000, 0x80000000, 0x0FFE0000, 0 }, > > /* TCML */ > > - { 0x1FFE0000, 0x007E0000, 0x00020000, ATT_OWN }, > > + { 0x1FFE0000, 0x007E0000, 0x00020000, ATT_OWN | ATT_IOMEM}, > > /* TCMU */ > > - { 0x20000000, 0x00800000, 0x00020000, ATT_OWN }, > > + { 0x20000000, 0x00800000, 0x00020000, ATT_OWN | ATT_IOMEM}, > > /* OCRAM_S */ > > { 0x20180000, 0x00180000, 0x00008000, ATT_OWN }, > > /* OCRAM */ > > @@ -199,12 +200,12 @@ static const struct imx_rproc_att > > imx_rproc_att_imx7d[] = { > > /* OCRAM_PXP (Code) - alias */ > > { 0x00940000, 0x00940000, 0x00008000, 0 }, > > /* TCML (Code) */ > > - { 0x1FFF8000, 0x007F8000, 0x00008000, ATT_OWN }, > > + { 0x1FFF8000, 0x007F8000, 0x00008000, ATT_OWN | ATT_IOMEM }, > > /* DDR (Code) - alias, first part of DDR (Data) */ > > { 0x10000000, 0x80000000, 0x0FFF0000, 0 }, > > > > /* TCMU (Data) */ > > - { 0x20000000, 0x00800000, 0x00008000, ATT_OWN }, > > + { 0x20000000, 0x00800000, 0x00008000, ATT_OWN | ATT_IOMEM }, > > /* OCRAM (Data) */ > > { 0x20200000, 0x00900000, 0x00020000, 0 }, > > /* OCRAM_EPDC (Data) */ > > @@ -218,18 +219,18 @@ static const struct imx_rproc_att > > imx_rproc_att_imx7d[] = { static const struct imx_rproc_att > > imx_rproc_att_imx6sx[] = { > > /* dev addr , sys addr , size , flags */ > > /* TCML (M4 Boot Code) - alias */ > > - { 0x00000000, 0x007F8000, 0x00008000, 0 }, > > + { 0x00000000, 0x007F8000, 0x00008000, ATT_IOMEM }, > > /* OCRAM_S (Code) */ > > { 0x00180000, 0x008F8000, 0x00004000, 0 }, > > /* OCRAM_S (Code) - alias */ > > { 0x00180000, 0x008FC000, 0x00004000, 0 }, > > /* TCML (Code) */ > > - { 0x1FFF8000, 0x007F8000, 0x00008000, ATT_OWN }, > > + { 0x1FFF8000, 0x007F8000, 0x00008000, ATT_OWN | ATT_IOMEM }, > > /* DDR (Code) - alias, first part of DDR (Data) */ > > { 0x10000000, 0x80000000, 0x0FFF8000, 0 }, > > > > /* TCMU (Data) */ > > - { 0x20000000, 0x00800000, 0x00008000, ATT_OWN }, > > + { 0x20000000, 0x00800000, 0x00008000, ATT_OWN | ATT_IOMEM }, > > /* OCRAM_S (Data) - alias? */ > > { 0x208F8000, 0x008F8000, 0x00004000, 0 }, > > /* DDR (Data) */ > > @@ -341,7 +342,7 @@ static int imx_rproc_stop(struct rproc *rproc) } > > > > static int imx_rproc_da_to_sys(struct imx_rproc *priv, u64 da, > > - size_t len, u64 *sys) > > + size_t len, u64 *sys, bool *is_iomem) > > { > > const struct imx_rproc_dcfg *dcfg = priv->dcfg; > > int i; > > @@ -354,6 +355,8 @@ static int imx_rproc_da_to_sys(struct imx_rproc *priv, > > u64 da, > > unsigned int offset = da - att->da; > > > > *sys = att->sa + offset; > > + if (is_iomem) > > + *is_iomem = att->flags & ATT_IOMEM; > > return 0; > > } > > } > > @@ -377,7 +380,7 @@ static void *imx_rproc_da_to_va(struct rproc *rproc, > > u64 da, size_t len, bool *i > > * On device side we have many aliases, so we need to convert device > > * address (M4) to system bus address first. > > */ > > - if (imx_rproc_da_to_sys(priv, da, len, &sys)) > > + if (imx_rproc_da_to_sys(priv, da, len, &sys, is_iomem)) > > return NULL; > > > > for (i = 0; i < IMX_RPROC_MEM_MAX; i++) { @@ -553,8 +556,12 @@ > > static int imx_rproc_addr_init(struct imx_rproc *priv, > > if (b >= IMX_RPROC_MEM_MAX) > > break; > > > > - priv->mem[b].cpu_addr = devm_ioremap(&pdev->dev, > > - att->sa, att->size); > > + if (att->flags & ATT_IOMEM) > > + priv->mem[b].cpu_addr = devm_ioremap(&pdev->dev, > > + att->sa, att->size); > > + else > > + priv->mem[b].cpu_addr = devm_ioremap_wc(&pdev->dev, > > + att->sa, att->size); > > if (!priv->mem[b].cpu_addr) { > > dev_err(dev, "failed to remap %#x bytes from %#x\n", att->size, > > att->sa); > > return -ENOMEM; > > > Besides the upper comments, looks ok to me. > Reviewed-by: Peng Fan > > > -- > > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel