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=-14.4 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 63DDEC4338F for ; Thu, 5 Aug 2021 16:35:55 +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 35BA3608FC for ; Thu, 5 Aug 2021 16:35:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 35BA3608FC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=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: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=jfr3K1L/+54+Wx0WtSu4EEyWn8bv1xe3RZqhP0aZm7M=; b=l++IbRZfRMmS4G QnnF4+JCRayro9h/7NP/kWBGX8B4PYKULPtL2KT1BJQwZ6G29/tSxMZFMQLtA7Jp8oQGWiCwwMMqM BLAaBaolDy0z3buMh9T0p5YMblMeLWKoiPJ6C8ARuLg8F6c8GO/3ZkNnPc/wmGcImfpCAbxzjd66g HSRf7/+LbXi8HDC55wWqwkP2dO86hmnGBhP/Q0nEzMzk+XlDVRMR/rCnO6cARqMYdoDWPw/Dwg+Fu A/SriPptRXH0YyQrODfdBqtA6MSonf/uWdebAXCzgKSIkMP3syhhhC8/PaeIkt4l7+MxoxOdFsGiY tTEi6Ue/VJ6CZyfcGKlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBgKD-00AG9i-2v; Thu, 05 Aug 2021 16:34:29 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBgK9-00AG8o-Ad for linux-arm-kernel@lists.infradead.org; Thu, 05 Aug 2021 16:34:27 +0000 Received: by mail-pj1-x1029.google.com with SMTP id u21-20020a17090a8915b02901782c36f543so7249835pjn.4 for ; Thu, 05 Aug 2021 09:34:24 -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=aHCFFFYn+n7U/BryuSKWap8A6aGkPSEbjdNxhyBSfHA=; b=JjBOx9U3RSMiX2u02rqk/GNzK4Qvm4TqzXOcaIAGsO389gB6MaSf1LAtg9Y+x8fzLh rVvPcBL93ylV+ptm6yYLrxSVVA8YPEo4IdSxc2axFG1yNh/DQb8gmnGIndme7EXxtgTM DLx4/NjDABvb1Zy8MrhCMz9SmcKNtSTdyO55r7bTuBvctUrUH3+3d8mkRNpeC4/iDwwE EVaIdcoGpyO4vVVzbDhfIC8aADTzQka6LjOLnMWEhq3ZhGaX3WelsCIRqcS1ZqTSoc/e 5L0W5Zdo/iXaYORXuaZ/o1yPTTs+fctTAJoIBDZsjK6FaFiifRxCY6BMhPvgvgAZp2bk CH4A== 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=aHCFFFYn+n7U/BryuSKWap8A6aGkPSEbjdNxhyBSfHA=; b=InqvO5SMJC0EK0X3biT6ZDHwlRrYpcA6oLEBoodK+7EbN7egj8lLMa1PDrF9f5fbKv 9lWf79TU+6GH772a5ubgwn057ZycNKj80Sa09uo8ZOmP2nHruePTBI2Q0lzZoVFOtd86 zdT+Pc8+RLYWtbrUiRPRobvJKMscv8bLfRK73jEr0Sb1agkUN8m6nqtbnktzEYRbN9uC KATGuMUUzGOM41Hi6AtnqOMaF2tOnHGNzyq57Ji3r09W+Hf/bwIqQLCty4yoxTR4Zs9X PyO6rCIeeGABK7tX1eotfBVCQZlAxQq1sy16ADyOBVhQKMrhHLIoRhyvBef95aIhQ3d5 xO/w== X-Gm-Message-State: AOAM53384tHy408hnY3X9ExUaCRh0t3ykriacdML/pdFRaV7RTcZWt8F Ytv3NYrHmrsGZA7y0SN+MZAhKw== X-Google-Smtp-Source: ABdhPJxx1teZZI3KLxBlghLbz0h9MA0taDv5U0o0sNRSSSGsrq1Yk6fYLn+UMJShs2pzlQbm1n4xEw== X-Received: by 2002:a17:90b:4ad1:: with SMTP id mh17mr5543144pjb.164.1628181264106; Thu, 05 Aug 2021 09:34:24 -0700 (PDT) Received: from p14s (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id n17sm8259165pgj.93.2021.08.05.09.34.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Aug 2021 09:34:23 -0700 (PDT) Date: Thu, 5 Aug 2021 10:34:21 -0600 From: Mathieu Poirier To: Peng Fan Cc: Aisheng Dong , "linux-remoteproc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "ohad@wizery.com" , "dongas86@gmail.com" , "bjorn.andersson@linaro.org" , "cleger@kalray.eu" Subject: Re: [PATCH v3 2/5] remoteproc: imx_rproc: fix TCM io memory type Message-ID: <20210805163421.GB3205691@p14s> References: <20210805033206.1295269-1-aisheng.dong@nxp.com> <20210805033206.1295269-2-aisheng.dong@nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210805_093425_451885_365B4C1E X-CRM114-Status: GOOD ( 30.01 ) 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, Aug 05, 2021 at 09:59:00AM +0000, Peng Fan wrote: > > Subject: [PATCH v3 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 > > correctly. > > This patch updates remoteproc driver to indicate the TCM on IMX are io > > memories. Without the change, remoteproc kick will fail. > > > > Cc: Bjorn Andersson > > Cc: Mathieu Poirier > > Cc: Peng Fan > > Fixes: 79806d32d5aa ("remoteproc: imx_rproc: support i.MX8MN/P") > > Signed-off-by: Dong Aisheng Peng added his RB tag during V2 but it wasn't carried here. > > Tested-by: Peng Fan > > > --- > > ChangeLog: > > v2->v3: > > * fix commit message typo and drop imx8ulp fixes tag > > Patch content unchanged. > > 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; > > -- > > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel