From: Mathieu Poirier <mathieu.poirier@linaro.org> To: Tzung-Bi Shih <tzungbi@google.com> Cc: Ohad Ben-Cohen <ohad@wizery.com>, Bjorn Andersson <bjorn.andersson@linaro.org>, Rob Herring <robh+dt@kernel.org>, "open list:REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM" <linux-remoteproc@vger.kernel.org>, Matthias Brugger <matthias.bgg@gmail.com>, "moderated list:ARM/Mediatek SoC support" <linux-mediatek@lists.infradead.org>, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" <devicetree@vger.kernel.org> Subject: Re: [PATCH 2/2] remoteproc/mediatek: support L1TCM Date: Thu, 7 Jan 2021 10:54:04 -0700 [thread overview] Message-ID: <20210107175404.GA33624@xps15> (raw) In-Reply-To: <CA+Px+wXEV9GDCMjR8inbQ89tNV9n7RedeAOGJL_yATmeCLjXJw@mail.gmail.com> On Thu, Jan 07, 2021 at 09:50:21AM +0800, Tzung-Bi Shih wrote: > On Thu, Jan 7, 2021 at 7:15 AM Mathieu Poirier > <mathieu.poirier@linaro.org> wrote: > > > > > static void mt8183_scp_stop(struct mtk_scp *scp) > > > { > > > /* Disable SCP watchdog */ > > > @@ -714,6 +749,19 @@ static int scp_probe(struct platform_device *pdev) > > > goto free_rproc; > > > } > > > scp->sram_size = resource_size(res); > > > + scp->sram_phys = res->start; > > > + > > > + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "l1tcm"); > > > + if (res) { > > > > As far as I can tell the if() condition isn't needed since > > platform_get_resource_byname() returns NULL on error and devm_ioremap_resource() > > is capable of handling that condition. As such the code to parse "l1tcm" can be > > the same as what is done for "sram". > > The "l1tcm" memory region is optional. The if() condition is for: if > DTS doesn't provide the memory region, kernel can skip the code block. > Very well - thanks for the clarification. > > > > With the above: > > > > Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> > > > > > + scp->l1tcm_base = devm_ioremap_resource(dev, res); > > > + if (IS_ERR((__force void *)scp->l1tcm_base)) { > > > + dev_err(dev, "Failed to parse and map l1tcm memory\n"); > > > + ret = PTR_ERR((__force void *)scp->l1tcm_base); > > > + goto free_rproc; > > > + } > > > + scp->l1tcm_size = resource_size(res); > > > + scp->l1tcm_phys = res->start; > > > + }
WARNING: multiple messages have this Message-ID (diff)
From: Mathieu Poirier <mathieu.poirier@linaro.org> To: Tzung-Bi Shih <tzungbi@google.com> Cc: Ohad Ben-Cohen <ohad@wizery.com>, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" <devicetree@vger.kernel.org>, "open list:REMOTE PROCESSOR \(REMOTEPROC\) SUBSYSTEM" <linux-remoteproc@vger.kernel.org>, Bjorn Andersson <bjorn.andersson@linaro.org>, Rob Herring <robh+dt@kernel.org>, "moderated list:ARM/Mediatek SoC support" <linux-mediatek@lists.infradead.org>, Matthias Brugger <matthias.bgg@gmail.com> Subject: Re: [PATCH 2/2] remoteproc/mediatek: support L1TCM Date: Thu, 7 Jan 2021 10:54:04 -0700 [thread overview] Message-ID: <20210107175404.GA33624@xps15> (raw) In-Reply-To: <CA+Px+wXEV9GDCMjR8inbQ89tNV9n7RedeAOGJL_yATmeCLjXJw@mail.gmail.com> On Thu, Jan 07, 2021 at 09:50:21AM +0800, Tzung-Bi Shih wrote: > On Thu, Jan 7, 2021 at 7:15 AM Mathieu Poirier > <mathieu.poirier@linaro.org> wrote: > > > > > static void mt8183_scp_stop(struct mtk_scp *scp) > > > { > > > /* Disable SCP watchdog */ > > > @@ -714,6 +749,19 @@ static int scp_probe(struct platform_device *pdev) > > > goto free_rproc; > > > } > > > scp->sram_size = resource_size(res); > > > + scp->sram_phys = res->start; > > > + > > > + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "l1tcm"); > > > + if (res) { > > > > As far as I can tell the if() condition isn't needed since > > platform_get_resource_byname() returns NULL on error and devm_ioremap_resource() > > is capable of handling that condition. As such the code to parse "l1tcm" can be > > the same as what is done for "sram". > > The "l1tcm" memory region is optional. The if() condition is for: if > DTS doesn't provide the memory region, kernel can skip the code block. > Very well - thanks for the clarification. > > > > With the above: > > > > Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> > > > > > + scp->l1tcm_base = devm_ioremap_resource(dev, res); > > > + if (IS_ERR((__force void *)scp->l1tcm_base)) { > > > + dev_err(dev, "Failed to parse and map l1tcm memory\n"); > > > + ret = PTR_ERR((__force void *)scp->l1tcm_base); > > > + goto free_rproc; > > > + } > > > + scp->l1tcm_size = resource_size(res); > > > + scp->l1tcm_phys = res->start; > > > + } _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek
next prev parent reply other threads:[~2021-01-07 17:54 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-14 5:05 [PATCH 0/2] remoteproc/mediatek: support L1TCM for MT8192 SCP Tzung-Bi Shih 2020-12-14 5:05 ` Tzung-Bi Shih 2020-12-14 5:05 ` [PATCH 1/2] dt-bindings: remoteproc: mediatek: add L1TCM memory region Tzung-Bi Shih 2020-12-14 5:05 ` Tzung-Bi Shih 2020-12-15 17:12 ` Rob Herring 2020-12-15 17:12 ` Rob Herring 2020-12-14 5:05 ` [PATCH 2/2] remoteproc/mediatek: support L1TCM Tzung-Bi Shih 2020-12-14 5:05 ` Tzung-Bi Shih 2021-01-06 23:15 ` Mathieu Poirier 2021-01-06 23:15 ` Mathieu Poirier 2021-01-07 1:50 ` Tzung-Bi Shih 2021-01-07 1:50 ` Tzung-Bi Shih 2021-01-07 17:54 ` Mathieu Poirier [this message] 2021-01-07 17:54 ` Mathieu Poirier 2021-01-07 18:02 ` Bjorn Andersson 2021-01-07 18:02 ` Bjorn Andersson 2021-01-08 3:50 ` Tzung-Bi Shih 2021-01-08 3:50 ` Tzung-Bi Shih
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210107175404.GA33624@xps15 \ --to=mathieu.poirier@linaro.org \ --cc=bjorn.andersson@linaro.org \ --cc=devicetree@vger.kernel.org \ --cc=linux-mediatek@lists.infradead.org \ --cc=linux-remoteproc@vger.kernel.org \ --cc=matthias.bgg@gmail.com \ --cc=ohad@wizery.com \ --cc=robh+dt@kernel.org \ --cc=tzungbi@google.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.