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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3DF60C83F33 for ; Mon, 4 Sep 2023 21:17:03 +0000 (UTC) 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=pRaUbBC7ycHb5ySKx11TgkK0rk6+5fpJKGOP2Laia9I=; b=tzmqqfjnKCkL7u ww9srpS4RHIQQY47MhbL9wWMzZ4aRl1xdn/6RICLRAz8ezhi7m0VSs+hnmCYjljcHODX8dccrr4JJ cYwqhXC/AWRljw50dvRoZpg6SwEGwnd7a57uR88BCmak0dHQVscIIpEzXj6DDk7s9nNBPLvWL6OdI XbXu9h4Azu6r0cF3F/QWtTJxg0G1uQ6EVmoSCoonzs0F/T+o7oWu3m+oEv/C1kqTd6hkjTzu98vX8 m2LBMcvHIpqx/a9ObOml1vLFz0b2nHKyd8gzZQAFHDjgdp0bHitdp0gl9Fv2ribiAozsRdogGNOMQ kbKR0yWMLmHqQvB1Dvyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qdGw0-004o8M-0t; Mon, 04 Sep 2023 21:16:36 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qdGvx-004o7z-0Q for linux-arm-kernel@lists.infradead.org; Mon, 04 Sep 2023 21:16:34 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-68c0d4cc3a4so1048401b3a.1 for ; Mon, 04 Sep 2023 14:16:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693862192; x=1694466992; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=e8wgNVpTNDzCrao34l0u3J7l14QWnA5VC866xjk8bCs=; b=TxPDrWVVNvJrwGfYGUdeUQFmH1jzFqqrq/DT6ffhsk5wAddtmlFxur4fq+9XaGNJT5 NasUffkZ/I3PIscJ9yUJDC9IVbJYWRPsYv2L19g4K0tmmdveZvMjkKoBJVC415o0nsGx uNrY5XMNwUepwZ2QYEno6ktBJTjL9Xr53Pf/81wPJjPc1w28EKzBxOl9+YS9ZUc3xcxG fJ0FGCXN78bbPsYHmhSQh2xBEwf9saJsA3PT5sJ+sS6gQ1oZcNvV5k8nVseypUkPqJy4 imAjK7Gr8tCDuDTckwiONVwg7HiqrrWF1rOt5LX9AQObl/gFLFEnM1+03rFIjSDna6LG eruw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693862192; x=1694466992; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=e8wgNVpTNDzCrao34l0u3J7l14QWnA5VC866xjk8bCs=; b=FuiiVoLIA/g+0ADtBY/hnjlCIKI0/XddYXYR/Dqw38vF6II0WNZkWl2sXskDd4LKeF xQP8PFcsEcUkQDZucYjcQJsHtLEPm2b9sAM/LeVyEpztjYu95rf21pqUx/TGZiA3UCYn R7grtjWaDmquskC9XEUMCW1Vf4PwknjWuLAOWdbSe+OAhlMa8rjBVBG5CsixD4S5vG0b HY6gHmuh72+3WM3gIxUSWK6F8a4uqDBxMJ0aFDmcECgWJhEezAQ1je8gyGU1tCPm6tE8 ItJB+ThwKQerjQu/Ofed/IzwI8RX/0eBPctGerVKD7KRcMqLHswp0Iqxy6AvxRuCNs7E ZK2g== X-Gm-Message-State: AOJu0Yzd8+AOj3TPRWozgU6ehEuNrwO1B1GL/ZwrIf6uquezTBgSSyeG nK+DhOvJJrB89sbVBIAvty7zJg== X-Google-Smtp-Source: AGHT+IH7TUfPW532y/4a5gyD3Op0vnux/RtbP+cf8JnuHrM7jURUa8Odo5hrXciGhAVG/SaWM6u0qQ== X-Received: by 2002:a05:6a00:2d94:b0:68a:457f:d3ee with SMTP id fb20-20020a056a002d9400b0068a457fd3eemr10323147pfb.28.1693862191905; Mon, 04 Sep 2023 14:16:31 -0700 (PDT) Received: from p14s ([2604:3d09:148c:c800:4d17:cefe:4740:3fd1]) by smtp.gmail.com with ESMTPSA id r9-20020a62e409000000b00682b299b6besm7719240pfh.70.2023.09.04.14.16.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Sep 2023 14:16:31 -0700 (PDT) Date: Mon, 4 Sep 2023 15:16:28 -0600 From: Mathieu Poirier To: Iuliana Prodan Cc: "Iuliana Prodan (OSS)" , Bjorn Andersson , Shawn Guo , Sascha Hauer , "S.J. Wang" , Fabio Estevam , Daniel Baluta , Mpuaudiosw , linux-imx , linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Pengutronix Kernel Team , LnxRevLi Subject: Re: [PATCH 1/2] remoteproc: imx_dsp_rproc: add mandatory find_loaded_rsc_table op Message-ID: References: <20230712224220.26430-1-iuliana.prodan@oss.nxp.com> <474c0241-a58e-b435-8ac1-82a5a458d79a@nxp.com> <03d7c703-81cb-20f9-aaf8-2ab8ca3e7138@nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <03d7c703-81cb-20f9-aaf8-2ab8ca3e7138@nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230904_141633_176155_3DE064E2 X-CRM114-Status: GOOD ( 38.90 ) 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 Tue, Jul 18, 2023 at 06:40:53PM +0300, Iuliana Prodan wrote: > > On 7/18/2023 6:23 PM, Mathieu Poirier wrote: > > On Tue, Jul 18, 2023 at 11:25:03AM +0300, Iuliana Prodan wrote: > > > On 7/17/2023 8:42 PM, Mathieu Poirier wrote: > > > > On Thu, Jul 13, 2023 at 01:42:20AM +0300, Iuliana Prodan (OSS) wrote: > > > > > From: Iuliana Prodan > > > > > > > > > > Add the .find_loaded_rsc_table operation for i.MX DSP. > > > > > We need it for inter-process communication between DSP > > > > > and main core. > > > > > > > > > > This callback is used to find the resource table (defined > > > > > in remote processor linker script) where the address of the > > > > > vrings along with the other allocated resources (carveouts etc) > > > > > are stored. > > > > > If this is not found, the vrings are not allocated and > > > > > the IPC between cores will not work. > > > > Is there a constraint on the system memory the M4 can address? If so there > > > > will be a need to declare address ranges for vrings and buffers in reserved > > > > memory in the DT. > > > > > > > > Thanks, > > > > Mathieu > > > Hi Mathieu, > > > > > > No, there is no constraint on memory. > > > > > > We want the Cortex A core to communicate with the HiFi4 DSP. > > > The Cortex A is in charge of starting the DSP and loading the firmware in > > > HiFi4's memory. > > > When using rpmsg for IPC, the Cortex A needs to find the resource table > > > (defined in the DSP linker script) and this is done using > > > .find_loaded_rsc_table callback. > > > > > > For the DT, we are using a (not upstream) device tree where we have the > > > reserved-memory for dsp_vdev0vring0, dsp_vdev0vring1 and dsp_vdev0buffer. > > That is the part I'm interested in. Don't we need the reserved-memory entries? > > Otherwise the M4 may not be able to access the memory chosen by the application > > processor, most likely leading to a crash. > > This kernel module (imx_dsp_rproc) is used only for DSP. > For M4 core we use imx_rproc. > The point here is that if I merge this patch and someone tries to load a firmware image that has a resource table, the system will likely crash because reserved memories haven't been specified in the DT. Unless there is a very good reason not to, I would like to see the companion DT changes submitted with this patch so that the feature is complete. > Iulia > > > > Iulia > > > > > > > > > > > Signed-off-by: Iuliana Prodan > > > > > --- > > > > > drivers/remoteproc/imx_dsp_rproc.c | 1 + > > > > > 1 file changed, 1 insertion(+) > > > > > > > > > > diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c > > > > > index d95fa5586189..b5634507d953 100644 > > > > > --- a/drivers/remoteproc/imx_dsp_rproc.c > > > > > +++ b/drivers/remoteproc/imx_dsp_rproc.c > > > > > @@ -941,6 +941,7 @@ static const struct rproc_ops imx_dsp_rproc_ops = { > > > > > .kick = imx_dsp_rproc_kick, > > > > > .load = imx_dsp_rproc_elf_load_segments, > > > > > .parse_fw = imx_dsp_rproc_parse_fw, > > > > > + .find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table, > > > > > .sanity_check = rproc_elf_sanity_check, > > > > > .get_boot_addr = rproc_elf_get_boot_addr, > > > > > }; > > > > > -- > > > > > 2.17.1 > > > > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel