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 0D436C4332F for ; Wed, 21 Dec 2022 10:56:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234760AbiLUK4B (ORCPT ); Wed, 21 Dec 2022 05:56:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234583AbiLUKzg (ORCPT ); Wed, 21 Dec 2022 05:55:36 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 982B42315C for ; Wed, 21 Dec 2022 02:55:17 -0800 (PST) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p7wkg-0007CM-NR; Wed, 21 Dec 2022 11:55:10 +0100 Received: from mfe by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1p7wke-0004Gd-Jo; Wed, 21 Dec 2022 11:55:08 +0100 Date: Wed, 21 Dec 2022 11:55:08 +0100 From: Marco Felsch To: "Peng Fan (OSS)" Cc: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: Re: [PATCH V2] remoteproc: imx_rproc: use imx specific hook for find_loaded_rsc_table Message-ID: <20221221105508.3ukfhevdn2fv6aud@pengutronix.de> References: <20220111033333.403448-1-peng.fan@oss.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220111033333.403448-1-peng.fan@oss.nxp.com> User-Agent: NeoMutt/20180716 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 22-01-11, Peng Fan (OSS) wrote: > From: Peng Fan > > If there is a resource table device tree node, use the address as > the resource table address, otherwise use the address(where > .resource_table section loaded) inside the Cortex-M elf file. > > And there is an update in NXP SDK that Resource Domain Control(RDC) > enabled to protect TCM, linux not able to write the TCM space when > updating resource table status and cause kernel dump. So use the address > from device tree could avoid kernel dump. > > Note: NXP M4 SDK not check resource table update, so it does not matter > use whether resource table address specified in elf file or in device > tree. But to reflect the fact that if people specific resource table > address in device tree, it means people are aware and going to use it, > not the address specified in elf file. > > Signed-off-by: Peng Fan > --- > > V2: > Update commit message What is the status of this patch? Regards, Marco > > drivers/remoteproc/imx_rproc.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c > index 7a096f1891e6..0bd24c937a73 100644 > --- a/drivers/remoteproc/imx_rproc.c > +++ b/drivers/remoteproc/imx_rproc.c > @@ -499,6 +499,17 @@ static struct resource_table *imx_rproc_get_loaded_rsc_table(struct rproc *rproc > return (struct resource_table *)priv->rsc_table; > } > > +static struct resource_table * > +imx_rproc_elf_find_loaded_rsc_table(struct rproc *rproc, const struct firmware *fw) > +{ > + struct imx_rproc *priv = rproc->priv; > + > + if (priv->rsc_table) > + return (struct resource_table *)priv->rsc_table; > + > + return rproc_elf_find_loaded_rsc_table(rproc, fw); > +} > + > static const struct rproc_ops imx_rproc_ops = { > .prepare = imx_rproc_prepare, > .attach = imx_rproc_attach, > @@ -508,7 +519,7 @@ static const struct rproc_ops imx_rproc_ops = { > .da_to_va = imx_rproc_da_to_va, > .load = rproc_elf_load_segments, > .parse_fw = imx_rproc_parse_fw, > - .find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table, > + .find_loaded_rsc_table = imx_rproc_elf_find_loaded_rsc_table, > .get_loaded_rsc_table = imx_rproc_get_loaded_rsc_table, > .sanity_check = rproc_elf_sanity_check, > .get_boot_addr = rproc_elf_get_boot_addr, > -- > 2.25.1 > >